mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-27 00:47:43 +01:00
when creating a new MIDI scene change, check existing scene changes for equality and reuse their color (which may or may not be set)
This commit is contained in:
parent
2443209e4a
commit
a4c00fe483
1 changed files with 13 additions and 0 deletions
|
|
@ -310,6 +310,19 @@ MIDISceneChanger::program_change_input (MIDI::Parser& parser, MIDI::byte program
|
|||
|
||||
MIDISceneChange* msc =new MIDISceneChange (channel, bank, program & 0x7f);
|
||||
|
||||
/* check for identical scene change so we can re-use color, if any */
|
||||
|
||||
Locations::LocationList copy (locations->list());
|
||||
|
||||
for (Locations::LocationList::const_iterator l = copy.begin(); l != copy.end(); ++l) {
|
||||
boost::shared_ptr<MIDISceneChange> m = boost::dynamic_pointer_cast<MIDISceneChange>((*l)->scene_change());
|
||||
|
||||
if (m && (*m.get()) == *msc) {
|
||||
msc->set_color (m->color ());
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
loc->set_scene_change (boost::shared_ptr<MIDISceneChange> (msc));
|
||||
|
||||
/* this will generate a "changed" signal to be emitted by locations,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue