summaryrefslogtreecommitdiff
path: root/gtk2_ardour/midi_time_axis.cc
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2017-09-08 19:37:48 +0200
committerRobin Gareus <robin@gareus.org>2017-09-08 23:35:00 +0200
commitc3e8cdb418008d05a927b442eb9291a1cd6f7111 (patch)
tree0ebbc1834b1cfe93620c5ac862e5d91045c1c8c6 /gtk2_ardour/midi_time_axis.cc
parentb7227415ad70a2fd35344f783dcbdc9104d23c36 (diff)
PatchChange Dialog: update title & refresh midnam on change
Diffstat (limited to 'gtk2_ardour/midi_time_axis.cc')
-rw-r--r--gtk2_ardour/midi_time_axis.cc19
1 files changed, 17 insertions, 2 deletions
diff --git a/gtk2_ardour/midi_time_axis.cc b/gtk2_ardour/midi_time_axis.cc
index 9e4d0ed5b1..3627074bc8 100644
--- a/gtk2_ardour/midi_time_axis.cc
+++ b/gtk2_ardour/midi_time_axis.cc
@@ -425,7 +425,7 @@ MidiTimeAxisView::update_patch_selector ()
boost::bind (&MidiTimeAxisView::drop_instrument_ref, this),
gui_context());
pi->plugin()->UpdateMidnam.connect (midnam_connection, invalidator (*this),
- boost::bind (&Plugin::read_midnam, pi->plugin ()),
+ boost::bind (&MidiTimeAxisView::reread_midnam, this),
gui_context());
pluginprovided = true;
@@ -446,6 +446,17 @@ MidiTimeAxisView::update_patch_selector ()
}
void
+MidiTimeAxisView::reread_midnam ()
+{
+ boost::shared_ptr<Processor> the_instrument (_route->the_instrument());
+ boost::shared_ptr<PluginInsert> pi = boost::dynamic_pointer_cast<PluginInsert>(the_instrument);
+ pi->plugin ()->read_midnam();
+
+ if (_patch_change_dialog) {
+ _patch_change_dialog->refresh ();
+ }
+}
+void
MidiTimeAxisView::model_changed(const std::string& model)
{
set_gui_property (X_("midnam-model-name"), model);
@@ -486,6 +497,10 @@ MidiTimeAxisView::model_changed(const std::string& model)
delete controller_menu;
controller_menu = 0;
build_automation_action_menu(false);
+
+ if (_patch_change_dialog) {
+ _patch_change_dialog->refresh ();
+ }
}
void
@@ -1093,7 +1108,7 @@ MidiTimeAxisView::send_patch_change ()
return;
}
- PatchChangeGridDialog* d = new PatchChangeGridDialog (string_compose (_("Select Patch for '%1'"), _route->name ()), _route);
+ PatchChangeGridDialog* d = new PatchChangeGridDialog (_route);
_patch_change_dialog = d;
d->present ();
}