Silvan: > On Monday 09 January 2006 11:20 am, Brett McCoy wrote: > > A couple weeks ago on the rosegarden-user list we were talking about the > > insertion/deletion of measures into a score [...] > > [...] The problem is figuring out how everything fits together > to a sufficient extent that you can change something in a productive way.
In this case, the way things fit together is probably not all that complicated. The difficult bit is likely to be doing the actual edit correctly, taking into account things like notes that overlap the insertion point or deleted range, what to do with tempo / timesig / clef / key / controller events within a deleted range, ensuring the operation can safely be undone and so on. Briefly, you'd need to make a pair of Command classes (insert time range, delete time range) with constructors that take the insert point or delete range time values and execute and unexecute methods that do the work and undo it respectively. (Possibly they might end up being the same class, with the execute method for insert being the unexecute method for delete - depends on the internal storage structure probably.) These commands would probably go in segmentcommands.cpp. For the work itself, iterate through the Composition (one segment at a time) checking each segment for whether it spans the range and if so editing its events accordingly. (Note that editing the events in a segment is always somewhat hazardous because deleting an event invalidates any segment iterators pointing at it.) Then use the Composition's separate API for tempo and timesig access to query and move these appropriately. Updating the visible editor views and segment canvas should normally happen by magic, you shouldn't have to worry about that (until it goes wrong anyway). Then you'd have to add menu functions in rosegardenguiview and entries for them in rosegardenui.rc. Presumably also a simple dialog box to ask the number of bars etc, though default to 1 for initial testing I guess if you don't want to fuss about with GUI code at this point. Chris ------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click _______________________________________________ Rosegarden-devel mailing list [email protected] - use the link below to unsubscribe https://lists.sourceforge.net/lists/listinfo/rosegarden-devel
