Fix bug #5633, Don't drop all midi bindings when a track is removed

Only drop the controllable that is being destroyed, not all of them.
This commit is contained in:
Tim Mayberry 2016-02-03 22:23:55 +10:00
parent 07f8c04e2e
commit dd05f1e257
2 changed files with 6 additions and 4 deletions

View file

@ -142,7 +142,7 @@ MIDIControllable::set_controllable (Controllable* c)
if (controllable) {
controllable->Destroyed.connect (controllable_death_connection, MISSING_INVALIDATOR,
boost::bind (&MIDIControllable::drop_controllable, this),
boost::bind (&MIDIControllable::drop_controllable, this, _1),
MidiControlUI::instance());
}
}
@ -264,9 +264,11 @@ MIDIControllable::lookup_controllable()
}
void
MIDIControllable::drop_controllable ()
MIDIControllable::drop_controllable (Controllable* c)
{
if (c == controllable) {
set_controllable (0);
}
}
void

View file

@ -142,7 +142,7 @@ class MIDIControllable : public PBD::Stateful
std::string _what;
bool _bank_relative;
void drop_controllable();
void drop_controllable (PBD::Controllable*);
void midi_receiver (MIDI::Parser &p, MIDI::byte *, size_t);
void midi_sense_note (MIDI::Parser &, MIDI::EventTwoBytes *, bool is_on);