I've gotten a fair bit further in logical instruments.

First, I've put the major things back right.  Preview notes play again,
percussion is treated right, metronome plays on the right instrument.  But
there are any number of smaller odds and ends I still have to change over.

The major thing still to do is to give instruments optional fixed
channels, per earlier discussion with Michael.

****** Pre-existing bugs squashed

Serendipitously, I also found and squashed several pre-existing bugs

******* The non-playing trigger bug

You know that subtle bug where sometimes a segment with triggered segments
wouldn't play until it was moved?  I found it and squashed it.  I will
spare you the gory details and the blow-by-blow of how I found it, but it
was a tough one.

Boiled down, SegmentMapper::dump (which is InternalSegmentMapper::dump in
the branch I'm working on) resizes the buffer when it gets triggered
segments, but doesn't set the fill size (setBufferFill) until it's done. 
That means that resizeBuffer copies too little.  This smashes the buffer,
and instead of the real events you get a spate of events at time 0.0
playing on NO_TRACK.  Fixed.

******* Instrument being deleted

Instruments could be deleted while objects still point to them.  That
includes MatrixWidget, InstrumentParameterPanel, InstrumentAliasButton,
RoseXmlHandler, AudioRouteMenu, and my ControllerSearch and
ChannelManager.  This can cause segmentation faults.

I added two signals, "destroyed" (implied by QObject) and
"wholeDeviceDestroyed".  I connected them to the various affected classes,
except I left ControllerSearch and RoseXmlHandler mostly alone.  Most
classes were already checking whether they were NULL, just they'd hold on
to deleted Instrument* pointers.

I know there's the InstrumentId lookup method too, but Instrument* itself
was held by some objects and I figured it'd take a much bigger rewrite to
change them to the InstrumentId way.  I also considered Qt's weak
pointers, but that seemed like a much bigger change too, and heavier.

******* CompositionMapper created redundant SegmentMappers

CompositionMapper used to create redundant SegmentMappers when mapSegment
was called.  By my tracing it seemed to create everything twice.  That
used to do little harm, but in logical-instruments it made me run out of
channels.  Fixed.

****** Question: Are sendNRPN and sendRPN worth updating?

StudioControl::sendNRPN and sendRPN would be affected by this, but it
looks like they aren't ever called anywhere.  Are they used in some subtle
way that escapes me?

I don't want to leave them inconsistent with the rest of RG to bite some
unwary future maintainer, but I don't want to spend time and effort on
them if they don't matter.

        Tom Breton (Tehom)



------------------------------------------------------------------------------
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
_______________________________________________
Rosegarden-devel mailing list
[email protected] - use the link below to unsubscribe
https://lists.sourceforge.net/lists/listinfo/rosegarden-devel

Reply via email to