On Thu, May 20, 2010 at 12:56 PM, Julie S <[email protected]> wrote: > I know RG has code that handles segments and code that handles triggered > segments -- but I never looked at the structure to see if there was any > underlying relationship (OO speaking).
One disadvantage of the triggered segment mechanism for this is that it's rather complicated. Structurally, a triggered segment is an object that points at a segment plus some other information such as the "base pitch" (used when playing back the segment at a different pitch) and other properties describing how the segment will be mangled when you play it back. The segment it points to is not itself part of the normal set of segments in the composition -- it is constructed outside the composition in PasteToTriggerSegmentCommand and then added via Composition::addTriggerSegment, which does not store any reference to it anywhere except in the triggered segment object. (Even so, for some reason the composition continues to "own" it, not the triggered segment.) The triggered segment objects themselves are stored in a special set in the composition. It is probably possible for the segment that is pointed to (i.e. triggered) to be one of the normal segments in the composition, but it would be a bit of a headache trying to work out the proper object lifecycle for it in this situation (especially in terms of interacting with the triggered segment dialog which allows you to do things like deleting the triggered segments). Perhaps a review of triggered segment object lifecycle would be no bad thing anyway, though, as it's not at all clear in the code as it stands. The playback mechanism for triggered segments is also fairly complex and not all that efficient, especially if the triggered segment is large (see mergeTriggerSegment in SegmentMapper.cpp, and the code that calls it). On the other hand, the triggered segment mechanism exists now and appears to be largely functional (!); and it has some extra flexibility because of the fact that a triggered segment has more data associated with it than just the segment itself. This means in theory one could use it to provide "segment symlinks" that did things like play back at different speeds or pitches. Chris ------------------------------------------------------------------------------ _______________________________________________ Rosegarden-devel mailing list [email protected] - use the link below to unsubscribe https://lists.sourceforge.net/lists/listinfo/rosegarden-devel
