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.
This commit is contained in:
Robin Gareus 2017-09-09 18:25:36 +02:00
parent 9e2251a619
commit b5e1eb7538
7 changed files with 100 additions and 62 deletions

View file

@ -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;
@ -2189,9 +2198,43 @@ 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;