[resending after previous mail bounced from list for some reason]

On Tuesday 13 Jun 2006 14:26, Pedro Lopez-Cabanillas wrote:
> I've added two new methods to the Event class. A private method,
> is_shared(),  compares the shared data pointers of two events, and a
> public method isDuplicated() that is used to check if two events have
> the same properties. This last public method is implemented using the
> private is_shared(), because it is easy and quick, although a bit
> dirty.

Then isDuplicated() should be operator==(const Event &) and should be 
made to work (albeit more slowly) even if the events are equal but not 
shared.  We really don't want the sharing implementation exposed in the 
API, and it's quite possible for events to be the same even if their 
data pointers differ.

> It is necessary to insert a
> copy of the incoming event into each recording segment, because you
> don't want to share the same event pointer in several segments,
> right?

Right.

> A problem comes from the m_noteOnEvents member, which is used to
> calculate note durations. I've changed it to store Event pointers
> instead of Segment::iterator instances, because there is not a single
> recording segment now.

I guess you could store multiple Segment/iterator pairs.  Bulky but 
probably not all that inefficient.


Chris


_______________________________________________
Rosegarden-devel mailing list
Rosegarden-devel@lists.sourceforge.net - use the link below to unsubscribe
https://lists.sourceforge.net/lists/listinfo/rosegarden-devel

Reply via email to