diff options
author | Robin Gareus <robin@gareus.org> | 2017-09-09 18:25:36 +0200 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2017-09-09 18:25:36 +0200 |
commit | b5e1eb7538b9119e5b3abfb45d2ddf9f86331ffa (patch) | |
tree | e3b6e0f02e1cb172c18ecb6a3633858323b6369b /gtk2_ardour/route_ui.cc | |
parent | 9e2251a61959a006c6ac272514d61c26ebb2ecaf (diff) |
Migrate PC dialog to RouteUI, midnam handing to RTAV.
This allows to to bring up the PC dialog from Editor/Editor-Mixer & Mixer
for both MIDI Tracks as well as MIDI Busses.
Diffstat (limited to 'gtk2_ardour/route_ui.cc')
-rw-r--r-- | gtk2_ardour/route_ui.cc | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/gtk2_ardour/route_ui.cc b/gtk2_ardour/route_ui.cc index 9d6a295578..6eca450f17 100644 --- a/gtk2_ardour/route_ui.cc +++ b/gtk2_ardour/route_ui.cc @@ -66,6 +66,7 @@ #include "keyboard.h" #include "latency_gui.h" #include "mixer_strip.h" +#include "patch_change_widget.h" #include "plugin_pin_dialog.h" #include "rgb_macros.h" #include "route_time_axis.h" @@ -121,6 +122,8 @@ RouteUI::~RouteUI() ARDOUR_UI::instance()->gui_object_state->remove_node (route_state_id()); } + delete_patch_change_dialog (); + _route.reset (); /* drop reference to route, so that it can be cleaned up */ route_connections.drop_connections (); @@ -246,6 +249,7 @@ RouteUI::reset () delete mute_menu; mute_menu = 0; + delete_patch_change_dialog (); _color_picker.reset (); denormal_menu_item = 0; @@ -1613,6 +1617,39 @@ RouteUI::toggle_solo_safe (Gtk::CheckMenuItem* check) _route->solo_safe_control()->set_value (check->get_active() ? 1.0 : 0.0, Controllable::UseGroup); } +void +RouteUI::delete_patch_change_dialog () +{ + if (!_route) { + return; + } + delete _route->patch_selector_dialog (); + _route->set_patch_selector_dialog (0); +} + +PatchChangeGridDialog* +RouteUI::patch_change_dialog () const +{ + return _route->patch_selector_dialog (); +} + +void +RouteUI::select_midi_patch () +{ + if (patch_change_dialog ()) { + patch_change_dialog()->present (); + return; + } + + /* note: RouteTimeAxisView is resoponsible to updating + * the Dialog (PatchChangeGridDialog::refresh()) + * when the midnam model changes. + */ + PatchChangeGridDialog* d = new PatchChangeGridDialog (_route); + _route->set_patch_selector_dialog (d); + d->present (); +} + /** Ask the user to choose a colour, and then apply that color to my route */ void RouteUI::choose_color () |