diff options
author | David Robillard <d@drobilla.net> | 2007-06-23 20:13:13 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2007-06-23 20:13:13 +0000 |
commit | 49ee64ada7f7661067a1dde8c02d40a8e2f6ca66 (patch) | |
tree | b1c4472355e6e3c65ca907c5c3e13959fb2e46cf /gtk2_ardour | |
parent | 05184ed52ffcdcad3c071d4c99287f832f42b74b (diff) |
Insert/Redirect refactoring, towards better MIDI support in mixer strip, and
http://ardour.org/node/1043 style things.
git-svn-id: svn://localhost/ardour2/trunk@2027 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour')
30 files changed, 721 insertions, 787 deletions
diff --git a/gtk2_ardour/audio_time_axis.cc b/gtk2_ardour/audio_time_axis.cc index b515180f2f..f1160e26ec 100644 --- a/gtk2_ardour/audio_time_axis.cc +++ b/gtk2_ardour/audio_time_axis.cc @@ -106,8 +106,8 @@ AudioTimeAxisView::AudioTimeAxisView (PublicEditor& ed, Session& sess, boost::sh /* map current state of the route */ - redirects_changed (0); - reset_redirect_automation_curves (); + inserts_changed (); + reset_insert_automation_curves (); ensure_xml_node (); diff --git a/gtk2_ardour/io_selector.cc b/gtk2_ardour/io_selector.cc index f40ae8d8b7..308db8438d 100644 --- a/gtk2_ardour/io_selector.cc +++ b/gtk2_ardour/io_selector.cc @@ -250,7 +250,7 @@ IOSelector::IOSelector (Session& sess, boost::shared_ptr<IO> ior, bool input) io->output_changed.connect (mem_fun(*this, &IOSelector::ports_changed)); } - io->name_changed.connect (mem_fun(*this, &IOSelector::name_changed)); + io->NameChanged.connect (mem_fun(*this, &IOSelector::name_changed)); } IOSelector::~IOSelector () @@ -298,9 +298,9 @@ IOSelector::set_button_sensitivity () void -IOSelector::name_changed (void* src) +IOSelector::name_changed () { - ENSURE_GUI_THREAD(bind (mem_fun(*this, &IOSelector::name_changed), src)); + ENSURE_GUI_THREAD(mem_fun(*this, &IOSelector::name_changed)); display_ports (); } @@ -765,8 +765,8 @@ IOSelector::redisplay () } PortInsertUI::PortInsertUI (Session& sess, boost::shared_ptr<PortInsert> pi) - : input_selector (sess, pi, true), - output_selector (sess, pi, false) + : input_selector (sess, pi->io(), true), + output_selector (sess, pi->io(), false) { hbox.pack_start (output_selector, true, true); hbox.pack_start (input_selector, true, true); diff --git a/gtk2_ardour/io_selector.h b/gtk2_ardour/io_selector.h index 957db11a2b..625ba12d83 100644 --- a/gtk2_ardour/io_selector.h +++ b/gtk2_ardour/io_selector.h @@ -119,7 +119,7 @@ class IOSelector : public Gtk::VBox { bool port_selection_changed(GdkEventButton *, Gtk::TreeView*); void ports_changed (ARDOUR::IOChange, void *); - void name_changed (void*); + void name_changed (); void add_port (); void remove_port (); diff --git a/gtk2_ardour/ladspa_pluginui.cc b/gtk2_ardour/ladspa_pluginui.cc index 3b99297135..cd585d073a 100644 --- a/gtk2_ardour/ladspa_pluginui.cc +++ b/gtk2_ardour/ladspa_pluginui.cc @@ -103,7 +103,8 @@ LadspaPluginUI::LadspaPluginUI (boost::shared_ptr<PluginInsert> pi, bool scrolla pack_start (hpacker, false, false); } - insert->active_changed.connect (mem_fun(*this, &LadspaPluginUI::redirect_active_changed)); + insert->ActiveChanged.connect (bind(mem_fun(*this, &LadspaPluginUI::insert_active_changed), + boost::weak_ptr<Insert>(insert))); bypass_button.set_active (!insert->active()); build (); @@ -671,11 +672,13 @@ LadspaPluginUI::control_combo_changed (ControlUI* cui) } void -LadspaPluginUI::redirect_active_changed (Redirect* r, void* src) +LadspaPluginUI::insert_active_changed (boost::weak_ptr<Insert> weak_insert) { - ENSURE_GUI_THREAD(bind (mem_fun(*this, &LadspaPluginUI::redirect_active_changed), r, src)); + ENSURE_GUI_THREAD(bind (mem_fun(*this, &LadspaPluginUI::insert_active_changed), weak_insert)); - bypass_button.set_active (!r->active()); + boost::shared_ptr<Insert> insert = weak_insert.lock(); + + bypass_button.set_active (!insert || !insert->active()); } bool diff --git a/gtk2_ardour/midi_time_axis.cc b/gtk2_ardour/midi_time_axis.cc index 64b3ab4998..dd008bd9c5 100644 --- a/gtk2_ardour/midi_time_axis.cc +++ b/gtk2_ardour/midi_time_axis.cc @@ -98,13 +98,13 @@ MidiTimeAxisView::MidiTimeAxisView (PublicEditor& ed, Session& sess, boost::shar /* map current state of the route */ - redirects_changed (0); + inserts_changed (); ensure_xml_node (); set_state (*xml_node); - _route->redirects_changed.connect (mem_fun(*this, &MidiTimeAxisView::redirects_changed)); + _route->inserts_changed.connect (mem_fun(*this, &MidiTimeAxisView::inserts_changed)); if (is_track()) { @@ -174,25 +174,6 @@ MidiTimeAxisView::set_state (const XMLNode& node) } } -// FIXME: duplicated in audio_time_axis.cc -/*static string -legalize_for_xml_node (string str) -{ - string::size_type pos; - string legal_chars = "abcdefghijklmnopqrtsuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_+=:"; - string legal; - - legal = str; - pos = 0; - - while ((pos = legal.find_first_not_of (legal_chars, pos)) != string::npos) { - legal.replace (pos, 1, "_"); - pos += 1; - } - - return legal; -}*/ - void MidiTimeAxisView::route_active_changed () { diff --git a/gtk2_ardour/midi_time_axis.h b/gtk2_ardour/midi_time_axis.h index df1c964fee..17b3d72794 100644 --- a/gtk2_ardour/midi_time_axis.h +++ b/gtk2_ardour/midi_time_axis.h @@ -44,21 +44,13 @@ namespace ARDOUR { class Session; class MidiDiskstream; class RouteGroup; - class Redirect; + class Insert; class Insert; class Location; class MidiPlaylist; } class PublicEditor; -class Selection; -class Selectable; -class AutomationLine; -class AutomationGainLine; -class AutomationPanLine; -class RedirectAutomationLine; -class TimeSelection; -class AutomationTimeAxisView; class MidiTimeAxisView : public RouteTimeAxisView { @@ -76,9 +68,7 @@ class MidiTimeAxisView : public RouteTimeAxisView private: void route_active_changed (); - //void redirects_changed (void *); FIXME? - - void add_redirect_to_subplugin_menu (ARDOUR::Redirect *); + void add_insert_to_subplugin_menu (ARDOUR::Insert *); Gtk::Menu subplugin_menu; }; diff --git a/gtk2_ardour/mixer_strip.cc b/gtk2_ardour/mixer_strip.cc index 4efc2b0340..0c99dc7401 100644 --- a/gtk2_ardour/mixer_strip.cc +++ b/gtk2_ardour/mixer_strip.cc @@ -303,7 +303,7 @@ MixerStrip::MixerStrip (Mixer_UI& mx, Session& sess, boost::shared_ptr<Route> rt get_diskstream()->SpeedChanged.connect (mem_fun(*this, &MixerStrip::speed_changed)); } - _route->name_changed.connect (mem_fun(*this, &RouteUI::name_changed)); + _route->NameChanged.connect (mem_fun(*this, &RouteUI::name_changed)); _route->comment_changed.connect (mem_fun(*this, &MixerStrip::comment_changed)); _route->gui_changed.connect (mem_fun(*this, &MixerStrip::route_gui_changed)); @@ -336,7 +336,7 @@ MixerStrip::MixerStrip (Mixer_UI& mx, Session& sess, boost::shared_ptr<Route> rt post_redirect_box.update(); mute_changed (0); solo_changed (0); - name_changed (0); + name_changed (); comment_changed (0); mix_group_changed (0); @@ -469,7 +469,7 @@ MixerStrip::set_width (Width w, void* owner) update_input_display (); update_output_display (); mix_group_changed (0); - name_changed (0); + name_changed (); } @@ -1078,11 +1078,11 @@ MixerStrip::set_selected (bool yn) } void -MixerStrip::name_changed (void *src) +MixerStrip::name_changed () { switch (_width) { case Wide: - RouteUI::name_changed (src); + RouteUI::name_changed (); break; case Narrow: name_label.set_text (PBD::short_version (_route->name(), 5)); @@ -1149,13 +1149,13 @@ MixerStrip::map_frozen () break; } } - _route->foreach_redirect (this, &MixerStrip::hide_redirect_editor); + _route->foreach_insert (this, &MixerStrip::hide_insert_editor); } void -MixerStrip::hide_redirect_editor (boost::shared_ptr<Redirect> redirect) +MixerStrip::hide_insert_editor (boost::shared_ptr<Insert> insert) { - void* gui = redirect->get_gui (); + void* gui = insert->get_gui (); if (gui) { static_cast<Gtk::Widget*>(gui)->hide (); diff --git a/gtk2_ardour/mixer_strip.h b/gtk2_ardour/mixer_strip.h index eb57037808..98675d503b 100644 --- a/gtk2_ardour/mixer_strip.h +++ b/gtk2_ardour/mixer_strip.h @@ -236,10 +236,10 @@ class MixerStrip : public RouteUI, public Gtk::EventBox void speed_adjustment_changed (); void speed_changed (); - void name_changed (void *src); + void name_changed (); void update_speed_display (); void map_frozen (); - void hide_redirect_editor (boost::shared_ptr<ARDOUR::Redirect> redirect); + void hide_insert_editor (boost::shared_ptr<ARDOUR::Insert> insert); bool ignore_speed_adjustment; diff --git a/gtk2_ardour/mixer_ui.cc b/gtk2_ardour/mixer_ui.cc index fbc5703fb2..665420fdbd 100644 --- a/gtk2_ardour/mixer_ui.cc +++ b/gtk2_ardour/mixer_ui.cc @@ -292,7 +292,7 @@ Mixer_UI::add_strip (Session::RouteList& routes) no_track_list_redisplay = false; redisplay_track_list (); - route->name_changed.connect (bind (mem_fun(*this, &Mixer_UI::strip_name_changed), strip)); + route->NameChanged.connect (bind (mem_fun(*this, &Mixer_UI::strip_name_changed), strip)); strip->GoingAway.connect (bind (mem_fun(*this, &Mixer_UI::remove_strip), strip)); strip->signal_button_release_event().connect (bind (mem_fun(*this, &Mixer_UI::strip_button_release_event), strip)); @@ -738,9 +738,9 @@ Mixer_UI::build_track_menu () } void -Mixer_UI::strip_name_changed (void* src, MixerStrip* mx) +Mixer_UI::strip_name_changed (MixerStrip* mx) { - ENSURE_GUI_THREAD(bind (mem_fun(*this, &Mixer_UI::strip_name_changed), src, mx)); + ENSURE_GUI_THREAD(bind (mem_fun(*this, &Mixer_UI::strip_name_changed), mx)); TreeModel::Children rows = track_model->children(); TreeModel::Children::iterator i; diff --git a/gtk2_ardour/mixer_ui.h b/gtk2_ardour/mixer_ui.h index bf9c9cbd18..d4fb6d0fb7 100644 --- a/gtk2_ardour/mixer_ui.h +++ b/gtk2_ardour/mixer_ui.h @@ -178,7 +178,7 @@ class Mixer_UI : public Gtk::Window PluginSelector *_plugin_selector; - void strip_name_changed (void *src, MixerStrip *); + void strip_name_changed (MixerStrip *); void group_flags_changed (void *src, ARDOUR::RouteGroup *); diff --git a/gtk2_ardour/plugin_ui.cc b/gtk2_ardour/plugin_ui.cc index d46cea5eeb..80bd9ba6f3 100644 --- a/gtk2_ardour/plugin_ui.cc +++ b/gtk2_ardour/plugin_ui.cc @@ -208,6 +208,6 @@ PlugUIBase::bypass_toggled () bool x; if ((x = bypass_button.get_active()) == insert->active()) { - insert->set_active (!x, this); + insert->set_active (!x); } } diff --git a/gtk2_ardour/plugin_ui.h b/gtk2_ardour/plugin_ui.h index 2f15356c61..a505f80576 100644 --- a/gtk2_ardour/plugin_ui.h +++ b/gtk2_ardour/plugin_ui.h @@ -180,7 +180,7 @@ class LadspaPluginUI : public PlugUIBase, public Gtk::VBox void control_port_toggled (ControlUI* cui); void control_combo_changed (ControlUI* cui); - void redirect_active_changed (ARDOUR::Redirect*, void*); + void insert_active_changed (boost::weak_ptr<ARDOUR::Insert>); void astate_clicked (ControlUI*, uint32_t parameter); void automation_state_changed (ControlUI*); diff --git a/gtk2_ardour/redirect_automation_line.cc b/gtk2_ardour/redirect_automation_line.cc index 0714a2bdbb..89b6fb4f2a 100644 --- a/gtk2_ardour/redirect_automation_line.cc +++ b/gtk2_ardour/redirect_automation_line.cc @@ -33,7 +33,7 @@ using namespace std; using namespace ARDOUR; using namespace PBD; -RedirectAutomationLine::RedirectAutomationLine (const string & name, Redirect& rd, uint32_t port, Session& s, +RedirectAutomationLine::RedirectAutomationLine (const string & name, Insert& i, uint32_t port, Session& s, TimeAxisView& tv, ArdourCanvas::Group& parent, @@ -41,16 +41,16 @@ RedirectAutomationLine::RedirectAutomationLine (const string & name, Redirect& r : AutomationLine (name, tv, parent, l), session (s), - _redirect (rd), + _insert (i), _port (port) { - set_verbose_cursor_uses_gain_mapping (false); + set_verbose_cursor_uses_gain_mapping (false); PluginInsert *pi; Plugin::ParameterDescriptor desc; - if ((pi = dynamic_cast<PluginInsert*>(&_redirect)) == 0) { - fatal << _("redirect automation created for non-plugin") << endmsg; + if ((pi = dynamic_cast<PluginInsert*>(&_insert)) == 0) { + fatal << _("insert automation created for non-plugin") << endmsg; /*NOTREACHED*/ } diff --git a/gtk2_ardour/redirect_automation_line.h b/gtk2_ardour/redirect_automation_line.h index 71e4d23e64..33d411e48e 100644 --- a/gtk2_ardour/redirect_automation_line.h +++ b/gtk2_ardour/redirect_automation_line.h @@ -26,7 +26,7 @@ namespace ARDOUR { class Session; - class Redirect; + class Insert; } class TimeAxisView; @@ -34,17 +34,17 @@ class TimeAxisView; class RedirectAutomationLine : public AutomationLine { public: - RedirectAutomationLine (const string & name, ARDOUR::Redirect&, uint32_t port, ARDOUR::Session&, TimeAxisView&, + RedirectAutomationLine (const string & name, ARDOUR::Insert&, uint32_t port, ARDOUR::Session&, TimeAxisView&, ArdourCanvas::Group& parent, ARDOUR::AutomationList&); uint32_t port() const { return _port; } - ARDOUR::Redirect& redirect() const { return _redirect; } + ARDOUR::Insert& insert() const { return _insert; } string get_verbose_cursor_string (float); private: ARDOUR::Session& session; - ARDOUR::Redirect& _redirect; + ARDOUR::Insert& _insert; uint32_t _port; float upper; float lower; diff --git a/gtk2_ardour/redirect_automation_time_axis.cc b/gtk2_ardour/redirect_automation_time_axis.cc index acffda4ff1..9df0bb9e0c 100644 --- a/gtk2_ardour/redirect_automation_time_axis.cc +++ b/gtk2_ardour/redirect_automation_time_axis.cc @@ -17,7 +17,7 @@ */ -#include <ardour/redirect.h> +#include <ardour/insert.h> #include <ardour/session.h> #include <cstdlib> #include <pbd/memento_command.h> @@ -34,11 +34,11 @@ using namespace Gtk; RedirectAutomationTimeAxisView::RedirectAutomationTimeAxisView (Session& s, boost::shared_ptr<Route> r, PublicEditor& e, TimeAxisView& parent, Canvas& canvas, std::string n, - uint32_t prt, Redirect& rd, string state_name) + uint32_t prt, Insert& i, string state_name) : AxisView (s), - AutomationTimeAxisView (s, r, e, parent, canvas, n, state_name, rd.name()), - redirect (rd), + AutomationTimeAxisView (s, r, e, parent, canvas, n, state_name, i.name()), + insert (i), port (prt) { @@ -91,9 +91,9 @@ RedirectAutomationTimeAxisView::add_automation_event (ArdourCanvas::Item* item, /* map to model space */ if (!lines.empty()) { - AutomationList& alist (redirect.automation_list(port)); + AutomationList& alist (insert.automation_list(port)); string description = _("add automation event to "); - description += redirect.describe_parameter (port); + description += insert.describe_parameter (port); lines.front()->view_to_model_y (y); @@ -111,9 +111,9 @@ void RedirectAutomationTimeAxisView::ensure_xml_node () { if (xml_node == 0) { - if ((xml_node = redirect.extra_xml ("GUI")) == 0) { + if ((xml_node = insert.extra_xml ("GUI")) == 0) { xml_node = new XMLNode ("GUI"); - redirect.add_extra_xml (*xml_node); + insert.add_extra_xml (*xml_node); } } } @@ -168,6 +168,6 @@ void RedirectAutomationTimeAxisView::set_automation_state (AutoState state) { if (!ignore_state_request) { - redirect.automation_list (port).set_automation_state (state); + insert.automation_list (port).set_automation_state (state); } } diff --git a/gtk2_ardour/redirect_automation_time_axis.h b/gtk2_ardour/redirect_automation_time_axis.h index 7ba81121e2..eceed7446a 100644 --- a/gtk2_ardour/redirect_automation_time_axis.h +++ b/gtk2_ardour/redirect_automation_time_axis.h @@ -39,7 +39,7 @@ class RedirectAutomationTimeAxisView : public AutomationTimeAxisView ArdourCanvas::Canvas& canvas, std::string name, uint32_t port, - ARDOUR::Redirect& rd, + ARDOUR::Insert& i, std::string state_name); ~RedirectAutomationTimeAxisView(); @@ -51,7 +51,7 @@ class RedirectAutomationTimeAxisView : public AutomationTimeAxisView private: - ARDOUR::Redirect& redirect; + ARDOUR::Insert& insert; uint32_t port; XMLNode *xml_node; diff --git a/gtk2_ardour/redirect_box.cc b/gtk2_ardour/redirect_box.cc index 7ce64d0f3a..8749ab12db 100644 --- a/gtk2_ardour/redirect_box.cc +++ b/gtk2_ardour/redirect_box.cc @@ -75,11 +75,11 @@ using namespace Gtk; using namespace Glib; using namespace Gtkmm2ext; -RedirectBox* RedirectBox::_current_redirect_box = 0; +RedirectBox* RedirectBox::_current_insert_box = 0; RefPtr<Action> RedirectBox::paste_action; bool RedirectBox::get_colors = true; -Gdk::Color* RedirectBox::active_redirect_color; -Gdk::Color* RedirectBox::inactive_redirect_color; +Gdk::Color* RedirectBox::active_insert_color; +Gdk::Color* RedirectBox::inactive_insert_color; RedirectBox::RedirectBox (Placement pcmnt, Session& sess, boost::shared_ptr<Route> rt, PluginSelector &plugsel, RouteRedirectSelection & rsel, bool owner_is_mixer) @@ -91,60 +91,60 @@ RedirectBox::RedirectBox (Placement pcmnt, Session& sess, boost::shared_ptr<Rout _rr_selection(rsel) { if (get_colors) { - active_redirect_color = new Gdk::Color; - inactive_redirect_color = new Gdk::Color; - set_color (*active_redirect_color, rgba_from_style ("RedirectSelector", 0xff, 0, 0, 0, "fg", Gtk::STATE_ACTIVE, false )); - set_color (*inactive_redirect_color, rgba_from_style ("RedirectSelector", 0xff, 0, 0, 0, "fg", Gtk::STATE_NORMAL, false )); + active_insert_color = new Gdk::Color; + inactive_insert_color = new Gdk::Color; + set_color (*active_insert_color, rgba_from_style ("RedirectSelector", 0xff, 0, 0, 0, "fg", Gtk::STATE_ACTIVE, false )); + set_color (*inactive_insert_color, rgba_from_style ("RedirectSelector", 0xff, 0, 0, 0, "fg", Gtk::STATE_NORMAL, false )); get_colors = false; } _width = Wide; - redirect_menu = 0; + insert_menu = 0; send_action_menu = 0; - redirect_drag_in_progress = false; - no_redirect_redisplay = false; + insert_drag_in_progress = false; + no_insert_redisplay = false; ignore_delete = false; ab_direction = true; model = ListStore::create(columns); - RefPtr<TreeSelection> selection = redirect_display.get_selection(); + RefPtr<TreeSelection> selection = insert_display.get_selection(); selection->set_mode (Gtk::SELECTION_MULTIPLE); selection->signal_changed().connect (mem_fun (*this, &RedirectBox::selection_changed)); - redirect_display.set_model (model); - redirect_display.append_column (X_("notshown"), columns.text); - redirect_display.set_name ("RedirectSelector"); - redirect_display.set_headers_visible (false); - redirect_display.set_reorderable (true); - redirect_display.set_size_request (-1, 40); - redirect_display.get_column(0)->set_sizing(TREE_VIEW_COLUMN_FIXED); - redirect_display.get_column(0)->set_fixed_width(48); - redirect_display.add_object_drag (columns.redirect.index(), "redirects"); - redirect_display.signal_object_drop.connect (mem_fun (*this, &RedirectBox::object_drop)); - - TreeViewColumn* name_col = redirect_display.get_column(0); - CellRendererText* renderer = dynamic_cast<CellRendererText*>(redirect_display.get_column_cell_renderer (0)); + insert_display.set_model (model); + insert_display.append_column (X_("notshown"), columns.text); + insert_display.set_name ("RedirectSelector"); + insert_display.set_headers_visible (false); + insert_display.set_reorderable (true); + insert_display.set_size_request (-1, 40); + insert_display.get_column(0)->set_sizing(TREE_VIEW_COLUMN_FIXED); + insert_display.get_column(0)->set_fixed_width(48); + insert_display.add_object_drag (columns.insert.index(), "redirects"); + insert_display.signal_object_drop.connect (mem_fun (*this, &RedirectBox::object_drop)); + + TreeViewColumn* name_col = insert_display.get_column(0); + CellRendererText* renderer = dynamic_cast<CellRendererText*>(insert_display.get_column_cell_renderer (0)); name_col->add_attribute(renderer->property_foreground_gdk(), columns.color); - redirect_scroller.set_policy (Gtk::POLICY_NEVER, Gtk::POLICY_AUTOMATIC); + insert_scroller.set_policy (Gtk::POLICY_NEVER, Gtk::POLICY_AUTOMATIC); model->signal_row_deleted().connect (mem_fun (*this, &RedirectBox::row_deleted)); - redirect_scroller.add (redirect_display); - redirect_eventbox.add (redirect_scroller); + insert_scroller.add (insert_display); + insert_eventbox.add (insert_scroller); - redirect_scroller.set_size_request (-1, 40); + insert_scroller.set_size_request (-1, 40); - pack_start (redirect_eventbox, true, true); + pack_start (insert_eventbox, true, true); - _route->redirects_changed.connect (mem_fun(*this, &RedirectBox::redisplay_redirects)); + _route->inserts_changed.connect (mem_fun(*this, &RedirectBox::redisplay_inserts)); _route->GoingAway.connect (mem_fun (*this, &RedirectBox::route_going_away)); - redirect_eventbox.signal_enter_notify_event().connect (bind (sigc::ptr_fun (RedirectBox::enter_box), this)); + insert_eventbox.signal_enter_notify_event().connect (bind (sigc::ptr_fun (RedirectBox::enter_box), this)); - redirect_display.signal_button_press_event().connect (mem_fun(*this, &RedirectBox::redirect_button_press_event), false); - redirect_display.signal_button_release_event().connect (mem_fun(*this, &RedirectBox::redirect_button_release_event)); + insert_display.signal_button_press_event().connect (mem_fun(*this, &RedirectBox::insert_button_press_event), false); + insert_display.signal_button_release_event().connect (mem_fun(*this, &RedirectBox::insert_button_release_event)); /* start off as a passthru strip. we'll correct this, if necessary, in update_diskstream_display(). @@ -152,7 +152,7 @@ RedirectBox::RedirectBox (Placement pcmnt, Session& sess, boost::shared_ptr<Rout /* now force an update of all the various elements */ - redisplay_redirects (0); + redisplay_inserts (); } RedirectBox::~RedirectBox () @@ -162,32 +162,32 @@ RedirectBox::~RedirectBox () void RedirectBox::route_going_away () { - /* don't keep updating display as redirects are deleted */ - no_redirect_redisplay = true; + /* don't keep updating display as inserts are deleted */ + no_insert_redisplay = true; } void -RedirectBox::object_drop (string type, uint32_t cnt, const boost::shared_ptr<Redirect>* ptr) +RedirectBox::object_drop (string type, uint32_t cnt, const boost::shared_ptr<Insert>* ptr) { if (type != "redirects" || cnt == 0 || !ptr) { return; } - /* do something with the dropped redirects */ + /* do something with the dropped inserts */ - list<boost::shared_ptr<Redirect> > redirects; + list<boost::shared_ptr<Insert> > inserts; for (uint32_t n = 0; n < cnt; ++n) { - redirects.push_back (ptr[n]); + inserts.push_back (ptr[n]); } - paste_redirect_list (redirects); + paste_insert_list (inserts); } void RedirectBox::update() { - redisplay_redirects (0); + redisplay_inserts (); } @@ -199,24 +199,19 @@ RedirectBox::set_width (Width w) } _width = w; - redisplay_redirects (0); + redisplay_inserts (); } void -RedirectBox::remove_redirect_gui (boost::shared_ptr<Redirect> redirect) +RedirectBox::remove_insert_gui (boost::shared_ptr<Insert> insert) { - boost::shared_ptr<Insert> insert; boost::shared_ptr<Send> send; boost::shared_ptr<PortInsert> port_insert; - if ((insert = boost::dynamic_pointer_cast<Insert> (redirect)) != 0) { - - if ((port_insert = boost::dynamic_pointer_cast<PortInsert> (insert)) != 0) { + if ((port_insert = boost::dynamic_pointer_cast<PortInsert> (insert)) != 0) { PortInsertUI *io_selector = reinterpret_cast<PortInsertUI *> (port_insert->get_gui()); port_insert->set_gui (0); delete io_selector; - } - } else if ((send = boost::dynamic_pointer_cast<Send> (insert)) != 0) { SendUIWindow *sui = reinterpret_cast<SendUIWindow*> (send->get_gui()); send->set_gui (0); @@ -251,97 +246,97 @@ RedirectBox::new_send () } void -RedirectBox::show_redirect_menu (gint arg) +RedirectBox::show_insert_menu (gint arg) { - if (redirect_menu == 0) { - redirect_menu = build_redirect_menu (); + if (insert_menu == 0) { + insert_menu = build_insert_menu (); } - paste_action->set_sensitive (!_rr_selection.redirects.empty()); + paste_action->set_sensitive (!_rr_selection.inserts.empty()); - redirect_menu->popup (1, arg); + insert_menu->popup (1, arg); } void -RedirectBox::redirect_drag_begin (GdkDragContext *context) +RedirectBox::insert_drag_begin (GdkDragContext *context) { - redirect_drag_in_progress = true; + insert_drag_in_progress = true; } void -RedirectBox::redirect_drag_end (GdkDragContext *context) +RedirectBox::insert_drag_end (GdkDragContext *context) { - redirect_drag_in_progress = false; + insert_drag_in_progress = false; } bool -RedirectBox::redirect_button_press_event (GdkEventButton *ev) +RedirectBox::insert_button_press_event (GdkEventButton *ev) { TreeIter iter; TreeModel::Path path; TreeViewColumn* column; int cellx; int celly; - boost::shared_ptr<Redirect> redirect; + boost::shared_ptr<Insert> insert; int ret = false; bool selected = false; - if (redirect_display.get_path_at_pos ((int)ev->x, (int)ev->y, path, column, cellx, celly)) { + if (insert_display.get_path_at_pos ((int)ev->x, (int)ev->y, path, column, cellx, celly)) { if ((iter = model->get_iter (path))) { - redirect = (*iter)[columns.redirect]; - selected = redirect_display.get_selection()->is_selected (iter); + insert = (*iter)[columns.insert]; + selected = insert_display.get_selection()->is_selected (iter); } } - if (redirect && (Keyboard::is_edit_event (ev) || (ev->button == 1 && ev->type == GDK_2BUTTON_PRESS))) { + if (insert && (Keyboard::is_edit_event (ev) || (ev->button == 1 && ev->type == GDK_2BUTTON_PRESS))) { if (_session.engine().connected()) { /* XXX giving an error message here is hard, because we may be in the midst of a button press */ - edit_redirect (redirect); + edit_insert (insert); } ret = true; - } else if (redirect && ev->button == 1 && selected) { + } else if (insert && ev->button == 1 && selected) { // this is purely informational but necessary - RedirectSelected (redirect); // emit + InsertSelected (insert); // emit } return ret; } bool -RedirectBox::redirect_button_release_event (GdkEventButton *ev) +RedirectBox::insert_button_release_event (GdkEventButton *ev) { TreeIter iter; TreeModel::Path path; TreeViewColumn* column; int cellx; int celly; - boost::shared_ptr<Redirect> redirect; + boost::shared_ptr<Insert> insert; int ret = false; - if (redirect_display.get_path_at_pos ((int)ev->x, (int)ev->y, path, column, cellx, celly)) { + if (insert_display.get_path_at_pos ((int)ev->x, (int)ev->y, path, column, cellx, celly)) { if ((iter = model->get_iter (path))) { - redirect = (*iter)[columns.redirect]; + insert = (*iter)[columns.insert]; } } - if (redirect && Keyboard::is_delete_event (ev)) { + if (insert && Keyboard::is_delete_event (ev)) { - Glib::signal_idle().connect (bind (mem_fun(*this, &RedirectBox::idle_delete_redirect), boost::weak_ptr<Redirect>(redirect))); + Glib::signal_idle().connect (bind (mem_fun(*this, &RedirectBox::idle_delete_insert), boost::weak_ptr<Insert>(insert))); ret = true; } else if (Keyboard::is_context_menu_event (ev)) { - show_redirect_menu(ev->time); + show_insert_menu(ev->time); ret = true; - } else if (redirect && (ev->button == 2) && (ev->state == Gdk::BUTTON2_MASK)) { + } else if (insert && (ev->button == 2) && (ev->state == Gdk::BUTTON2_MASK)) { - redirect->set_active (!redirect->active(), this); + insert->set_active (!insert->active()); ret = true; } @@ -350,33 +345,33 @@ RedirectBox::redirect_button_release_event (GdkEventButton *ev) } Menu * -RedirectBox::build_redirect_menu () +RedirectBox::build_insert_menu () { - redirect_menu = dynamic_cast<Gtk::Menu*>(ActionManager::get_widget("/redirectmenu") ); - redirect_menu->set_name ("ArdourContextMenu"); + insert_menu = dynamic_cast<Gtk::Menu*>(ActionManager::get_widget("/redirectmenu") ); + insert_menu->set_name ("ArdourContextMenu"); show_all_children(); - return redirect_menu; + return insert_menu; } void RedirectBox::selection_changed () { - bool sensitive = (redirect_display.get_selection()->count_selected_rows()) ? true : false; + bool sensitive = (insert_display.get_selection()->count_selected_rows()) ? true : false; ActionManager::set_sensitive (ActionManager::plugin_selection_sensitive_actions, sensitive); } void -RedirectBox::select_all_redirects () +RedirectBox::select_all_inserts () { - redirect_display.get_selection()->select_all(); + insert_display.get_selection()->select_all(); } void -RedirectBox::deselect_all_redirects () +RedirectBox::deselect_all_inserts () { - redirect_display.get_selection()->unselect_all(); + insert_display.get_selection()->unselect_all(); } void @@ -393,13 +388,13 @@ RedirectBox::insert_plugin_chosen (boost::shared_ptr<Plugin> plugin) { if (plugin) { - boost::shared_ptr<Redirect> redirect (new PluginInsert (_session, plugin, _placement)); + boost::shared_ptr<Insert> insert (new PluginInsert (_session, plugin, _placement)); - redirect->active_changed.connect (bind (mem_fun (*this, &RedirectBox::show_redirect_active_r), boost::weak_ptr<Redirect>(redirect))); + insert->ActiveChanged.connect (bind (mem_fun (*this, &RedirectBox::show_insert_active), boost::weak_ptr<Insert>(insert))); Route::InsertStreams err; - if (_route->add_redirect (redirect, this, &err)) { + if (_route->add_insert (insert, &err)) { weird_plugin_dialog (*plugin, err, _route); // XXX SHAREDPTR delete plugin here .. do we even need to care? } @@ -472,46 +467,43 @@ RedirectBox::weird_plugin_dialog (Plugin& p, Route::InsertStreams streams, boost void RedirectBox::choose_insert () { - boost::shared_ptr<Redirect> redirect (new PortInsert (_session, _placement)); - redirect->active_changed.connect (bind (mem_fun(*this, &RedirectBox::show_redirect_active_r), boost::weak_ptr<Redirect>(redirect))); - _route->add_redirect (redirect, this); + boost::shared_ptr<Insert> insert (new PortInsert (_session, _placement)); + insert->ActiveChanged.connect (bind (mem_fun(*this, &RedirectBox::show_insert_active), boost::weak_ptr<Insert>(insert))); + _route->add_insert (insert); } void RedirectBox::choose_send () { boost::shared_ptr<Send> send (new Send (_session, _placement)); - send->set_default_type(_route->default_type()); + //send->set_default_type(_route->default_type()); /* XXX need redirect lock on route */ - send->ensure_io (ChanCount::ZERO, _route->max_redirect_outs(), false, this); + // This will be set properly in route->add_insert + send->configure_io (_route->max_insert_outs(), _route->max_insert_outs()); - IOSelectorWindow *ios = new IOSelectorWindow (_session, send, false, true); + IOSelectorWindow *ios = new IOSelectorWindow (_session, send->io(), false, true); ios->show_all (); - boost::shared_ptr<Redirect> r = boost::static_pointer_cast<Redirect>(send); - - ios->selector().Finished.connect (bind (mem_fun(*this, &RedirectBox::send_io_finished), boost::weak_ptr<Redirect>(r), ios)); + ios->selector().Finished.connect (bind (mem_fun(*this, &RedirectBox::send_io_finished), send, ios)); } void -RedirectBox::send_io_finished (IOSelector::Result r, boost::weak_ptr<Redirect> weak_redirect, IOSelectorWindow* ios) +RedirectBox::send_io_finished (IOSelector::Result r, boost::shared_ptr<Send> send, IOSelectorWindow* ios) { - boost::shared_ptr<Redirect> redirect (weak_redirect.lock()); - - if (!redirect) { + if (!send) { return; } switch (r) { case IOSelector::Cancelled: - // redirect will go away when all shared_ptrs to it vanish + // send will go away when all shared_ptrs to it vanish break; case IOSelector::Accepted: - _route->add_redirect (redirect, this); + _route->add_insert (send); break; } @@ -519,11 +511,11 @@ RedirectBox::send_io_finished (IOSelector::Result r, boost::weak_ptr<Redirect> w } void -RedirectBox::redisplay_redirects (void *src) +RedirectBox::redisplay_inserts () { - ENSURE_GUI_THREAD(bind (mem_fun(*this, &RedirectBox::redisplay_redirects), src)); + ENSURE_GUI_THREAD(mem_fun(*this, &RedirectBox::redisplay_inserts)); - if (no_redirect_redisplay) { + if (no_insert_redisplay) { return; } @@ -531,56 +523,56 @@ RedirectBox::redisplay_redirects (void *src) model->clear (); ignore_delete = false; - redirect_active_connections.clear (); - redirect_name_connections.clear (); + insert_active_connections.clear (); + insert_name_connections.clear (); - void (RedirectBox::*pmf)(boost::shared_ptr<Redirect>) = &RedirectBox::add_redirect_to_display; - _route->foreach_redirect (this, pmf); + void (RedirectBox::*pmf)(boost::shared_ptr<Insert>) = &RedirectBox::add_insert_to_display; + _route->foreach_insert (this, pmf); switch (_placement) { case PreFader: - build_redirect_tooltip(redirect_eventbox, _("Pre-fader inserts, sends & plugins:")); + build_insert_tooltip(insert_eventbox, _("Pre-fader inserts, sends & plugins:")); break; case PostFader: - build_redirect_tooltip(redirect_eventbox, _("Post-fader inserts, sends & plugins:")); + build_insert_tooltip(insert_eventbox, _("Post-fader inserts, sends & plugins:")); break; } } void -RedirectBox::add_redirect_to_display (boost::shared_ptr<Redirect> redirect) +RedirectBox::add_insert_to_display (boost::shared_ptr<Insert> insert) { - if (redirect->placement() != _placement) { + if (insert->placement() != _placement) { return; } Gtk::TreeModel::Row row = *(model->append()); - row[columns.text] = redirect_name (redirect); - row[columns.redirect] = redirect; + row[columns.text] = insert_name (insert); + row[columns.insert] = insert; - show_redirect_active (redirect); + show_insert_active (insert); - redirect_active_connections.push_back (redirect->active_changed.connect (bind (mem_fun(*this, &RedirectBox::show_redirect_active_r), boost::weak_ptr<Redirect>(redirect)))); - redirect_name_connections.push_back (redirect->name_changed.connect (bind (mem_fun(*this, &RedirectBox::show_redirect_name), boost::weak_ptr<Redirect>(redirect)))); + insert_active_connections.push_back (insert->ActiveChanged.connect (bind (mem_fun(*this, &RedirectBox::show_insert_active), boost::weak_ptr<Insert>(insert)))); + insert_name_connections.push_back (insert->NameChanged.connect (bind (mem_fun(*this, &RedirectBox::show_insert_name), boost::weak_ptr<Insert>(insert)))); } string -RedirectBox::redirect_name (boost::weak_ptr<Redirect> weak_redirect) +RedirectBox::insert_name (boost::weak_ptr<Insert> weak_insert) { - boost::shared_ptr<Redirect> redirect (weak_redirect.lock()); + boost::shared_ptr<Insert> insert (weak_insert.lock()); - if (!redirect) { + if (!insert) { return string(); } boost::shared_ptr<Send> send; string name_display; - if (!redirect->active()) { + if (!insert->active()) { name_display = " ("; } - if ((send = boost::dynamic_pointer_cast<Send> (redirect)) != 0) { + if ((send = boost::dynamic_pointer_cast<Send> (insert)) != 0) { name_display += '>'; @@ -603,16 +595,16 @@ RedirectBox::redirect_name (boost::weak_ptr<Redirect> weak_redirect) switch (_width) { case Wide: - name_display += redirect->name(); + name_display += insert->name(); break; case Narrow: - name_display += PBD::short_version (redirect->name(), 5); + name_display += PBD::short_version (insert->name(), 5); break; } } - if (!redirect->active()) { + if (!insert->active()) { name_display += ')'; } @@ -620,7 +612,7 @@ RedirectBox::redirect_name (boost::weak_ptr<Redirect> weak_redirect) } void -RedirectBox::build_redirect_tooltip (EventBox& box, string start) +RedirectBox::build_insert_tooltip (EventBox& box, string start) { string tip(start); @@ -631,33 +623,27 @@ RedirectBox::build_redirect_tooltip (EventBox& box, string start) /* don't use the column text, since it may be narrowed */ - boost::shared_ptr<Redirect> r = row[columns.redirect]; - tip += r->name(); + boost::shared_ptr<Insert> i = row[columns.insert]; + tip += i->name(); } ARDOUR_UI::instance()->tooltips().set_tip (box, tip); } void -RedirectBox::show_redirect_name (void* src, boost::weak_ptr<Redirect> redirect) +RedirectBox::show_insert_name (boost::weak_ptr<Insert> insert) { - ENSURE_GUI_THREAD(bind (mem_fun(*this, &RedirectBox::show_redirect_name), src, redirect)); - show_redirect_active (redirect); + ENSURE_GUI_THREAD(bind (mem_fun(*this, &RedirectBox::show_insert_name), insert)); + show_insert_active (insert); } void -RedirectBox::show_redirect_active_r (Redirect* r, void *src, boost::weak_ptr<Redirect> weak_redirect) +RedirectBox::show_insert_active (boost::weak_ptr<Insert> weak_insert) { - show_redirect_active (weak_redirect); -} - -void -RedirectBox::show_redirect_active (boost::weak_ptr<Redirect> weak_redirect) -{ - ENSURE_GUI_THREAD(bind (mem_fun(*this, &RedirectBox::show_redirect_active), weak_redirect)); + ENSURE_GUI_THREAD(bind (mem_fun(*this, &RedirectBox::show_insert_active), weak_insert)); - boost::shared_ptr<Redirect> redirect (weak_redirect.lock()); + boost::shared_ptr<Insert> insert (weak_insert.lock()); - if (!redirect) { + if (!insert) { return; } @@ -666,15 +652,15 @@ RedirectBox::show_redirect_active (boost::weak_ptr<Redirect> weak_redirect) while (iter != children.end()) { - boost::shared_ptr<Redirect> r = (*iter)[columns.redirect]; + boost::shared_ptr<Insert> r = (*iter)[columns.insert]; - if (r == redirect) { - (*iter)[columns.text] = redirect_name (r); + if (r == insert) { + (*iter)[columns.text] = insert_name (r); - if (redirect->active()) { - (*iter)[columns.color] = *active_redirect_color; + if (insert->active()) { + (*iter)[columns.color] = *active_insert_color; } else { - (*iter)[columns.color] = *inactive_redirect_color; + (*iter)[columns.color] = *inactive_insert_color; } break; } @@ -687,25 +673,25 @@ void RedirectBox::row_deleted (const Gtk::TreeModel::Path& path) { if (!ignore_delete) { - compute_redirect_sort_keys (); + compute_insert_sort_keys (); } } void -RedirectBox::compute_redirect_sort_keys () +RedirectBox::compute_insert_sort_keys () { uint32_t sort_key = 0; Gtk::TreeModel::Children children = model->children(); for (Gtk::TreeModel::Children::iterator iter = children.begin(); iter != children.end(); ++iter) { - boost::shared_ptr<Redirect> r = (*iter)[columns.redirect]; - r->set_sort_key (sort_key); + boost::shared_ptr<Insert> i = (*iter)[columns.insert]; + i->set_sort_key (sort_key); sort_key++; } - if (_route->sort_redirects ()) { + if (_route->sort_inserts ()) { - redisplay_redirects (0); + redisplay_inserts (); /* now tell them about the problem */ @@ -713,7 +699,7 @@ RedirectBox::compute_redirect_sort_keys () Label label; label.set_text (_("\ -You cannot reorder this set of redirects\n\ +You cannot reorder this set of inserts\n\ in that way because the inputs and\n\ outputs do not work correctly.")); @@ -730,41 +716,41 @@ outputs do not work correctly.")); } void -RedirectBox::rename_redirects () +RedirectBox::rename_inserts () { - vector<boost::shared_ptr<Redirect> > to_be_renamed; + vector<boost::shared_ptr<Insert> > to_be_renamed; - get_selected_redirects (to_be_renamed); + get_selected_inserts (to_be_renamed); if (to_be_renamed.empty()) { return; } - for (vector<boost::shared_ptr<Redirect> >::iterator i = to_be_renamed.begin(); i != to_be_renamed.end(); ++i) { - rename_redirect (*i); + for (vector<boost::shared_ptr<Insert> >::iterator i = to_be_renamed.begin(); i != to_be_renamed.end(); ++i) { + rename_insert (*i); } } void -RedirectBox::cut_redirects () +RedirectBox::cut_inserts () { - vector<boost::shared_ptr<Redirect> > to_be_removed; + vector<boost::shared_ptr<Insert> > to_be_removed; - get_selected_redirects (to_be_removed); + get_selected_inserts (to_be_removed); if (to_be_removed.empty()) { return; } - /* this essentially transfers ownership of the redirect - of the redirect from the route to the mixer + /* this essentially transfers ownership of the insert + of the insert from the route to the mixer selection. */ _rr_selection.set (to_be_removed); - no_redirect_redisplay = true; - for (vector<boost::shared_ptr<Redirect> >::iterator i = to_be_removed.begin(); i != to_be_removed.end(); ++i) { + no_insert_redisplay = true; + for (vector<boost::shared_ptr<Insert> >::iterator i = to_be_removed.begin(); i != to_be_removed.end(); ++i) { // Do not cut inserts or sends if (boost::dynamic_pointer_cast<PluginInsert>((*i)) != 0) { void* gui = (*i)->get_gui (); @@ -773,7 +759,7 @@ RedirectBox::cut_redirects () static_cast<Gtk::Widget*>(gui)->hide (); } - if (_route->remove_redirect (*i, this)) { + if (_route->remove_insert (*i)) { /* removal failed */ _rr_selection.remove (*i); } @@ -782,26 +768,26 @@ RedirectBox::cut_redirects () } } - no_redirect_redisplay = false; - redisplay_redirects (this); + no_insert_redisplay = false; + redisplay_inserts (); } void -RedirectBox::copy_redirects () +RedirectBox::copy_inserts () { - vector<boost::shared_ptr<Redirect> > to_be_copied; - vector<boost::shared_ptr<Redirect> > copies; + vector<boost::shared_ptr<Insert> > to_be_copied; + vector<boost::shared_ptr<Insert> > copies; - get_selected_redirects (to_be_copied); + get_selected_inserts (to_be_copied); if (to_be_copied.empty()) { return; } - for (vector<boost::shared_ptr<Redirect> >::iterator i = to_be_copied.begin(); i != to_be_copied.end(); ++i) { + for (vector<boost::shared_ptr<Insert> >::iterator i = to_be_copied.begin(); i != to_be_copied.end(); ++i) { // Do not copy inserts or sends if (boost::dynamic_pointer_cast<PluginInsert>((*i)) != 0) { - copies.push_back (Redirect::clone (*i)); + copies.push_back (Insert::clone (*i)); } } @@ -810,17 +796,17 @@ RedirectBox::copy_redirects () } void -RedirectBox::delete_redirects () +RedirectBox::delete_inserts () { - vector<boost::shared_ptr<Redirect> > to_be_deleted; + vector<boost::shared_ptr<Insert> > to_be_deleted; - get_selected_redirects (to_be_deleted); + get_selected_inserts (to_be_deleted); if (to_be_deleted.empty()) { return; } - for (vector<boost::shared_ptr<Redirect> >::iterator i = to_be_deleted.begin(); i != to_be_deleted.end(); ++i) { + for (vector<boost::shared_ptr<Insert> >::iterator i = to_be_deleted.begin(); i != to_be_deleted.end(); ++i) { void* gui = (*i)->get_gui (); @@ -828,39 +814,39 @@ RedirectBox::delete_redirects () static_cast<Gtk::Widget*>(gui)->hide (); } - _route->remove_redirect( *i, this); + _route->remove_insert(*i); } - no_redirect_redisplay = false; - redisplay_redirects (this); + no_insert_redisplay = false; + redisplay_inserts (); } gint -RedirectBox::idle_delete_redirect (boost::weak_ptr<Redirect> weak_redirect) +RedirectBox::idle_delete_insert (boost::weak_ptr<Insert> weak_insert) { - boost::shared_ptr<Redirect> redirect (weak_redirect.lock()); + boost::shared_ptr<Insert> insert (weak_insert.lock()); - if (!redirect) { + if (!insert) { return false; } /* NOT copied to _mixer.selection() */ - no_redirect_redisplay = true; - _route->remove_redirect (redirect, this); - no_redirect_redisplay = false; - redisplay_redirects (this); + no_insert_redisplay = true; + _route->remove_insert (insert); + no_insert_redisplay = false; + redisplay_inserts (); return false; } void -RedirectBox::rename_redirect (boost::shared_ptr<Redirect> redirect) +RedirectBox::rename_insert (boost::shared_ptr<Insert> insert) { ArdourPrompter name_prompter (true); string result; - name_prompter.set_prompt (_("rename redirect")); - name_prompter.set_initial_text (redirect->name()); + name_prompter.set_prompt (_("rename insert")); + name_prompter.set_initial_text (insert->name()); name_prompter.add_button (_("Rename"), Gtk::RESPONSE_ACCEPT); name_prompter.set_response_sensitive (Gtk::RESPONSE_ACCEPT, false); name_prompter.show_all (); @@ -870,7 +856,7 @@ RedirectBox::rename_redirect (boost::shared_ptr<Redirect> redirect) case Gtk::RESPONSE_ACCEPT: name_prompter.get_result (result); if (result.length()) { - redirect->set_name (result, this); + insert->set_name (result); } break; } @@ -879,63 +865,63 @@ RedirectBox::rename_redirect (boost::shared_ptr<Redirect> redirect) } void -RedirectBox::cut_redirect (boost::shared_ptr<Redirect> redirect) +RedirectBox::cut_insert (boost::shared_ptr<Insert> insert) { - /* this essentially transfers ownership of the redirect - of the redirect from the route to the mixer + /* this essentially transfers ownership of the insert + of the insert from the route to the mixer selection. */ - _rr_selection.add (redirect); + _rr_selection.add (insert); - void* gui = redirect->get_gui (); + void* gui = insert->get_gui (); if (gui) { static_cast<Gtk::Widget*>(gui)->hide (); } - no_redirect_redisplay = true; - if (_route->remove_redirect (redirect, this)) { - _rr_selection.remove (redirect); + no_insert_redisplay = true; + if (_route->remove_insert (insert)) { + _rr_selection.remove (insert); } - no_redirect_redisplay = false; - redisplay_redirects (this); + no_insert_redisplay = false; + redisplay_inserts (); } void -RedirectBox::copy_redirect (boost::shared_ptr<Redirect> redirect) +RedirectBox::copy_insert (boost::shared_ptr<Insert> insert) { - boost::shared_ptr<Redirect> copy = Redirect::clone (redirect); + boost::shared_ptr<Insert> copy = Insert::clone (insert); _rr_selection.add (copy); } void -RedirectBox::paste_redirects () +RedirectBox::paste_inserts () { - if (_rr_selection.redirects.empty()) { + if (_rr_selection.inserts.empty()) { return; } - paste_redirect_list (_rr_selection.redirects); + paste_insert_list (_rr_selection.inserts); } void -RedirectBox::paste_redirect_list (list<boost::shared_ptr<Redirect> >& redirects) +RedirectBox::paste_insert_list (list<boost::shared_ptr<Insert> >& inserts) { - list<boost::shared_ptr<Redirect> > copies; + list<boost::shared_ptr<Insert> > copies; - for (list<boost::shared_ptr<Redirect> >::iterator i = redirects.begin(); i != redirects.end(); ++i) { + for (list<boost::shared_ptr<Insert> >::iterator i = inserts.begin(); i != inserts.end(); ++i) { - boost::shared_ptr<Redirect> copy = Redirect::clone (*i); + boost::shared_ptr<Insert> copy = Insert::clone (*i); - copy->set_placement (_placement, this); + copy->set_placement (_placement); copies.push_back (copy); } - if (_route->add_redirects (copies, this)) { + if (_route->add_inserts (copies)) { string msg = _( - "Copying the set of redirects on the clipboard failed,\n\ + "Copying the set of inserts on the clipboard failed,\n\ probably because the I/O configuration of the plugins\n\ could not match the configuration of this track."); MessageDialog am (msg); @@ -944,47 +930,47 @@ could not match the configuration of this track."); } void -RedirectBox::activate_redirect (boost::shared_ptr<Redirect> r) +RedirectBox::activate_insert (boost::shared_ptr<Insert> r) { - r->set_active (true, 0); + r->set_active (true); } void -RedirectBox::deactivate_redirect (boost::shared_ptr<Redirect> r) +RedirectBox::deactivate_insert (boost::shared_ptr<Insert> r) { - r->set_active (false, 0); + r->set_active (false); } void -RedirectBox::get_selected_redirects (vector<boost::shared_ptr<Redirect> >& redirects) +RedirectBox::get_selected_inserts (vector<boost::shared_ptr<Insert> >& inserts) { - vector<Gtk::TreeModel::Path> pathlist = redirect_display.get_selection()->get_selected_rows(); + vector<Gtk::TreeModel::Path> pathlist = insert_display.get_selection()->get_selected_rows(); for (vector<Gtk::TreeModel::Path>::iterator iter = pathlist.begin(); iter != pathlist.end(); ++iter) { - redirects.push_back ((*(model->get_iter(*iter)))[columns.redirect]); + inserts.push_back ((*(model->get_iter(*iter)))[columns.insert]); } } void -RedirectBox::for_selected_redirects (void (RedirectBox::*pmf)(boost::shared_ptr<Redirect>)) +RedirectBox::for_selected_inserts (void (RedirectBox::*pmf)(boost::shared_ptr<Insert>)) { - vector<Gtk::TreeModel::Path> pathlist = redirect_display.get_selection()->get_selected_rows(); + vector<Gtk::TreeModel::Path> pathlist = insert_display.get_selection()->get_selected_rows(); for (vector<Gtk::TreeModel::Path>::iterator iter = pathlist.begin(); iter != pathlist.end(); ++iter) { - boost::shared_ptr<Redirect> redirect = (*(model->get_iter(*iter)))[columns.redirect]; - (this->*pmf)(redirect); + boost::shared_ptr<Insert> insert = (*(model->get_iter(*iter)))[columns.insert]; + (this->*pmf)(insert); } } void -RedirectBox::clone_redirects () +RedirectBox::clone_inserts () { RouteSelection& routes (_rr_selection.routes); if (!routes.empty()) { - if (_route->copy_redirects (*routes.front(), _placement)) { + if (_route->copy_inserts (*routes.front(), _placement)) { string msg = _( -"Copying the set of redirects on the clipboard failed,\n\ +"Copying the set of inserts on the clipboard failed,\n\ probably because the I/O configuration of the plugins\n\ could not match the configuration of this track."); MessageDialog am (msg); @@ -994,9 +980,9 @@ could not match the configuration of this track."); } void -RedirectBox::all_redirects_active (bool state) +RedirectBox::all_inserts_active (bool state) { - _route->all_redirects_active (_placement, state); + _route->all_inserts_active (_placement, state); } void @@ -1017,25 +1003,25 @@ RedirectBox::ab_plugins () } void -RedirectBox::clear_redirects () +RedirectBox::clear_inserts () { string prompt; vector<string> choices; if (boost::dynamic_pointer_cast<AudioTrack>(_route) != 0) { if (_placement == PreFader) { - prompt = _("Do you really want to remove all pre-fader redirects from this track?\n" + prompt = _("Do you really want to remove all pre-fader inserts from this track?\n" "(this cannot be undone)"); } else { - prompt = _("Do you really want to remove all post-fader redirects from this track?\n" + prompt = _("Do you really want to remove all post-fader inserts from this track?\n" "(this cannot be undone)"); } } else { if (_placement == PreFader) { - prompt = _("Do you really want to remove all pre-fader redirects from this bus?\n" + prompt = _("Do you really want to remove all pre-fader inserts from this bus?\n" "(this cannot be undone)"); } else { - prompt = _("Do you really want to remove all post-fader redirects from this bus?\n" + prompt = _("Do you really want to remove all post-fader inserts from this bus?\n" "(this cannot be undone)"); } } @@ -1046,14 +1032,16 @@ RedirectBox::clear_redirects () Gtkmm2ext::Choice prompter (prompt, choices); if (prompter.run () == 1) { - _route->clear_redirects (_placement, this); + _route->clear_inserts (_placement); } } void -RedirectBox::edit_redirect (boost::shared_ptr<Redirect> redirect) +RedirectBox::edit_insert (boost::shared_ptr<Insert> insert) { - boost::shared_ptr<Insert> insert; + boost::shared_ptr<Send> send; + boost::shared_ptr<PluginInsert> plugin_insert; + boost::shared_ptr<PortInsert> port_insert; if (boost::dynamic_pointer_cast<AudioTrack>(_route) != 0) { @@ -1062,16 +1050,12 @@ RedirectBox::edit_redirect (boost::shared_ptr<Redirect> redirect) } } - if ((insert = boost::dynamic_pointer_cast<Insert> (redirect)) == 0) { - - /* it's a send */ + if ((send = boost::dynamic_pointer_cast<Send> (send)) == 0) { if (!_session.engine().connected()) { return; } - boost::shared_ptr<Send> send = boost::dynamic_pointer_cast<Send> (redirect); - SendUIWindow *send_ui; if (send->get_gui() == 0) { @@ -1095,14 +1079,7 @@ RedirectBox::edit_redirect (boost::shared_ptr<Redirect> redirect) send_ui->present (); } - } else { - - /* it's an insert */ - - boost::shared_ptr<PluginInsert> plugin_insert; - boost::shared_ptr<PortInsert> port_insert; - - if ((plugin_insert = boost::dynamic_pointer_cast<PluginInsert> (insert)) != 0) { + } else if ((plugin_insert = boost::dynamic_pointer_cast<PluginInsert> (insert)) != 0) { ARDOUR::PluginType type = plugin_insert->type(); @@ -1120,13 +1097,13 @@ RedirectBox::edit_redirect (boost::shared_ptr<Redirect> redirect) } WindowTitle title(Glib::get_application_name()); - title += generate_redirect_title (plugin_insert); + title += generate_insert_title (plugin_insert); plugin_ui->set_title (title.get_string()); plugin_insert->set_gui (plugin_ui); // change window title when route name is changed - _route->name_changed.connect (bind (mem_fun(*this, &RedirectBox::route_name_changed), plugin_ui, boost::weak_ptr<PluginInsert> (plugin_insert))); + _route->NameChanged.connect (bind (mem_fun(*this, &RedirectBox::route_name_changed), plugin_ui, boost::weak_ptr<PluginInsert> (plugin_insert))); } else { @@ -1156,34 +1133,33 @@ RedirectBox::edit_redirect (boost::shared_ptr<Redirect> redirect) } #endif } else { - warning << "Unsupported plugin sent to RedirectBox::edit_redirect()" << endmsg; + warning << "Unsupported plugin sent to RedirectBox::edit_insert()" << endmsg; return; } - } else if ((port_insert = boost::dynamic_pointer_cast<PortInsert> (insert)) != 0) { - - if (!_session.engine().connected()) { - MessageDialog msg ( _("Not connected to JACK - no I/O changes are possible")); - msg.run (); - return; - } + } else if ((port_insert = boost::dynamic_pointer_cast<PortInsert> (insert)) != 0) { - PortInsertWindow *io_selector; + if (!_session.engine().connected()) { + MessageDialog msg ( _("Not connected to JACK - no I/O changes are possible")); + msg.run (); + return; + } - if (port_insert->get_gui() == 0) { - io_selector = new PortInsertWindow (_session, port_insert); - port_insert->set_gui (io_selector); - - } else { - io_selector = reinterpret_cast<PortInsertWindow *> (port_insert->get_gui()); - } - - if (io_selector->is_visible()) { - io_selector->get_window()->raise (); - } else { - io_selector->show_all (); - io_selector->present (); - } + PortInsertWindow *io_selector; + + if (port_insert->get_gui() == 0) { + io_selector = new PortInsertWindow (_session, port_insert); + port_insert->set_gui (io_selector); + + } else { + io_selector = reinterpret_cast<PortInsertWindow *> (port_insert->get_gui()); + } + + if (io_selector->is_visible()) { + io_selector->get_window()->raise (); + } else { + io_selector->show_all (); + io_selector->present (); } } } @@ -1199,7 +1175,7 @@ RedirectBox::enter_box (GdkEventCrossing *ev, RedirectBox* rb) /* fallthru */ default: - _current_redirect_box = rb; + _current_insert_box = rb; } return false; @@ -1259,193 +1235,193 @@ RedirectBox::register_actions () void RedirectBox::rb_choose_plugin () { - if (_current_redirect_box == 0) { + if (_current_insert_box == 0) { return; } - _current_redirect_box->choose_plugin (); + _current_insert_box->choose_plugin (); } void RedirectBox::rb_choose_insert () { - if (_current_redirect_box == 0) { + if (_current_insert_box == 0) { return; } - _current_redirect_box->choose_insert (); + _current_insert_box->choose_insert (); } void RedirectBox::rb_choose_send () { - if (_current_redirect_box == 0) { + if (_current_insert_box == 0) { return; } - _current_redirect_box->choose_send (); + _current_insert_box->choose_send (); } void RedirectBox::rb_clear () { - if (_current_redirect_box == 0) { + if (_current_insert_box == 0) { return; } - _current_redirect_box->clear_redirects (); + _current_insert_box->clear_inserts (); } void RedirectBox::rb_cut () { - if (_current_redirect_box == 0) { + if (_current_insert_box == 0) { return; } - _current_redirect_box->cut_redirects (); + _current_insert_box->cut_inserts (); } void RedirectBox::rb_delete () { - if (_current_redirect_box == 0) { + if (_current_insert_box == 0) { return; } - _current_redirect_box->delete_redirects (); + _current_insert_box->delete_inserts (); } void RedirectBox::rb_copy () { - if (_current_redirect_box == 0) { + if (_current_insert_box == 0) { return; } - _current_redirect_box->copy_redirects (); + _current_insert_box->copy_inserts (); } void RedirectBox::rb_paste () { - if (_current_redirect_box == 0) { + if (_current_insert_box == 0) { return; } - _current_redirect_box->paste_redirects (); + _current_insert_box->paste_inserts (); } void RedirectBox::rb_rename () { - if (_current_redirect_box == 0) { + if (_current_insert_box == 0) { return; } - _current_redirect_box->rename_redirects (); + _current_insert_box->rename_inserts (); } void RedirectBox::rb_select_all () { - if (_current_redirect_box == 0) { + if (_current_insert_box == 0) { return; } - _current_redirect_box->select_all_redirects (); + _current_insert_box->select_all_inserts (); } void RedirectBox::rb_deselect_all () { - if (_current_redirect_box == 0) { + if (_current_insert_box == 0) { return; } - _current_redirect_box->deselect_all_redirects (); + _current_insert_box->deselect_all_inserts (); } void RedirectBox::rb_activate () { - if (_current_redirect_box == 0) { + if (_current_insert_box == 0) { return; } - _current_redirect_box->for_selected_redirects (&RedirectBox::activate_redirect); + _current_insert_box->for_selected_inserts (&RedirectBox::activate_insert); } void RedirectBox::rb_deactivate () { - if (_current_redirect_box == 0) { + if (_current_insert_box == 0) { return; } - _current_redirect_box->for_selected_redirects (&RedirectBox::deactivate_redirect); + _current_insert_box->for_selected_inserts (&RedirectBox::deactivate_insert); } void RedirectBox::rb_activate_all () { - if (_current_redirect_box == 0) { + if (_current_insert_box == 0) { return; } - _current_redirect_box->all_redirects_active (true); + _current_insert_box->all_inserts_active (true); } void RedirectBox::rb_deactivate_all () { - if (_current_redirect_box == 0) { + if (_current_insert_box == 0) { return; } - _current_redirect_box->all_redirects_active (false); + _current_insert_box->all_inserts_active (false); } void RedirectBox::rb_deactivate_plugins () { - if (_current_redirect_box == 0) { + if (_current_insert_box == 0) { return; } - _current_redirect_box->all_plugins_active (false); + _current_insert_box->all_plugins_active (false); } void RedirectBox::rb_ab_plugins () { - if (_current_redirect_box == 0) { + if (_current_insert_box == 0) { return; } - _current_redirect_box->ab_plugins (); + _current_insert_box->ab_plugins (); } void RedirectBox::rb_edit () { - if (_current_redirect_box == 0) { + if (_current_insert_box == 0) { return; } - _current_redirect_box->for_selected_redirects (&RedirectBox::edit_redirect); + _current_insert_box->for_selected_inserts (&RedirectBox::edit_insert); } void -RedirectBox::route_name_changed (void* src, PluginUIWindow* plugin_ui, boost::weak_ptr<PluginInsert> wpi) +RedirectBox::route_name_changed (PluginUIWindow* plugin_ui, boost::weak_ptr<PluginInsert> wpi) { - ENSURE_GUI_THREAD(bind (mem_fun (*this, &RedirectBox::route_name_changed), src, plugin_ui, wpi)); + ENSURE_GUI_THREAD(bind (mem_fun (*this, &RedirectBox::route_name_changed), plugin_ui, wpi)); boost::shared_ptr<PluginInsert> pi (wpi.lock()); if (pi) { WindowTitle title(Glib::get_application_name()); - title += generate_redirect_title (pi); + title += generate_insert_title (pi); plugin_ui->set_title (title.get_string()); } } string -RedirectBox::generate_redirect_title (boost::shared_ptr<PluginInsert> pi) +RedirectBox::generate_insert_title (boost::shared_ptr<PluginInsert> pi) { string maker = pi->plugin()->maker(); string::size_type email_pos; diff --git a/gtk2_ardour/redirect_box.h b/gtk2_ardour/redirect_box.h index baf0746723..914402858a 100644 --- a/gtk2_ardour/redirect_box.h +++ b/gtk2_ardour/redirect_box.h @@ -62,6 +62,8 @@ namespace ARDOUR { class Session; } + +// FIXME: change name to InsertBox class RedirectBox : public Gtk::HBox { public: @@ -73,14 +75,13 @@ class RedirectBox : public Gtk::HBox void update(); - void select_all_redirects (); - void deselect_all_redirects (); - void select_all_plugins (); void select_all_inserts (); + void deselect_all_inserts (); + void select_all_plugins (); void select_all_sends (); - sigc::signal<void,boost::shared_ptr<ARDOUR::Redirect> > RedirectSelected; - sigc::signal<void,boost::shared_ptr<ARDOUR::Redirect> > RedirectUnselected; + sigc::signal<void,boost::shared_ptr<ARDOUR::Insert> > InsertSelected; + sigc::signal<void,boost::shared_ptr<ARDOUR::Insert> > InsertUnselected; static void register_actions(); @@ -103,11 +104,11 @@ class RedirectBox : public Gtk::HBox struct ModelColumns : public Gtk::TreeModel::ColumnRecord { ModelColumns () { add (text); - add (redirect); + add (insert); add (color); } Gtk::TreeModelColumn<std::string> text; - Gtk::TreeModelColumn<boost::shared_ptr<ARDOUR::Redirect> > redirect; + Gtk::TreeModelColumn<boost::shared_ptr<ARDOUR::Insert> > insert; Gtk::TreeModelColumn<Gdk::Color> color; }; @@ -117,15 +118,15 @@ class RedirectBox : public Gtk::HBox void selection_changed (); static bool get_colors; - static Gdk::Color* active_redirect_color; - static Gdk::Color* inactive_redirect_color; + static Gdk::Color* active_insert_color; + static Gdk::Color* inactive_insert_color; - Gtk::EventBox redirect_eventbox; - Gtk::HBox redirect_hpacker; - Gtkmm2ext::DnDTreeView<boost::shared_ptr<ARDOUR::Redirect> > redirect_display; - Gtk::ScrolledWindow redirect_scroller; + Gtk::EventBox insert_eventbox; + Gtk::HBox insert_hpacker; + Gtkmm2ext::DnDTreeView<boost::shared_ptr<ARDOUR::Insert> > insert_display; + Gtk::ScrolledWindow insert_scroller; - void object_drop (std::string type, uint32_t cnt, const boost::shared_ptr<ARDOUR::Redirect>*); + void object_drop (std::string type, uint32_t cnt, const boost::shared_ptr<ARDOUR::Insert>*); Width _width; @@ -135,72 +136,71 @@ class RedirectBox : public Gtk::HBox void new_send (); void show_send_controls (); - Gtk::Menu *redirect_menu; - gint redirect_menu_map_handler (GdkEventAny *ev); - Gtk::Menu * build_redirect_menu (); - void build_redirect_tooltip (Gtk::EventBox&, string); - void show_redirect_menu (gint arg); + Gtk::Menu *insert_menu; + gint insert_menu_map_handler (GdkEventAny *ev); + Gtk::Menu * build_insert_menu (); + void build_insert_tooltip (Gtk::EventBox&, string); + void show_insert_menu (gint arg); void choose_send (); - void send_io_finished (IOSelector::Result, boost::weak_ptr<ARDOUR::Redirect>, IOSelectorWindow*); + void send_io_finished (IOSelector::Result, boost::shared_ptr<ARDOUR::Send>, IOSelectorWindow*); void choose_insert (); void choose_plugin (); void insert_plugin_chosen (boost::shared_ptr<ARDOUR::Plugin>); - bool no_redirect_redisplay; + bool no_insert_redisplay; bool ignore_delete; - bool redirect_button_press_event (GdkEventButton *); - bool redirect_button_release_event (GdkEventButton *); - void redisplay_redirects (void* src); - void add_redirect_to_display (boost::shared_ptr<ARDOUR::Redirect>); + bool insert_button_press_event (GdkEventButton *); + bool insert_button_release_event (GdkEventButton *); + void redisplay_inserts (); + void add_insert_to_display (boost::shared_ptr<ARDOUR::Insert>); void row_deleted (const Gtk::TreeModel::Path& path); - void show_redirect_active_r (ARDOUR::Redirect*, void *, boost::weak_ptr<ARDOUR::Redirect>); - void show_redirect_active (boost::weak_ptr<ARDOUR::Redirect>); - void show_redirect_name (void* src, boost::weak_ptr<ARDOUR::Redirect>); - string redirect_name (boost::weak_ptr<ARDOUR::Redirect>); + void show_insert_active (boost::weak_ptr<ARDOUR::Insert>); + void show_insert_name (boost::weak_ptr<ARDOUR::Insert>); + string insert_name (boost::weak_ptr<ARDOUR::Insert>); - void remove_redirect_gui (boost::shared_ptr<ARDOUR::Redirect>); + void remove_insert_gui (boost::shared_ptr<ARDOUR::Insert>); - void redirects_reordered (const Gtk::TreeModel::Path&, const Gtk::TreeModel::iterator&, int*); - void compute_redirect_sort_keys (); - vector<sigc::connection> redirect_active_connections; - vector<sigc::connection> redirect_name_connections; + void inserts_reordered (const Gtk::TreeModel::Path&, const Gtk::TreeModel::iterator&, int*); + void compute_insert_sort_keys (); + vector<sigc::connection> insert_active_connections; + vector<sigc::connection> insert_name_connections; - bool redirect_drag_in_progress; - void redirect_drag_begin (GdkDragContext*); - void redirect_drag_end (GdkDragContext*); - void all_redirects_active(bool state); + bool insert_drag_in_progress; + void insert_drag_begin (GdkDragContext*); + void insert_drag_end (GdkDragContext*); + void all_inserts_active(bool state); void all_plugins_active(bool state); void ab_plugins (); - void cut_redirects (); - void copy_redirects (); - void paste_redirects (); - void delete_redirects (); - void clear_redirects (); - void clone_redirects (); - void rename_redirects (); + void cut_inserts (); + void copy_inserts (); + void paste_inserts (); + void delete_inserts (); + void clear_inserts (); + void clone_inserts (); + void rename_inserts (); - void for_selected_redirects (void (RedirectBox::*pmf)(boost::shared_ptr<ARDOUR::Redirect>)); - void get_selected_redirects (vector<boost::shared_ptr<ARDOUR::Redirect> >&); + void for_selected_inserts (void (RedirectBox::*pmf)(boost::shared_ptr<ARDOUR::Insert>)); + void get_selected_inserts (vector<boost::shared_ptr<ARDOUR::Insert> >&); static Glib::RefPtr<Gtk::Action> paste_action; - void paste_redirect_list (std::list<boost::shared_ptr<ARDOUR::Redirect> >& redirects); + void paste_insert_list (std::list<boost::shared_ptr<ARDOUR::Insert> >& inserts); - void activate_redirect (boost::shared_ptr<ARDOUR::Redirect>); - void deactivate_redirect (boost::shared_ptr<ARDOUR::Redirect>); - void cut_redirect (boost::shared_ptr<ARDOUR::Redirect>); - void copy_redirect (boost::shared_ptr<ARDOUR::Redirect>); - void edit_redirect (boost::shared_ptr<ARDOUR::Redirect>); - void hide_redirect_editor (boost::shared_ptr<ARDOUR::Redirect>); - void rename_redirect (boost::shared_ptr<ARDOUR::Redirect>); + void activate_insert (boost::shared_ptr<ARDOUR::Insert>); + void deactivate_insert (boost::shared_ptr<ARDOUR::Insert>); + void cut_insert (boost::shared_ptr<ARDOUR::Insert>); + void copy_insert (boost::shared_ptr<ARDOUR::Insert>); + void edit_insert (boost::shared_ptr<ARDOUR::Insert>); + void hide_insert_editor (boost::shared_ptr<ARDOUR::Insert>); + void rename_insert (boost::shared_ptr<ARDOUR::Insert>); - gint idle_delete_redirect (boost::weak_ptr<ARDOUR::Redirect>); + gint idle_delete_insert (boost::weak_ptr<ARDOUR::Insert>); void weird_plugin_dialog (ARDOUR::Plugin& p, ARDOUR::Route::InsertStreams streams, boost::shared_ptr<ARDOUR::IO> io); - static RedirectBox* _current_redirect_box; + static RedirectBox* _current_insert_box; static bool enter_box (GdkEventCrossing*, RedirectBox*); static bool leave_box (GdkEventCrossing*, RedirectBox*); @@ -223,8 +223,8 @@ class RedirectBox : public Gtk::HBox static void rb_ab_plugins (); static void rb_deactivate_plugins (); - void route_name_changed (void* src, PluginUIWindow* plugin_ui, boost::weak_ptr<ARDOUR::PluginInsert> pi); - std::string generate_redirect_title (boost::shared_ptr<ARDOUR::PluginInsert> pi); + void route_name_changed (PluginUIWindow* plugin_ui, boost::weak_ptr<ARDOUR::PluginInsert> pi); + std::string generate_insert_title (boost::shared_ptr<ARDOUR::PluginInsert> pi); }; #endif /* __ardour_gtk_redirect_box__ */ diff --git a/gtk2_ardour/redirect_selection.h b/gtk2_ardour/redirect_selection.h index d5f28cb301..0b3e0b2983 100644 --- a/gtk2_ardour/redirect_selection.h +++ b/gtk2_ardour/redirect_selection.h @@ -24,9 +24,9 @@ #include <boost/shared_ptr.hpp> namespace ARDOUR { - class Redirect; + class Insert; } -struct RedirectSelection : list<boost::shared_ptr<ARDOUR::Redirect> > {}; +struct InsertSelection : list<boost::shared_ptr<ARDOUR::Insert> > {}; #endif /* __ardour_gtk_redirect_selection_h__ */ diff --git a/gtk2_ardour/route_params_ui.cc b/gtk2_ardour/route_params_ui.cc index b50c5effe7..6a03d72973 100644 --- a/gtk2_ardour/route_params_ui.cc +++ b/gtk2_ardour/route_params_ui.cc @@ -60,8 +60,8 @@ RouteParams_UI::RouteParams_UI () : ArdourDialog ("track/bus inspector"), track_menu(0) { - pre_redirect_box = 0; - post_redirect_box = 0; + pre_insert_box = 0; + post_insert_box = 0; _input_iosel = 0; _output_iosel = 0; _active_pre_view = 0; @@ -178,16 +178,16 @@ RouteParams_UI::add_routes (Session::RouteList& routes) //route_select_list.rows().back().select (); - route->name_changed.connect (bind (mem_fun(*this, &RouteParams_UI::route_name_changed), route)); + route->NameChanged.connect (bind (mem_fun(*this, &RouteParams_UI::route_name_changed), route)); route->GoingAway.connect (bind (mem_fun(*this, &RouteParams_UI::route_removed), route)); } } void -RouteParams_UI::route_name_changed (void *src, boost::shared_ptr<Route> route) +RouteParams_UI::route_name_changed (boost::shared_ptr<Route> route) { - ENSURE_GUI_THREAD(bind (mem_fun(*this, &RouteParams_UI::route_name_changed), src, route)); + ENSURE_GUI_THREAD(bind (mem_fun(*this, &RouteParams_UI::route_name_changed), route)); bool found = false ; TreeModel::Children rows = route_display_model->children(); @@ -219,16 +219,16 @@ RouteParams_UI::setup_redirect_boxes() cleanup_redirect_boxes(); // construct new redirect boxes - pre_redirect_box = new RedirectBox(PreFader, *session, _route, *_plugin_selector, _rr_selection); - post_redirect_box = new RedirectBox(PostFader, *session, _route, *_plugin_selector, _rr_selection); + pre_insert_box = new RedirectBox(PreFader, *session, _route, *_plugin_selector, _rr_selection); + post_insert_box = new RedirectBox(PostFader, *session, _route, *_plugin_selector, _rr_selection); - pre_redir_hpane.pack1 (*pre_redirect_box); - post_redir_hpane.pack1 (*post_redirect_box); + pre_redir_hpane.pack1 (*pre_insert_box); + post_redir_hpane.pack1 (*post_insert_box); - pre_redirect_box->RedirectSelected.connect (bind (mem_fun(*this, &RouteParams_UI::redirect_selected), PreFader)); - pre_redirect_box->RedirectUnselected.connect (bind (mem_fun(*this, &RouteParams_UI::redirect_selected), PreFader)); - post_redirect_box->RedirectSelected.connect (bind (mem_fun(*this, &RouteParams_UI::redirect_selected), PostFader)); - post_redirect_box->RedirectUnselected.connect (bind (mem_fun(*this, &RouteParams_UI::redirect_selected), PostFader)); + pre_insert_box->InsertSelected.connect (bind (mem_fun(*this, &RouteParams_UI::redirect_selected), PreFader)); + pre_insert_box->InsertUnselected.connect (bind (mem_fun(*this, &RouteParams_UI::redirect_selected), PreFader)); + post_insert_box->InsertSelected.connect (bind (mem_fun(*this, &RouteParams_UI::redirect_selected), PostFader)); + post_insert_box->InsertUnselected.connect (bind (mem_fun(*this, &RouteParams_UI::redirect_selected), PostFader)); pre_redir_hpane.show_all(); post_redir_hpane.show_all(); @@ -239,16 +239,16 @@ RouteParams_UI::setup_redirect_boxes() void RouteParams_UI::cleanup_redirect_boxes() { - if (pre_redirect_box) { - pre_redir_hpane.remove(*pre_redirect_box); - delete pre_redirect_box; - pre_redirect_box = 0; + if (pre_insert_box) { + pre_redir_hpane.remove(*pre_insert_box); + delete pre_insert_box; + pre_insert_box = 0; } - if (post_redirect_box) { - post_redir_hpane.remove(*post_redirect_box); - delete post_redirect_box; - post_redirect_box = 0; + if (post_insert_box) { + post_redir_hpane.remove(*post_insert_box); + delete post_insert_box; + post_insert_box = 0; } } @@ -347,8 +347,8 @@ RouteParams_UI::route_removed (boost::shared_ptr<Route> route) cleanup_redirect_boxes(); _route.reset ((Route*) 0); - _pre_redirect.reset ((Redirect*) 0); - _post_redirect.reset ((Redirect*) 0); + _pre_insert.reset ((Redirect*) 0); + _post_insert.reset ((Redirect*) 0); update_title(); } } @@ -389,8 +389,8 @@ RouteParams_UI::session_gone () cleanup_redirect_boxes(); _route.reset ((Route*) 0); - _pre_redirect.reset ((Redirect*) 0); - _post_redirect.reset ((Redirect*) 0); + _pre_insert.reset ((Redirect*) 0); + _post_insert.reset ((Redirect*) 0); update_title(); ArdourDialog::session_gone(); @@ -429,7 +429,7 @@ RouteParams_UI::route_selected() setup_redirect_boxes(); // bind to redirects changed event for this route - _route_conn = route->redirects_changed.connect (mem_fun(*this, &RouteParams_UI::redirects_changed)); + _route_conn = route->inserts_changed.connect (mem_fun(*this, &RouteParams_UI::inserts_changed)); track_input_label.set_text (_route->name()); @@ -446,8 +446,8 @@ RouteParams_UI::route_selected() cleanup_redirect_boxes(); _route.reset ((Route*) 0); - _pre_redirect.reset ((Redirect*) 0); - _post_redirect.reset ((Redirect *) 0); + _pre_insert.reset ((Redirect*) 0); + _post_insert.reset ((Redirect *) 0); track_input_label.set_text(_("NO TRACK")); update_title(); } @@ -467,34 +467,34 @@ RouteParams_UI::route_selected() // cleanup_redirect_boxes(); // _route.reset ((Route*)0); -// _pre_redirect = 0; -// _post_redirect = 0; +// _pre_insert = 0; +// _post_insert = 0; // track_input_label.set_text(_("NO TRACK")); // update_title(); // } //} void -RouteParams_UI::redirects_changed (void *src) +RouteParams_UI::inserts_changed () { - ENSURE_GUI_THREAD(bind (mem_fun(*this, &RouteParams_UI::redirects_changed), src)); + ENSURE_GUI_THREAD(mem_fun(*this, &RouteParams_UI::inserts_changed)); -// pre_redirect_list.freeze (); -// pre_redirect_list.clear (); -// post_redirect_list.freeze (); -// post_redirect_list.clear (); +// pre_insert_list.freeze (); +// pre_insert_list.clear (); +// post_insert_list.freeze (); +// post_insert_list.clear (); // if (_route) { // _route->foreach_redirect (this, &RouteParams_UI::add_redirect_to_display); // } -// pre_redirect_list.thaw (); -// post_redirect_list.thaw (); +// pre_insert_list.thaw (); +// post_insert_list.thaw (); cleanup_pre_view(); cleanup_post_view(); - _pre_redirect.reset ((Redirect*) 0); - _post_redirect.reset ((Redirect*) 0); + _pre_insert.reset ((Redirect*) 0); + _post_insert.reset ((Redirect*) 0); //update_title(); } @@ -518,98 +518,84 @@ RouteParams_UI::show_track_menu() void -RouteParams_UI::redirect_selected (boost::shared_ptr<ARDOUR::Redirect> redirect, ARDOUR::Placement place) +RouteParams_UI::redirect_selected (boost::shared_ptr<ARDOUR::Insert> insert, ARDOUR::Placement place) { - boost::shared_ptr<Insert> insert; - - if ((place == PreFader && _pre_redirect == redirect) - || (place == PostFader && _post_redirect == redirect)){ + if ((place == PreFader && _pre_insert == insert) + || (place == PostFader && _post_insert == insert)){ return; } - if ((insert = boost::dynamic_pointer_cast<Insert> (redirect)) == 0) { + boost::shared_ptr<Send> send; + boost::shared_ptr<PluginInsert> plugin_insert; + boost::shared_ptr<PortInsert> port_insert; + + if ((send = boost::dynamic_pointer_cast<Send> (insert)) != 0) { - boost::shared_ptr<Send> send; - - if ((send = boost::dynamic_pointer_cast<Send> (redirect)) != 0) { + SendUI *send_ui = new SendUI (send, *session); - /* its a send */ + if (place == PreFader) { + cleanup_pre_view(); + _pre_plugin_conn = send->GoingAway.connect (bind (mem_fun(*this, &RouteParams_UI::redirect_going_away), insert)); + _active_pre_view = send_ui; + + pre_redir_hpane.add2 (*_active_pre_view); + pre_redir_hpane.show_all(); + } + else { + cleanup_post_view(); + _post_plugin_conn = send->GoingAway.connect (bind (mem_fun(*this, &RouteParams_UI::redirect_going_away), insert)); + _active_post_view = send_ui; + + post_redir_hpane.add2 (*_active_post_view); + post_redir_hpane.show_all(); + } + } else if ((plugin_insert = boost::dynamic_pointer_cast<PluginInsert> (insert)) != 0) { - SendUI *send_ui = new SendUI (send, *session); + LadspaPluginUI *plugin_ui = new LadspaPluginUI (plugin_insert, true); - if (place == PreFader) { - cleanup_pre_view(); - _pre_plugin_conn = send->GoingAway.connect (bind (mem_fun(*this, &RouteParams_UI::redirect_going_away), redirect)); - _active_pre_view = send_ui; - - pre_redir_hpane.add2 (*_active_pre_view); - pre_redir_hpane.show_all(); - } - else { - cleanup_post_view(); - _post_plugin_conn = send->GoingAway.connect (bind (mem_fun(*this, &RouteParams_UI::redirect_going_away), redirect)); - _active_post_view = send_ui; - - post_redir_hpane.add2 (*_active_post_view); - post_redir_hpane.show_all(); - } + if (place == PreFader) { + cleanup_pre_view(); + _pre_plugin_conn = plugin_insert->plugin()->GoingAway.connect (bind (mem_fun(*this, &RouteParams_UI::plugin_going_away), PreFader)); + plugin_ui->start_updating (0); + _active_pre_view = plugin_ui; + pre_redir_hpane.pack2 (*_active_pre_view); + pre_redir_hpane.show_all(); + } + else { + cleanup_post_view(); + _post_plugin_conn = plugin_insert->plugin()->GoingAway.connect (bind (mem_fun(*this, &RouteParams_UI::plugin_going_away), PostFader)); + plugin_ui->start_updating (0); + _active_post_view = plugin_ui; + post_redir_hpane.pack2 (*_active_post_view); + post_redir_hpane.show_all(); } - } else { - /* its an insert, though we don't know what kind yet. */ + } else if ((port_insert = boost::dynamic_pointer_cast<PortInsert> (insert)) != 0) { - boost::shared_ptr<PluginInsert> plugin_insert; - boost::shared_ptr<PortInsert> port_insert; + PortInsertUI *portinsert_ui = new PortInsertUI (*session, port_insert); - if ((plugin_insert = boost::dynamic_pointer_cast<PluginInsert> (insert)) != 0) { - - LadspaPluginUI *plugin_ui = new LadspaPluginUI (plugin_insert, true); - - if (place == PreFader) { - cleanup_pre_view(); - _pre_plugin_conn = plugin_insert->plugin()->GoingAway.connect (bind (mem_fun(*this, &RouteParams_UI::plugin_going_away), PreFader)); - plugin_ui->start_updating (0); - _active_pre_view = plugin_ui; - pre_redir_hpane.pack2 (*_active_pre_view); - pre_redir_hpane.show_all(); - } - else { - cleanup_post_view(); - _post_plugin_conn = plugin_insert->plugin()->GoingAway.connect (bind (mem_fun(*this, &RouteParams_UI::plugin_going_away), PostFader)); - plugin_ui->start_updating (0); - _active_post_view = plugin_ui; - post_redir_hpane.pack2 (*_active_post_view); - post_redir_hpane.show_all(); - } - - } else if ((port_insert = boost::dynamic_pointer_cast<PortInsert> (insert)) != 0) { - - PortInsertUI *portinsert_ui = new PortInsertUI (*session, port_insert); - - if (place == PreFader) { - cleanup_pre_view(); - _pre_plugin_conn = port_insert->GoingAway.connect (bind (mem_fun(*this, &RouteParams_UI::redirect_going_away), redirect)); - _active_pre_view = portinsert_ui; - pre_redir_hpane.pack2 (*_active_pre_view); - portinsert_ui->redisplay(); - pre_redir_hpane.show_all(); - } - else { - cleanup_post_view(); - _post_plugin_conn = port_insert->GoingAway.connect (bind (mem_fun(*this, &RouteParams_UI::redirect_going_away), redirect)); - _active_post_view = portinsert_ui; - post_redir_hpane.pack2 (*_active_post_view); - portinsert_ui->redisplay(); - post_redir_hpane.show_all(); - } + if (place == PreFader) { + cleanup_pre_view(); + _pre_plugin_conn = port_insert->GoingAway.connect (bind (mem_fun(*this, &RouteParams_UI::redirect_going_away), insert)); + _active_pre_view = portinsert_ui; + pre_redir_hpane.pack2 (*_active_pre_view); + portinsert_ui->redisplay(); + pre_redir_hpane.show_all(); + } + else { + cleanup_post_view(); + _post_plugin_conn = port_insert->GoingAway.connect (bind (mem_fun(*this, &RouteParams_UI::redirect_going_away), insert)); + _active_post_view = portinsert_ui; + post_redir_hpane.pack2 (*_active_post_view); + portinsert_ui->redisplay(); + post_redir_hpane.show_all(); } - } - + if (place == PreFader) { - _pre_redirect = redirect; + _pre_insert = insert; } else { - _post_redirect = redirect; + _post_insert = insert; } update_title(); @@ -625,28 +611,28 @@ RouteParams_UI::plugin_going_away (Placement place) if (place == PreFader) { cleanup_pre_view (false); - _pre_redirect.reset ((Redirect*) 0); + _pre_insert.reset ((Redirect*) 0); } else { cleanup_post_view (false); - _post_redirect.reset ((Redirect*) 0); + _post_insert.reset ((Redirect*) 0); } } void -RouteParams_UI::redirect_going_away (boost::shared_ptr<ARDOUR::Redirect> redirect) +RouteParams_UI::redirect_going_away (boost::shared_ptr<ARDOUR::Insert> insert) { - ENSURE_GUI_THREAD(bind (mem_fun(*this, &RouteParams_UI::redirect_going_away), redirect)); + ENSURE_GUI_THREAD(bind (mem_fun(*this, &RouteParams_UI::redirect_going_away), insert)); printf ("redirect going away\n"); // delete the current view without calling finish - if (redirect == _pre_redirect) { + if (insert == _pre_insert) { cleanup_pre_view (false); - _pre_redirect.reset ((Redirect*) 0); - } else if (redirect == _post_redirect) { + _pre_insert.reset ((Redirect*) 0); + } else if (insert == _post_insert) { cleanup_post_view (false); - _post_redirect.reset ((Redirect*) 0); + _post_insert.reset ((Redirect*) 0); } } diff --git a/gtk2_ardour/route_params_ui.h b/gtk2_ardour/route_params_ui.h index c0b70cbdb1..ffcf6e1366 100644 --- a/gtk2_ardour/route_params_ui.h +++ b/gtk2_ardour/route_params_ui.h @@ -89,8 +89,8 @@ class RouteParams_UI : public ArdourDialog Gtk::HBox route_hpacker; Gtk::VBox route_vpacker; - RedirectBox * pre_redirect_box; - RedirectBox * post_redirect_box; + RedirectBox * pre_insert_box; + RedirectBox * post_insert_box; Gtk::HPaned list_hpane; @@ -121,11 +121,11 @@ class RouteParams_UI : public ArdourDialog sigc::connection _route_conn; sigc::connection _route_ds_conn; - boost::shared_ptr<ARDOUR::Redirect> _pre_redirect; - sigc::connection _pre_plugin_conn; + boost::shared_ptr<ARDOUR::Insert> _pre_insert; + sigc::connection _pre_plugin_conn; - boost::shared_ptr<ARDOUR::Redirect> _post_redirect; - sigc::connection _post_plugin_conn; + boost::shared_ptr<ARDOUR::Insert> _post_insert; + sigc::connection _post_plugin_conn; enum ConfigView { @@ -157,7 +157,7 @@ class RouteParams_UI : public ArdourDialog void add_routes (ARDOUR::Session::RouteList&); - void route_name_changed (void *src, boost::shared_ptr<ARDOUR::Route> route); + void route_name_changed (boost::shared_ptr<ARDOUR::Route> route); void route_removed (boost::shared_ptr<ARDOUR::Route> route); @@ -171,15 +171,15 @@ class RouteParams_UI : public ArdourDialog - void redirects_changed (void *src); + void inserts_changed (); void setup_redirect_boxes(); void cleanup_redirect_boxes(); - void redirect_selected (boost::shared_ptr<ARDOUR::Redirect>, ARDOUR::Placement); + void redirect_selected (boost::shared_ptr<ARDOUR::Insert>, ARDOUR::Placement); void plugin_going_away (ARDOUR::Placement); - void redirect_going_away (boost::shared_ptr<ARDOUR::Redirect>); + void redirect_going_away (boost::shared_ptr<ARDOUR::Insert>); gint edit_input_configuration (GdkEventButton *ev); gint edit_output_configuration (GdkEventButton *ev); diff --git a/gtk2_ardour/route_redirect_selection.cc b/gtk2_ardour/route_redirect_selection.cc index 5ad795c6f5..735c1b4dc5 100644 --- a/gtk2_ardour/route_redirect_selection.cc +++ b/gtk2_ardour/route_redirect_selection.cc @@ -22,7 +22,7 @@ #include <pbd/error.h> #include <ardour/playlist.h> -#include <ardour/redirect.h> +#include <ardour/insert.h> #include <ardour/route.h> #include "route_redirect_selection.h" @@ -37,7 +37,7 @@ RouteRedirectSelection& RouteRedirectSelection::operator= (const RouteRedirectSelection& other) { if (&other != this) { - redirects = other.redirects; + inserts = other.inserts; routes = other.routes; } return *this; @@ -46,22 +46,22 @@ RouteRedirectSelection::operator= (const RouteRedirectSelection& other) bool operator== (const RouteRedirectSelection& a, const RouteRedirectSelection& b) { - return a.redirects == b.redirects && + return a.inserts == b.inserts && a.routes == b.routes; } void RouteRedirectSelection::clear () { - clear_redirects (); + clear_inserts (); clear_routes (); } void -RouteRedirectSelection::clear_redirects () +RouteRedirectSelection::clear_inserts () { - redirects.clear (); - RedirectsChanged (); + inserts.clear (); + InsertsChanged (); } void @@ -72,27 +72,27 @@ RouteRedirectSelection::clear_routes () } void -RouteRedirectSelection::add (boost::shared_ptr<Redirect> r) +RouteRedirectSelection::add (boost::shared_ptr<Insert> r) { - if (find (redirects.begin(), redirects.end(), r) == redirects.end()) { - redirects.push_back (r); + if (find (inserts.begin(), inserts.end(), r) == inserts.end()) { + inserts.push_back (r); // XXX SHAREDPTR FIXME // void (RouteRedirectSelection::*pmf)(Redirect*) = &RouteRedirectSelection::remove; // r->GoingAway.connect (mem_fun(*this, pmf)); - RedirectsChanged(); + InsertsChanged(); } } void -RouteRedirectSelection::add (const vector<boost::shared_ptr<Redirect> >& rlist) +RouteRedirectSelection::add (const vector<boost::shared_ptr<Insert> >& rlist) { bool changed = false; - for (vector<boost::shared_ptr<Redirect> >::const_iterator i = rlist.begin(); i != rlist.end(); ++i) { - if (find (redirects.begin(), redirects.end(), *i) == redirects.end()) { - redirects.push_back (*i); + for (vector<boost::shared_ptr<Insert> >::const_iterator i = rlist.begin(); i != rlist.end(); ++i) { + if (find (inserts.begin(), inserts.end(), *i) == inserts.end()) { + inserts.push_back (*i); // XXX SHAREDPTR FIXME @@ -103,31 +103,31 @@ RouteRedirectSelection::add (const vector<boost::shared_ptr<Redirect> >& rlist) } if (changed) { - RedirectsChanged(); + InsertsChanged(); } } void -RouteRedirectSelection::remove (boost::shared_ptr<Redirect> r) +RouteRedirectSelection::remove (boost::shared_ptr<Insert> r) { - list<boost::shared_ptr<Redirect> >::iterator i; - if ((i = find (redirects.begin(), redirects.end(), r)) != redirects.end()) { - redirects.erase (i); - RedirectsChanged (); + list<boost::shared_ptr<Insert> >::iterator i; + if ((i = find (inserts.begin(), inserts.end(), r)) != inserts.end()) { + inserts.erase (i); + InsertsChanged (); } } void -RouteRedirectSelection::set (boost::shared_ptr<Redirect> r) +RouteRedirectSelection::set (boost::shared_ptr<Insert> r) { - clear_redirects (); + clear_inserts (); add (r); } void -RouteRedirectSelection::set (const vector<boost::shared_ptr<Redirect> >& rlist) +RouteRedirectSelection::set (const vector<boost::shared_ptr<Insert> >& rlist) { - clear_redirects (); + clear_inserts (); add (rlist); } @@ -171,6 +171,6 @@ RouteRedirectSelection::selected (boost::shared_ptr<Route> r) bool RouteRedirectSelection::empty () { - return redirects.empty () && routes.empty (); + return inserts.empty () && routes.empty (); } diff --git a/gtk2_ardour/route_redirect_selection.h b/gtk2_ardour/route_redirect_selection.h index 8f0cfaf543..395012c32e 100644 --- a/gtk2_ardour/route_redirect_selection.h +++ b/gtk2_ardour/route_redirect_selection.h @@ -29,30 +29,30 @@ class RouteRedirectSelection : public sigc::trackable { public: - RedirectSelection redirects; + InsertSelection inserts; RouteSelection routes; RouteRedirectSelection() {} RouteRedirectSelection& operator= (const RouteRedirectSelection& other); - sigc::signal<void> RedirectsChanged; + sigc::signal<void> InsertsChanged; sigc::signal<void> RoutesChanged; void clear (); bool empty(); - void set (boost::shared_ptr<ARDOUR::Redirect>); - void set (const std::vector<boost::shared_ptr<ARDOUR::Redirect> >&); - void add (boost::shared_ptr<ARDOUR::Redirect>); - void add (const std::vector<boost::shared_ptr<ARDOUR::Redirect> >&); - void remove (boost::shared_ptr<ARDOUR::Redirect>); + void set (boost::shared_ptr<ARDOUR::Insert>); + void set (const std::vector<boost::shared_ptr<ARDOUR::Insert> >&); + void add (boost::shared_ptr<ARDOUR::Insert>); + void add (const std::vector<boost::shared_ptr<ARDOUR::Insert> >&); + void remove (boost::shared_ptr<ARDOUR::Insert>); void set (boost::shared_ptr<ARDOUR::Route>); void add (boost::shared_ptr<ARDOUR::Route>); void remove (boost::shared_ptr<ARDOUR::Route>); - void clear_redirects (); + void clear_inserts (); void clear_routes (); bool selected (boost::shared_ptr<ARDOUR::Route>); diff --git a/gtk2_ardour/route_time_axis.cc b/gtk2_ardour/route_time_axis.cc index c56be02366..900064a763 100644 --- a/gtk2_ardour/route_time_axis.cc +++ b/gtk2_ardour/route_time_axis.cc @@ -179,8 +179,8 @@ RouteTimeAxisView::RouteTimeAxisView (PublicEditor& ed, Session& sess, boost::sh _route->mute_changed.connect (mem_fun(*this, &RouteUI::mute_changed)); _route->solo_changed.connect (mem_fun(*this, &RouteUI::solo_changed)); - _route->redirects_changed.connect (mem_fun(*this, &RouteTimeAxisView::redirects_changed)); - _route->name_changed.connect (mem_fun(*this, &RouteTimeAxisView::route_name_changed)); + _route->inserts_changed.connect (mem_fun(*this, &RouteTimeAxisView::inserts_changed)); + _route->NameChanged.connect (mem_fun(*this, &RouteTimeAxisView::route_name_changed)); _route->solo_safe_changed.connect (mem_fun(*this, &RouteUI::solo_changed)); @@ -204,9 +204,9 @@ RouteTimeAxisView::~RouteTimeAxisView () { GoingAway (); /* EMIT_SIGNAL */ - vector_delete (&redirect_automation_curves); + vector_delete (&insert_automation_curves); - for (list<RedirectAutomationInfo*>::iterator i = redirect_automation.begin(); i != redirect_automation.end(); ++i) { + for (list<InsertAutomationInfo*>::iterator i = insert_automation.begin(); i != insert_automation.end(); ++i) { delete *i; } @@ -232,9 +232,9 @@ RouteTimeAxisView::post_construct () /* map current state of the route */ update_diskstream_display (); - _route->foreach_redirect (this, &RouteTimeAxisView::add_redirect_to_subplugin_menu); - _route->foreach_redirect (this, &RouteTimeAxisView::add_existing_redirect_automation_curves); - reset_redirect_automation_curves (); + _route->foreach_insert (this, &RouteTimeAxisView::add_insert_to_subplugin_menu); + _route->foreach_insert (this, &RouteTimeAxisView::add_existing_insert_automation_curves); + reset_insert_automation_curves (); } void @@ -322,7 +322,7 @@ RouteTimeAxisView::label_view () } void -RouteTimeAxisView::route_name_changed (void *src) +RouteTimeAxisView::route_name_changed () { editor.route_name_changed (this); label_view (); @@ -1135,7 +1135,7 @@ RouteTimeAxisView::name_entry_changed () } if (_session.route_name_unique (x)) { - _route->set_name (x, this); + _route->set_name (x); } else { ARDOUR_UI::instance()->popup_error (_("A track already exists with that name")); name_entry.set_text (_route->name()); @@ -1253,8 +1253,7 @@ RouteTimeAxisView::paste (nframes_t pos, float times, Selection& selection, size list<TimeAxisView*> RouteTimeAxisView::get_child_list() { - - list<TimeAxisView*>redirect_children; + list<TimeAxisView*> redirect_children; for (vector<TimeAxisView*>::iterator i = children.begin(); i != children.end(); ++i) { if (!(*i)->hidden()) { @@ -1385,10 +1384,10 @@ RouteTimeAxisView::show_all_automation () { no_redraw = true; - for (list<RedirectAutomationInfo*>::iterator i = redirect_automation.begin(); i != redirect_automation.end(); ++i) { - for (vector<RedirectAutomationNode*>::iterator ii = (*i)->lines.begin(); ii != (*i)->lines.end(); ++ii) { + for (list<InsertAutomationInfo*>::iterator i = insert_automation.begin(); i != insert_automation.end(); ++i) { + for (vector<InsertAutomationNode*>::iterator ii = (*i)->lines.begin(); ii != (*i)->lines.end(); ++ii) { if ((*ii)->view == 0) { - add_redirect_automation_curve ((*i)->redirect, (*ii)->what); + add_insert_automation_curve ((*i)->insert, (*ii)->what); } (*ii)->menu_item->set_active (true); @@ -1405,8 +1404,8 @@ RouteTimeAxisView::show_existing_automation () { no_redraw = true; - for (list<RedirectAutomationInfo*>::iterator i = redirect_automation.begin(); i != redirect_automation.end(); ++i) { - for (vector<RedirectAutomationNode*>::iterator ii = (*i)->lines.begin(); ii != (*i)->lines.end(); ++ii) { + for (list<InsertAutomationInfo*>::iterator i = insert_automation.begin(); i != insert_automation.end(); ++i) { + for (vector<InsertAutomationNode*>::iterator ii = (*i)->lines.begin(); ii != (*i)->lines.end(); ++ii) { if ((*ii)->view != 0) { (*ii)->menu_item->set_active (true); } @@ -1423,8 +1422,8 @@ RouteTimeAxisView::hide_all_automation () { no_redraw = true; - for (list<RedirectAutomationInfo*>::iterator i = redirect_automation.begin(); i != redirect_automation.end(); ++i) { - for (vector<RedirectAutomationNode*>::iterator ii = (*i)->lines.begin(); ii != (*i)->lines.end(); ++ii) { + for (list<InsertAutomationInfo*>::iterator i = insert_automation.begin(); i != insert_automation.end(); ++i) { + for (vector<InsertAutomationNode*>::iterator ii = (*i)->lines.begin(); ii != (*i)->lines.end(); ++ii) { (*ii)->menu_item->set_active (false); } } @@ -1447,20 +1446,20 @@ RouteTimeAxisView::region_view_added (RegionView* rv) } void -RouteTimeAxisView::add_ghost_to_redirect (RegionView* rv, AutomationTimeAxisView* atv) +RouteTimeAxisView::add_ghost_to_insert (RegionView* rv, AutomationTimeAxisView* atv) { rv->add_ghost (*atv); } -RouteTimeAxisView::RedirectAutomationInfo::~RedirectAutomationInfo () +RouteTimeAxisView::InsertAutomationInfo::~InsertAutomationInfo () { - for (vector<RedirectAutomationNode*>::iterator i = lines.begin(); i != lines.end(); ++i) { + for (vector<InsertAutomationNode*>::iterator i = lines.begin(); i != lines.end(); ++i) { delete *i; } } -RouteTimeAxisView::RedirectAutomationNode::~RedirectAutomationNode () +RouteTimeAxisView::InsertAutomationNode::~InsertAutomationNode () { parent.remove_ran (this); @@ -1470,21 +1469,21 @@ RouteTimeAxisView::RedirectAutomationNode::~RedirectAutomationNode () } void -RouteTimeAxisView::remove_ran (RedirectAutomationNode* ran) +RouteTimeAxisView::remove_ran (InsertAutomationNode* ran) { if (ran->view) { remove_child (ran->view); } } -RouteTimeAxisView::RedirectAutomationNode* -RouteTimeAxisView::find_redirect_automation_node (boost::shared_ptr<Redirect> redirect, uint32_t what) +RouteTimeAxisView::InsertAutomationNode* +RouteTimeAxisView::find_insert_automation_node (boost::shared_ptr<Insert> insert, uint32_t what) { - for (list<RedirectAutomationInfo*>::iterator i = redirect_automation.begin(); i != redirect_automation.end(); ++i) { + for (list<InsertAutomationInfo*>::iterator i = insert_automation.begin(); i != insert_automation.end(); ++i) { - if ((*i)->redirect == redirect) { + if ((*i)->insert == insert) { - for (vector<RedirectAutomationNode*>::iterator ii = (*i)->lines.begin(); ii != (*i)->lines.end(); ++ii) { + for (vector<InsertAutomationNode*>::iterator ii = (*i)->lines.begin(); ii != (*i)->lines.end(); ++ii) { if ((*ii)->what == what) { return *ii; } @@ -1495,7 +1494,6 @@ RouteTimeAxisView::find_redirect_automation_node (boost::shared_ptr<Redirect> re return 0; } -// FIXME: duplicated in midi_time_axis.cc static string legalize_for_xml_node (string str) { @@ -1516,16 +1514,16 @@ legalize_for_xml_node (string str) void -RouteTimeAxisView::add_redirect_automation_curve (boost::shared_ptr<Redirect> redirect, uint32_t what) +RouteTimeAxisView::add_insert_automation_curve (boost::shared_ptr<Insert> insert, uint32_t what) { RedirectAutomationLine* ral; string name; - RedirectAutomationNode* ran; + InsertAutomationNode* ran; - if ((ran = find_redirect_automation_node (redirect, what)) == 0) { + if ((ran = find_insert_automation_node (insert, what)) == 0) { fatal << _("programming error: ") - << string_compose (X_("redirect automation curve for %1:%2 not registered with audio track!"), - redirect->name(), what) + << string_compose (X_("insert automation curve for %1:%2 not registered with audio track!"), + insert->name(), what) << endmsg; /*NOTREACHED*/ return; @@ -1535,25 +1533,25 @@ RouteTimeAxisView::add_redirect_automation_curve (boost::shared_ptr<Redirect> re return; } - name = redirect->describe_parameter (what); + name = insert->describe_parameter (what); /* create a string that is a legal XML node name that can be used to refer to this redirect+port combination */ char state_name[256]; - snprintf (state_name, sizeof (state_name), "Redirect-%s-%" PRIu32, legalize_for_xml_node (redirect->name()).c_str(), what); + snprintf (state_name, sizeof (state_name), "Redirect-%s-%" PRIu32, legalize_for_xml_node (insert->name()).c_str(), what); - ran->view = new RedirectAutomationTimeAxisView (_session, _route, editor, *this, parent_canvas, name, what, *redirect, state_name); + ran->view = new RedirectAutomationTimeAxisView (_session, _route, editor, *this, parent_canvas, name, what, *insert, state_name); ral = new RedirectAutomationLine (name, - *redirect, what, _session, *ran->view, - *ran->view->canvas_display, redirect->automation_list (what)); + *insert, what, _session, *ran->view, + *ran->view->canvas_display, insert->automation_list (what)); ral->set_line_color (Config->canvasvar_RedirectAutomationLine.get()); ral->queue_reset (); ran->view->add_line (*ral); - ran->view->Hiding.connect (bind (mem_fun(*this, &RouteTimeAxisView::redirect_automation_track_hidden), ran, redirect)); + ran->view->Hiding.connect (bind (mem_fun(*this, &RouteTimeAxisView::insert_automation_track_hidden), ran, insert)); if (!ran->view->marked_for_display()) { ran->view->hide (); @@ -1564,68 +1562,68 @@ RouteTimeAxisView::add_redirect_automation_curve (boost::shared_ptr<Redirect> re add_child (ran->view); if (_view) { - _view->foreach_regionview (bind (mem_fun(*this, &RouteTimeAxisView::add_ghost_to_redirect), ran->view)); + _view->foreach_regionview (bind (mem_fun(*this, &RouteTimeAxisView::add_ghost_to_insert), ran->view)); } - redirect->mark_automation_visible (what, true); + insert->mark_automation_visible (what, true); } void -RouteTimeAxisView::redirect_automation_track_hidden (RouteTimeAxisView::RedirectAutomationNode* ran, boost::shared_ptr<Redirect> r) +RouteTimeAxisView::insert_automation_track_hidden (RouteTimeAxisView::InsertAutomationNode* ran, boost::shared_ptr<Insert> i) { if (!_hidden) { ran->menu_item->set_active (false); } - r->mark_automation_visible (ran->what, false); + i->mark_automation_visible (ran->what, false); _route->gui_changed ("track_height", (void *) 0); /* EMIT_SIGNAL */ } void -RouteTimeAxisView::add_existing_redirect_automation_curves (boost::shared_ptr<Redirect> redirect) +RouteTimeAxisView::add_existing_insert_automation_curves (boost::shared_ptr<Insert> insert) { set<uint32_t> s; RedirectAutomationLine *ral; - redirect->what_has_visible_automation (s); + insert->what_has_visible_automation (s); for (set<uint32_t>::iterator i = s.begin(); i != s.end(); ++i) { - if ((ral = find_redirect_automation_curve (redirect, *i)) != 0) { + if ((ral = find_insert_automation_curve (insert, *i)) != 0) { ral->queue_reset (); } else { - add_redirect_automation_curve (redirect, (*i)); + add_insert_automation_curve (insert, (*i)); } } } void -RouteTimeAxisView::add_redirect_to_subplugin_menu (boost::shared_ptr<Redirect> r) +RouteTimeAxisView::add_insert_to_subplugin_menu (boost::shared_ptr<Insert> insert) { using namespace Menu_Helpers; - RedirectAutomationInfo *rai; - list<RedirectAutomationInfo*>::iterator x; + InsertAutomationInfo *rai; + list<InsertAutomationInfo*>::iterator x; - const std::set<uint32_t>& automatable = r->what_can_be_automated (); + const std::set<uint32_t>& automatable = insert->what_can_be_automated (); std::set<uint32_t> has_visible_automation; - r->what_has_visible_automation(has_visible_automation); + insert->what_has_visible_automation(has_visible_automation); if (automatable.empty()) { return; } - for (x = redirect_automation.begin(); x != redirect_automation.end(); ++x) { - if ((*x)->redirect == r) { + for (x = insert_automation.begin(); x != insert_automation.end(); ++x) { + if ((*x)->insert == insert) { break; } } - if (x == redirect_automation.end()) { + if (x == insert_automation.end()) { - rai = new RedirectAutomationInfo (r); - redirect_automation.push_back (rai); + rai = new InsertAutomationInfo (insert); + insert_automation.push_back (rai); } else { @@ -1633,7 +1631,7 @@ RouteTimeAxisView::add_redirect_to_subplugin_menu (boost::shared_ptr<Redirect> r } - /* any older menu was deleted at the top of redirects_changed() + /* any older menu was deleted at the top of inserts_changed() when we cleared the subplugin menu. */ @@ -1645,10 +1643,10 @@ RouteTimeAxisView::add_redirect_to_subplugin_menu (boost::shared_ptr<Redirect> r for (std::set<uint32_t>::const_iterator i = automatable.begin(); i != automatable.end(); ++i) { - RedirectAutomationNode* ran; + InsertAutomationNode* ran; CheckMenuItem* mitem; - string name = r->describe_parameter (*i); + string name = insert->describe_parameter (*i); items.push_back (CheckMenuElem (name)); mitem = dynamic_cast<CheckMenuItem*> (&items.back()); @@ -1657,11 +1655,11 @@ RouteTimeAxisView::add_redirect_to_subplugin_menu (boost::shared_ptr<Redirect> r mitem->set_active(true); } - if ((ran = find_redirect_automation_node (r, *i)) == 0) { + if ((ran = find_insert_automation_node (insert, *i)) == 0) { /* new item */ - ran = new RedirectAutomationNode (*i, mitem, *this); + ran = new InsertAutomationNode (*i, mitem, *this); rai->lines.push_back (ran); @@ -1671,28 +1669,28 @@ RouteTimeAxisView::add_redirect_to_subplugin_menu (boost::shared_ptr<Redirect> r } - mitem->signal_toggled().connect (bind (mem_fun(*this, &RouteTimeAxisView::redirect_menu_item_toggled), rai, ran)); + mitem->signal_toggled().connect (bind (mem_fun(*this, &RouteTimeAxisView::insert_menu_item_toggled), rai, ran)); } - /* add the menu for this redirect, because the subplugin - menu is always cleared at the top of redirects_changed(). + /* add the menu for this insert, because the subplugin + menu is always cleared at the top of inserts_changed(). this is the result of some poor design in gtkmm and/or GTK+. */ - subplugin_menu.items().push_back (MenuElem (r->name(), *rai->menu)); + subplugin_menu.items().push_back (MenuElem (insert->name(), *rai->menu)); rai->valid = true; } void -RouteTimeAxisView::redirect_menu_item_toggled (RouteTimeAxisView::RedirectAutomationInfo* rai, - RouteTimeAxisView::RedirectAutomationNode* ran) +RouteTimeAxisView::insert_menu_item_toggled (RouteTimeAxisView::InsertAutomationInfo* rai, + RouteTimeAxisView::InsertAutomationNode* ran) { bool showit = ran->menu_item->get_active(); bool redraw = false; if (ran->view == 0 && showit) { - add_redirect_automation_curve (rai->redirect, ran->what); + add_insert_automation_curve (rai->insert, ran->what); redraw = true; } @@ -1702,7 +1700,7 @@ RouteTimeAxisView::redirect_menu_item_toggled (RouteTimeAxisView::RedirectAutoma ran->view->set_marked_for_display (true); ran->view->canvas_display->show(); } else { - rai->redirect->mark_automation_visible (ran->what, true); + rai->insert->mark_automation_visible (ran->what, true); ran->view->set_marked_for_display (false); ran->view->hide (); } @@ -1721,22 +1719,22 @@ RouteTimeAxisView::redirect_menu_item_toggled (RouteTimeAxisView::RedirectAutoma } void -RouteTimeAxisView::redirects_changed (void *src) +RouteTimeAxisView::inserts_changed () { using namespace Menu_Helpers; - for (list<RedirectAutomationInfo*>::iterator i = redirect_automation.begin(); i != redirect_automation.end(); ++i) { + for (list<InsertAutomationInfo*>::iterator i = insert_automation.begin(); i != insert_automation.end(); ++i) { (*i)->valid = false; } subplugin_menu.items().clear (); - _route->foreach_redirect (this, &RouteTimeAxisView::add_redirect_to_subplugin_menu); - _route->foreach_redirect (this, &RouteTimeAxisView::add_existing_redirect_automation_curves); + _route->foreach_insert (this, &RouteTimeAxisView::add_insert_to_subplugin_menu); + _route->foreach_insert (this, &RouteTimeAxisView::add_existing_insert_automation_curves); - for (list<RedirectAutomationInfo*>::iterator i = redirect_automation.begin(); i != redirect_automation.end(); ) { + for (list<InsertAutomationInfo*>::iterator i = insert_automation.begin(); i != insert_automation.end(); ) { - list<RedirectAutomationInfo*>::iterator tmp; + list<InsertAutomationInfo*>::iterator tmp; tmp = i; ++tmp; @@ -1744,7 +1742,7 @@ RouteTimeAxisView::redirects_changed (void *src) if (!(*i)->valid) { delete *i; - redirect_automation.erase (i); + insert_automation.erase (i); } @@ -1757,11 +1755,11 @@ RouteTimeAxisView::redirects_changed (void *src) } RedirectAutomationLine * -RouteTimeAxisView::find_redirect_automation_curve (boost::shared_ptr<Redirect> redirect, uint32_t what) +RouteTimeAxisView::find_insert_automation_curve (boost::shared_ptr<Insert> insert, uint32_t what) { - RedirectAutomationNode* ran; + InsertAutomationNode* ran; - if ((ran = find_redirect_automation_node (redirect, what)) != 0) { + if ((ran = find_insert_automation_node (insert, what)) != 0) { if (ran->view) { return dynamic_cast<RedirectAutomationLine*> (ran->view->lines.front()); } @@ -1771,9 +1769,9 @@ RouteTimeAxisView::find_redirect_automation_curve (boost::shared_ptr<Redirect> r } void -RouteTimeAxisView::reset_redirect_automation_curves () +RouteTimeAxisView::reset_insert_automation_curves () { - for (vector<RedirectAutomationLine*>::iterator i = redirect_automation_curves.begin(); i != redirect_automation_curves.end(); ++i) { + for (vector<RedirectAutomationLine*>::iterator i = insert_automation_curves.begin(); i != insert_automation_curves.end(); ++i) { (*i)->reset(); } } diff --git a/gtk2_ardour/route_time_axis.h b/gtk2_ardour/route_time_axis.h index 368e29d0a0..e14d682c83 100644 --- a/gtk2_ardour/route_time_axis.h +++ b/gtk2_ardour/route_time_axis.h @@ -103,28 +103,28 @@ public: protected: friend class StreamView; - struct RedirectAutomationNode { + struct InsertAutomationNode { uint32_t what; Gtk::CheckMenuItem* menu_item; AutomationTimeAxisView* view; RouteTimeAxisView& parent; - RedirectAutomationNode (uint32_t w, Gtk::CheckMenuItem* mitem, RouteTimeAxisView& p) + InsertAutomationNode (uint32_t w, Gtk::CheckMenuItem* mitem, RouteTimeAxisView& p) : what (w), menu_item (mitem), view (0), parent (p) {} - ~RedirectAutomationNode (); + ~InsertAutomationNode (); }; - struct RedirectAutomationInfo { - boost::shared_ptr<ARDOUR::Redirect> redirect; - bool valid; - Gtk::Menu* menu; - vector<RedirectAutomationNode*> lines; + struct InsertAutomationInfo { + boost::shared_ptr<ARDOUR::Insert> insert; + bool valid; + Gtk::Menu* menu; + vector<InsertAutomationNode*> lines; - RedirectAutomationInfo (boost::shared_ptr<ARDOUR::Redirect> r) - : redirect (r), valid (true), menu (0) {} + InsertAutomationInfo (boost::shared_ptr<ARDOUR::Insert> i) + : insert (i), valid (true), menu (0) {} - ~RedirectAutomationInfo (); + ~InsertAutomationInfo (); }; @@ -133,30 +133,30 @@ protected: gint edit_click (GdkEventButton *); - void redirects_changed (void *); + void inserts_changed (); - void add_redirect_to_subplugin_menu (boost::shared_ptr<ARDOUR::Redirect>); - void remove_ran (RedirectAutomationNode* ran); + void add_insert_to_subplugin_menu (boost::shared_ptr<ARDOUR::Insert>); + void remove_ran (InsertAutomationNode* ran); - void redirect_menu_item_toggled (RouteTimeAxisView::RedirectAutomationInfo*, - RouteTimeAxisView::RedirectAutomationNode*); + void insert_menu_item_toggled (RouteTimeAxisView::InsertAutomationInfo*, + RouteTimeAxisView::InsertAutomationNode*); - void redirect_automation_track_hidden (RedirectAutomationNode*, - boost::shared_ptr<ARDOUR::Redirect>); + void insert_automation_track_hidden (InsertAutomationNode*, + boost::shared_ptr<ARDOUR::Insert>); - RedirectAutomationNode* - find_redirect_automation_node (boost::shared_ptr<ARDOUR::Redirect> r, uint32_t); + InsertAutomationNode* + find_insert_automation_node (boost::shared_ptr<ARDOUR::Insert> i, uint32_t); RedirectAutomationLine* - find_redirect_automation_curve (boost::shared_ptr<ARDOUR::Redirect> r, uint32_t); + find_insert_automation_curve (boost::shared_ptr<ARDOUR::Insert> i, uint32_t); - void add_redirect_automation_curve (boost::shared_ptr<ARDOUR::Redirect> r, uint32_t); - void add_existing_redirect_automation_curves (boost::shared_ptr<ARDOUR::Redirect>); + void add_insert_automation_curve (boost::shared_ptr<ARDOUR::Insert> r, uint32_t); + void add_existing_insert_automation_curves (boost::shared_ptr<ARDOUR::Insert>); - void reset_redirect_automation_curves (); + void reset_insert_automation_curves (); - void take_name_changed (void *); - void route_name_changed (void *); + void take_name_changed (void *src); + void route_name_changed (); void name_entry_changed (); void update_rec_display (); @@ -202,7 +202,7 @@ protected: void color_handler (); void region_view_added (RegionView*); - void add_ghost_to_redirect (RegionView*, AutomationTimeAxisView*); + void add_ghost_to_insert (RegionView*, AutomationTimeAxisView*); StreamView* _view; @@ -211,7 +211,7 @@ protected: Gtk::HBox other_button_hbox; Gtk::Table button_table; - Gtk::Button redirect_button; + Gtk::Button insert_button; Gtk::Button edit_group_button; Gtk::Button playlist_button; Gtk::Button size_button; @@ -238,8 +238,8 @@ protected: void _set_track_mode (ARDOUR::Track* track, ARDOUR::TrackMode mode, Gtk::RadioMenuItem* reset_item); void track_mode_changed (); - list<RedirectAutomationInfo*> redirect_automation; - vector<RedirectAutomationLine*> redirect_automation_curves; + list<InsertAutomationInfo*> insert_automation; + vector<RedirectAutomationLine*> insert_automation_curves; sigc::connection modified_connection; diff --git a/gtk2_ardour/route_ui.cc b/gtk2_ardour/route_ui.cc index e0591f0806..eb2eaeb115 100644 --- a/gtk2_ardour/route_ui.cc +++ b/gtk2_ardour/route_ui.cc @@ -817,7 +817,7 @@ RouteUI::route_rename () case Gtk::RESPONSE_ACCEPT: name_prompter.get_result (result); if (result.length()) { - _route->set_name (result, this); + _route->set_name (result); } break; } @@ -827,9 +827,9 @@ RouteUI::route_rename () } void -RouteUI::name_changed (void *src) +RouteUI::name_changed () { - ENSURE_GUI_THREAD(bind (mem_fun (*this, &RouteUI::name_changed), src)); + ENSURE_GUI_THREAD(sigc::mem_fun(*this, &RouteUI::name_changed)); name_label.set_text (_route->name()); } diff --git a/gtk2_ardour/route_ui.h b/gtk2_ardour/route_ui.h index f3021f675d..e727c2e56d 100644 --- a/gtk2_ardour/route_ui.h +++ b/gtk2_ardour/route_ui.h @@ -98,7 +98,7 @@ class RouteUI : public virtual AxisView void solo_changed(void*); void solo_changed_so_update_mute (); void mute_changed(void*); - virtual void redirects_changed (void *) {} + virtual void inserts_changed () {} void route_rec_enable_changed(); void session_rec_enable_changed(); @@ -133,7 +133,7 @@ class RouteUI : public virtual AxisView void route_rename(); - virtual void name_changed (void *src); + virtual void name_changed (); void route_removed (); Gtk::CheckMenuItem *route_active_menu_item; diff --git a/gtk2_ardour/selection.cc b/gtk2_ardour/selection.cc index 638a621428..7d68d9bbd0 100644 --- a/gtk2_ardour/selection.cc +++ b/gtk2_ardour/selection.cc @@ -64,7 +64,7 @@ operator== (const Selection& a, const Selection& b) a.time == b.time && a.lines == b.lines && a.playlists == b.playlists && - a.redirects == b.redirects; + a.inserts == b.inserts; } /** Clear everything from the Selection */ @@ -77,7 +77,7 @@ Selection::clear () clear_lines(); clear_time (); clear_playlists (); - clear_redirects (); + clear_inserts (); } void @@ -91,11 +91,11 @@ Selection::dump_region_layers() void -Selection::clear_redirects () +Selection::clear_inserts () { - if (!redirects.empty()) { - redirects.clear (); - RedirectsChanged (); + if (!inserts.empty()) { + inserts.clear (); + InsertsChanged (); } } @@ -154,16 +154,16 @@ Selection::clear_lines () } void -Selection::toggle (boost::shared_ptr<Redirect> r) +Selection::toggle (boost::shared_ptr<Insert> r) { - RedirectSelection::iterator i; + InsertSelection::iterator i; - if ((i = find (redirects.begin(), redirects.end(), r)) == redirects.end()) { - redirects.push_back (r); + if ((i = find (inserts.begin(), inserts.end(), r)) == inserts.end()) { + inserts.push_back (r); } else { - redirects.erase (i); + inserts.erase (i); } - RedirectsChanged(); + InsertsChanged(); } @@ -254,11 +254,11 @@ Selection::toggle (nframes_t start, nframes_t end) void -Selection::add (boost::shared_ptr<Redirect> r) +Selection::add (boost::shared_ptr<Insert> i) { - if (find (redirects.begin(), redirects.end(), r) == redirects.end()) { - redirects.push_back (r); - RedirectsChanged(); + if (find (inserts.begin(), inserts.end(), i) == inserts.end()) { + inserts.push_back (i); + InsertsChanged(); } } @@ -395,12 +395,12 @@ Selection::add (AutomationList* ac) } void -Selection::remove (boost::shared_ptr<Redirect> r) +Selection::remove (boost::shared_ptr<Insert> r) { - RedirectSelection::iterator i; - if ((i = find (redirects.begin(), redirects.end(), r)) != redirects.end()) { - redirects.erase (i); - RedirectsChanged (); + InsertSelection::iterator i; + if ((i = find (inserts.begin(), inserts.end(), r)) != inserts.end()) { + inserts.erase (i); + InsertsChanged (); } } @@ -510,10 +510,10 @@ Selection::remove (AutomationList *ac) } void -Selection::set (boost::shared_ptr<Redirect> r) +Selection::set (boost::shared_ptr<Insert> i) { - clear_redirects (); - add (r); + clear_inserts (); + add (i); } void @@ -625,7 +625,7 @@ Selection::empty () lines.empty () && time.empty () && playlists.empty () && - redirects.empty () + inserts.empty () ; } diff --git a/gtk2_ardour/selection.h b/gtk2_ardour/selection.h index 868163d04f..401531c30b 100644 --- a/gtk2_ardour/selection.h +++ b/gtk2_ardour/selection.h @@ -41,7 +41,7 @@ namespace ARDOUR { class Region; class AudioRegion; class Playlist; - class Redirect; + class Insert; class AutomationList; } @@ -69,7 +69,7 @@ class Selection : public sigc::trackable TimeSelection time; AutomationSelection lines; PlaylistSelection playlists; - RedirectSelection redirects; + InsertSelection inserts; PointSelection points; Selection() { @@ -84,7 +84,7 @@ class Selection : public sigc::trackable sigc::signal<void> TimeChanged; sigc::signal<void> LinesChanged; sigc::signal<void> PlaylistsChanged; - sigc::signal<void> RedirectsChanged; + sigc::signal<void> InsertsChanged; sigc::signal<void> PointsChanged; void clear (); @@ -107,7 +107,7 @@ class Selection : public sigc::trackable void set (ARDOUR::AutomationList*); void set (boost::shared_ptr<ARDOUR::Playlist>); void set (const std::list<boost::shared_ptr<ARDOUR::Playlist> >&); - void set (boost::shared_ptr<ARDOUR::Redirect>); + void set (boost::shared_ptr<ARDOUR::Insert>); void set (AutomationSelectable*); void toggle (TimeAxisView*); @@ -118,7 +118,7 @@ class Selection : public sigc::trackable void toggle (ARDOUR::AutomationList*); void toggle (boost::shared_ptr<ARDOUR::Playlist>); void toggle (const std::list<boost::shared_ptr<ARDOUR::Playlist> >&); - void toggle (boost::shared_ptr<ARDOUR::Redirect>); + void toggle (boost::shared_ptr<ARDOUR::Insert>); void toggle (const std::vector<AutomationSelectable*>&); void add (TimeAxisView*); @@ -129,7 +129,7 @@ class Selection : public sigc::trackable void add (ARDOUR::AutomationList*); void add (boost::shared_ptr<ARDOUR::Playlist>); void add (const std::list<boost::shared_ptr<ARDOUR::Playlist> >&); - void add (boost::shared_ptr<ARDOUR::Redirect>); + void add (boost::shared_ptr<ARDOUR::Insert>); void remove (TimeAxisView*); void remove (const std::list<TimeAxisView*>&); @@ -139,7 +139,7 @@ class Selection : public sigc::trackable void remove (ARDOUR::AutomationList*); void remove (boost::shared_ptr<ARDOUR::Playlist>); void remove (const std::list<boost::shared_ptr<ARDOUR::Playlist> >&); - void remove (boost::shared_ptr<ARDOUR::Redirect>); + void remove (boost::shared_ptr<ARDOUR::Insert>); void remove (const list<Selectable*>&); void replace (uint32_t time_index, nframes_t start, nframes_t end); @@ -149,7 +149,7 @@ class Selection : public sigc::trackable void clear_time(); void clear_lines (); void clear_playlists (); - void clear_redirects (); + void clear_inserts (); void clear_points (); void foreach_region (void (ARDOUR::Region::*method)(void)); diff --git a/gtk2_ardour/send_ui.cc b/gtk2_ardour/send_ui.cc index 8faa315848..7dda653894 100644 --- a/gtk2_ardour/send_ui.cc +++ b/gtk2_ardour/send_ui.cc @@ -32,8 +32,8 @@ using namespace PBD; SendUI::SendUI (boost::shared_ptr<Send> s, Session& se) : _send (s), _session (se), - gpm (s, se), - panners (s, se) + gpm (s->io(), se), + panners (s->io(), se) { hbox.pack_start (gpm, true, true); set_name ("SendUIFrame"); @@ -44,7 +44,7 @@ SendUI::SendUI (boost::shared_ptr<Send> s, Session& se) vbox.pack_start (hbox, false, false, false); vbox.pack_start (panners, false,false); - io = new IOSelector (se, s, false); + io = new IOSelector (se, s->io(), false); pack_start (vbox, false, false); @@ -54,8 +54,8 @@ SendUI::SendUI (boost::shared_ptr<Send> s, Session& se) _send->set_metering (true); - _send->output_changed.connect (mem_fun (*this, &SendUI::ins_changed)); - _send->output_changed.connect (mem_fun (*this, &SendUI::outs_changed)); + _send->io()->output_changed.connect (mem_fun (*this, &SendUI::ins_changed)); + _send->io()->output_changed.connect (mem_fun (*this, &SendUI::outs_changed)); panners.set_width (Wide); panners.setup_pan (); |