summaryrefslogtreecommitdiff
path: root/gtk2_ardour/route_time_axis.cc
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2017-09-09 18:25:36 +0200
committerRobin Gareus <robin@gareus.org>2017-09-09 18:25:36 +0200
commitb5e1eb7538b9119e5b3abfb45d2ddf9f86331ffa (patch)
treee3b6e0f02e1cb172c18ecb6a3633858323b6369b /gtk2_ardour/route_time_axis.cc
parent9e2251a61959a006c6ac272514d61c26ebb2ecaf (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_time_axis.cc')
-rw-r--r--gtk2_ardour/route_time_axis.cc43
1 files changed, 43 insertions, 0 deletions
diff --git a/gtk2_ardour/route_time_axis.cc b/gtk2_ardour/route_time_axis.cc
index 0f7ef1b8f7..e1a7fb9f03 100644
--- a/gtk2_ardour/route_time_axis.cc
+++ b/gtk2_ardour/route_time_axis.cc
@@ -46,6 +46,7 @@
#include "ardour/event_type_map.h"
#include "ardour/pannable.h"
#include "ardour/panner.h"
+#include "ardour/plugin_insert.h"
#include "ardour/processor.h"
#include "ardour/profile.h"
#include "ardour/route_group.h"
@@ -73,6 +74,7 @@
#include "item_counts.h"
#include "keyboard.h"
#include "paste_context.h"
+#include "patch_change_widget.h"
#include "playlist_selector.h"
#include "point_selection.h"
#include "public_editor.h"
@@ -795,6 +797,13 @@ RouteTimeAxisView::build_display_menu ()
items.back().set_sensitive (_editor.get_selection().tracks.size() <= 1);
}
+ if (!is_midi_track () && _route->the_instrument ()) {
+ /* MIDI Bus */
+ items.push_back (MenuElem (_("Patch Selector..."),
+ sigc::mem_fun(*this, &RouteUI::select_midi_patch)));
+ items.push_back (SeparatorElem());
+ }
+
route_group_menu->detach ();
WeakRouteList r;
@@ -2190,8 +2199,42 @@ RouteTimeAxisView::processor_menu_item_toggled (RouteTimeAxisView::ProcessorAuto
}
void
+RouteTimeAxisView::reread_midnam ()
+{
+ boost::shared_ptr<PluginInsert> pi = boost::dynamic_pointer_cast<PluginInsert> (_route->the_instrument ());
+ assert (pi);
+ bool rv = pi->plugin ()->read_midnam();
+
+ if (rv && patch_change_dialog ()) {
+ patch_change_dialog ()->refresh ();
+ }
+}
+
+void
+RouteTimeAxisView::drop_instrument_ref ()
+{
+ midnam_connection.drop_connections ();
+}
+
+void
RouteTimeAxisView::processors_changed (RouteProcessorChange c)
{
+ if (_route) {
+ boost::shared_ptr<Processor> the_instrument (_route->the_instrument());
+ boost::shared_ptr<PluginInsert> pi = boost::dynamic_pointer_cast<PluginInsert> (the_instrument);
+ if (pi && pi->plugin ()->has_midnam ()) {
+ midnam_connection.drop_connections ();
+ the_instrument->DropReferences.connect (midnam_connection, invalidator (*this),
+ boost::bind (&RouteTimeAxisView::drop_instrument_ref, this),
+ gui_context());
+ pi->plugin()->UpdateMidnam.connect (midnam_connection, invalidator (*this),
+ boost::bind (&RouteTimeAxisView::reread_midnam, this),
+ gui_context());
+
+ reread_midnam ();
+ }
+ }
+
if (c.type == RouteProcessorChange::MeterPointChange) {
/* nothing to do if only the meter point has changed */
return;