On Friday 08 Jul 2005 19:49, Stephen Torri wrote: > In your message you talked about using the NotationStaff for when to > draw the Fretboard, what to draw and what to do with the generate image. > In this case the Notation Editor is passed a QPixmap so what to draw is > done so I only need to know when to draw it (time of selected note) and > where (above measure of selected note).
Well, the main point of my last email was supposed to be (perhaps this didn't come through very well) that the notation editor would really like to be able to draw the fretboard at any scale. You can't just pass in a fixed-size pixmap and expect good results -- how would that work when printed, for example? It would either scale very roughly, or come out very small. > From what NotationHLayout and NotationVLayout tell me I must first: > > - Add element (Fretboard drawn on QPixmap) to the Staff at time start > (selected note start) and stop (selected note stop) > - Call scanStaff in NotationHLayout and NotationVLayout The layout classes are called by the staff when rendering. The staff contains a set of ViewElements which wrap Events. If your Event is in the segment, then the staff will automatically try to draw it whether you do anything or not. It will come out blank (or as "?" if you have the relevant option in the Rosegarden config dialog checked) if RG doesn't know how to draw the particular Event type. So, to get a particular Event to draw, you need a bit of logic in NotationStaff::renderSingleElement that retrieves the correct pixmap for that element, or asks something to draw it onto the canvas. The location are those set into the ViewElement wrapper object (which is not something you should need to worry about -- it's just a single wrapper class independent of the event type) by the horizontal and vertical layout classes, which are automatically called over the whole staff by the view's layout process. (You should never have to call scanStaff from anywhere else.) Sorry if this is a bit confusing -- I'm trying to do a few things in a bit of a rush. I hope there's enough information buried in here to get you started. Chris ------------------------------------------------------- This SF.Net email is sponsored by the 'Do More With Dual!' webinar happening July 14 at 8am PDT/11am EDT. We invite you to explore the latest in dual core and dual graphics technology at this free one hour event hosted by HP, AMD, and NVIDIA. To register visit http://www.hp.com/go/dualwebinar _______________________________________________ Rosegarden-devel mailing list [email protected] - use the link below to unsubscribe https://lists.sourceforge.net/lists/listinfo/rosegarden-devel
