, controller_menu (0)
, poly_pressure_menu (0)
, _step_editor (0)
- , _patch_change_dialog (0)
{
_midnam_model_selector.disable_scrolling();
_midnam_custom_device_mode_selector.disable_scrolling();
update_control_names();
processors_changed (RouteProcessorChange ());
- _route->processors_changed.connect (*this, invalidator (*this),
- boost::bind (&MidiTimeAxisView::processors_changed, this, _1),
- gui_context());
-
if (is_track()) {
_piano_roll_header->SetNoteSelection.connect (
sigc::mem_fun (*this, &MidiTimeAxisView::set_note_selection));
delete controller_menu;
delete _step_editor;
-
- delete _patch_change_dialog;
- _patch_change_dialog = 0;
}
void
}
}
-void
-MidiTimeAxisView::drop_instrument_ref ()
-{
- midnam_connection.drop_connections ();
-}
void
MidiTimeAxisView::start_scroomer_update ()
{
bool pluginprovided = false;
if (_route) {
- boost::shared_ptr<Processor> the_instrument (_route->the_instrument());
- boost::shared_ptr<PluginInsert> pi = boost::dynamic_pointer_cast<PluginInsert>(the_instrument);
+ boost::shared_ptr<PluginInsert> pi = boost::dynamic_pointer_cast<PluginInsert> (_route->the_instrument ());
if (pi && pi->plugin ()->has_midnam ()) {
- midnam_connection.drop_connections ();
- the_instrument->DropReferences.connect (midnam_connection, invalidator (*this),
- boost::bind (&MidiTimeAxisView::drop_instrument_ref, this),
- gui_context());
- pi->plugin()->UpdateMidnam.connect (midnam_connection, invalidator (*this),
- boost::bind (&MidiTimeAxisView::reread_midnam, this),
- gui_context());
- reread_midnam ();
-
pluginprovided = true;
std::string model_name = pi->plugin ()->midnam_model ();
if (gui_property (X_("midnam-model-name")) != model_name) {
}
}
-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);
- bool rv = pi->plugin ()->read_midnam();
- if (rv && _patch_change_dialog) {
- _patch_change_dialog->refresh ();
- }
-}
void
MidiTimeAxisView::model_changed(const std::string& model)
{
controller_menu = 0;
build_automation_action_menu(false);
- if (_patch_change_dialog) {
- _patch_change_dialog->refresh ();
+ if (patch_change_dialog ()) {
+ patch_change_dialog ()->refresh ();
}
}
sigc::mem_fun(*this, &MidiTimeAxisView::toggle_channel_selector)));
items.push_back (MenuElem (_("Patch Selector..."),
- sigc::mem_fun(*this, &MidiTimeAxisView::send_patch_change)));
+ sigc::mem_fun(*this, &RouteUI::select_midi_patch)));
color_mode_menu = build_color_mode_menu();
if (color_mode_menu) {
return mode_menu;
}
-void
-MidiTimeAxisView::send_patch_change ()
-{
- if (!_route) {
- return;
- }
- if (_patch_change_dialog) {
- _patch_change_dialog->present ();
- return;
- }
-
- PatchChangeGridDialog* d = new PatchChangeGridDialog (_route);
- _patch_change_dialog = d;
- d->present ();
-}
-
void
MidiTimeAxisView::set_note_mode(NoteMode mode, bool apply_to_selection)
{
class StepEntry;
class StepEditor;
class MidiChannelSelectorWindow;
-class PatchChangeGridDialog;
#define NO_MIDI_NOTE 0xff
void setup_midnam_patches ();
void update_patch_selector ();
- void drop_instrument_ref ();
- void reread_midnam ();
- PBD::ScopedConnectionList midnam_connection;
void start_scroomer_update ();
void stop_scroomer_update ();
void set_note_mode (ARDOUR::NoteMode mode, bool apply_to_selection = false);
void set_color_mode (ARDOUR::ColorMode, bool force = false, bool redisplay = true, bool apply_to_selection = false);
void set_note_range (MidiStreamView::VisibleNoteRange range, bool apply_to_selection = false);
- void send_patch_change ();
-
void route_active_changed ();
void note_range_changed ();
void contents_height_changed ();
StepEditor* _step_editor;
void immediate_patch_chnage_response (int response);
- PatchChangeGridDialog* _patch_change_dialog;
-
};
#endif /* __ardour_midi_time_axis_h__ */
items.push_back (MenuElem (_("Pin Connections..."), sigc::mem_fun (*this, &RouteUI::manage_pins)));
}
+ if (boost::dynamic_pointer_cast<MidiTrack>(_route) || _route->the_instrument ()) {
+ items.push_back (MenuElem (_("Patch Selector..."),
+ sigc::mem_fun(*this, &RouteUI::select_midi_patch)));
+ }
+
if (_route->the_instrument () && _route->the_instrument ()->output_streams().n_audio() > 2) {
// TODO ..->n_audio() > 1 && separate_output_groups) hard to check here every time.
items.push_back (MenuElem (_("Fan out to Busses"), sigc::bind (sigc::mem_fun (*this, &RouteUI::fan_out), true, true)));
#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"
#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"
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;
}
}
+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;
bool route_group_click (GdkEventButton *);
- void processors_changed (ARDOUR::RouteProcessorChange);
+ virtual void processors_changed (ARDOUR::RouteProcessorChange);
virtual void add_processor_to_subplugin_menu (boost::weak_ptr<ARDOUR::Processor>);
void remove_processor_automation_node (ProcessorAutomationNode* pan);
void update_playlist_tip ();
void parameter_changed (std::string const & p);
void update_track_number_visibility();
+
+ void drop_instrument_ref ();
+ void reread_midnam ();
+ PBD::ScopedConnectionList midnam_connection;
};
#endif /* __ardour_route_time_axis_h__ */
#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"
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 ();
delete mute_menu;
mute_menu = 0;
+ delete_patch_change_dialog ();
_color_picker.reset ();
denormal_menu_item = 0;
_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 ()
class ArdourWindow;
class IOSelectorWindow;
class ControlSlaveUI;
+class PatchChangeGridDialog;
class SaveTemplateDialog;
class RoutePinWindowProxy : public WM::ProxyBase
Gdk::Color route_color () const;
void choose_color ();
+ void select_midi_patch ();
+
bool ignore_toggle;
bool wait_for_release;
bool multiple_mute_change;
bool mark_hidden (bool yn);
+ PatchChangeGridDialog* patch_change_dialog () const;
+
private:
void parameter_changed (std::string const&);
void relabel_solo_button ();
void track_mode_changed ();
+ void delete_patch_change_dialog ();
std::string route_state_id () const;