5th: fix #563 - do not destroy IPH's on "All Notes Off" MIDI commands
This commit is contained in:
@@ -74,7 +74,7 @@ public:
|
||||
virtual void processInEvent( const MidiEvent& event, const MidiTime& time = MidiTime(), f_cnt_t offset = 0 );
|
||||
virtual void processOutEvent( const MidiEvent& event, const MidiTime& time = MidiTime(), f_cnt_t offset = 0 );
|
||||
// silence all running notes played by this track
|
||||
void silenceAllNotes();
|
||||
void silenceAllNotes( bool removeIPH = false );
|
||||
|
||||
bool isSustainPedalPressed() const
|
||||
{
|
||||
|
||||
@@ -229,7 +229,7 @@ public:
|
||||
return m_playHandles;
|
||||
}
|
||||
|
||||
void removePlayHandles( track * _track );
|
||||
void removePlayHandles( track * _track, bool removeIPHs = true );
|
||||
|
||||
bool hasNotePlayHandles();
|
||||
|
||||
|
||||
@@ -686,13 +686,13 @@ void Mixer::removePlayHandle( PlayHandle * _ph )
|
||||
|
||||
|
||||
|
||||
void Mixer::removePlayHandles( track * _track )
|
||||
void Mixer::removePlayHandles( track * _track, bool removeIPHs )
|
||||
{
|
||||
lock();
|
||||
PlayHandleList::Iterator it = m_playHandles.begin();
|
||||
while( it != m_playHandles.end() )
|
||||
{
|
||||
if( ( *it )->isFromTrack( _track ) )
|
||||
if( ( *it )->isFromTrack( _track ) && ( removeIPHs || ( *it )->type() != PlayHandle::TypeInstrumentPlayHandle ) )
|
||||
{
|
||||
delete *it;
|
||||
it = m_playHandles.erase( it );
|
||||
|
||||
@@ -144,8 +144,8 @@ int InstrumentTrack::baseNote() const
|
||||
|
||||
InstrumentTrack::~InstrumentTrack()
|
||||
{
|
||||
// kill all running notes
|
||||
silenceAllNotes();
|
||||
// kill all running notes and the iph
|
||||
silenceAllNotes( true );
|
||||
|
||||
// now we're save deleting the instrument
|
||||
delete m_instrument;
|
||||
@@ -402,7 +402,7 @@ void InstrumentTrack::processOutEvent( const MidiEvent& event, const MidiTime& t
|
||||
|
||||
|
||||
|
||||
void InstrumentTrack::silenceAllNotes()
|
||||
void InstrumentTrack::silenceAllNotes( bool removeIPH )
|
||||
{
|
||||
engine::mixer()->lock();
|
||||
for( int i = 0; i < NumKeys; ++i )
|
||||
@@ -413,7 +413,7 @@ void InstrumentTrack::silenceAllNotes()
|
||||
|
||||
// invalidate all NotePlayHandles linked to this track
|
||||
m_processHandles.clear();
|
||||
engine::mixer()->removePlayHandles( this );
|
||||
engine::mixer()->removePlayHandles( this, removeIPH );
|
||||
engine::mixer()->unlock();
|
||||
}
|
||||
|
||||
@@ -700,7 +700,7 @@ void InstrumentTrack::saveTrackSpecificSettings( QDomDocument& doc, QDomElement
|
||||
|
||||
void InstrumentTrack::loadTrackSpecificSettings( const QDomElement & thisElement )
|
||||
{
|
||||
silenceAllNotes();
|
||||
silenceAllNotes( true );
|
||||
|
||||
engine::mixer()->lock();
|
||||
|
||||
@@ -776,7 +776,7 @@ void InstrumentTrack::loadTrackSpecificSettings( const QDomElement & thisElement
|
||||
|
||||
Instrument * InstrumentTrack::loadInstrument( const QString & _plugin_name )
|
||||
{
|
||||
silenceAllNotes();
|
||||
silenceAllNotes( true );
|
||||
|
||||
engine::mixer()->lock();
|
||||
delete m_instrument;
|
||||
|
||||
Reference in New Issue
Block a user