Add GUI control to block MIDI patch change on session load

This commit is contained in:
Robin Gareus 2021-07-13 03:29:07 +02:00
parent de3291d10b
commit ab6d46c24c
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04
2 changed files with 12 additions and 0 deletions

View File

@ -635,11 +635,22 @@ MidiTimeAxisView::append_extra_display_menu_items ()
items.push_back (MenuElem (_("Patch Selector..."),
sigc::mem_fun(*this, &RouteUI::select_midi_patch)));
items.push_back (CheckMenuElem (_("Restore Patch")));
Gtk::CheckMenuItem* cmi = dynamic_cast<Gtk::CheckMenuItem *> (&items.back());
cmi->set_active (midi_track ()->restore_pgm_on_load ());
cmi->signal_activate().connect (sigc::mem_fun (*this, &MidiTimeAxisView::toggle_restore_pgm_on_load));
items.push_back (MenuElem (_("Color Mode"), *build_color_mode_menu ()));
items.push_back (SeparatorElem ());
}
void
MidiTimeAxisView::toggle_restore_pgm_on_load ()
{
midi_track ()->set_restore_pgm_on_load (!midi_track ()->restore_pgm_on_load ());
}
void
MidiTimeAxisView::toggle_channel_selector ()
{

View File

@ -174,6 +174,7 @@ private:
void add_single_channel_controller_item (Gtk::Menu_Helpers::MenuList& ctl_items, int ctl, const std::string& name);
void add_multi_channel_controller_item (Gtk::Menu_Helpers::MenuList& ctl_items, uint16_t chanels, int ctl, const std::string& name);
void build_controller_menu ();
void toggle_restore_pgm_on_load ();
void toggle_channel_selector ();
void channel_selector_hidden ();
void set_channel_mode (ARDOUR::ChannelMode, uint16_t);