diff options
author | Len Ovens <len@ovenwerks.net> | 2016-07-04 20:07:38 -0700 |
---|---|---|
committer | Len Ovens <len@ovenwerks.net> | 2016-07-04 20:07:38 -0700 |
commit | fef79d46bb54c0e9179e54a0977eeb602e4b2db3 (patch) | |
tree | 73a16459a46a7f858b7a9fa4f86b43e62a878493 /libs | |
parent | bc1f571954c1ef219064c08169d5c2d6dc113b81 (diff) |
OSC: Signal for editor mixer change. (Selected or not)
Diffstat (limited to 'libs')
-rw-r--r-- | libs/ardour/ardour/session.h | 3 | ||||
-rw-r--r-- | libs/ardour/session.cc | 1 | ||||
-rw-r--r-- | libs/surfaces/osc/osc.cc | 26 | ||||
-rw-r--r-- | libs/surfaces/osc/osc.h | 2 |
4 files changed, 9 insertions, 23 deletions
diff --git a/libs/ardour/ardour/session.h b/libs/ardour/ardour/session.h index 61c575e0b2..febfc2eb2f 100644 --- a/libs/ardour/ardour/session.h +++ b/libs/ardour/ardour/session.h @@ -823,7 +823,8 @@ class LIBARDOUR_API Session : public PBD::StatefulDestructible, public PBD::Scop boost::shared_ptr<Route> monitor_out() const { return _monitor_out; } boost::shared_ptr<Route> master_out() const { return _master_out; } boost::weak_ptr<Route> get_editor_mixer() const { return _editor_mixer; } - void set_editor_mixer (boost::weak_ptr<Route> r) { _editor_mixer = r; } + void set_editor_mixer (boost::weak_ptr<Route> r) { _editor_mixer = r; EditorMixerChanged(); } + static PBD::Signal0<void> EditorMixerChanged; void globally_add_internal_sends (boost::shared_ptr<Route> dest, Placement p, bool); void globally_set_send_gains_from_track (boost::shared_ptr<Route> dest); diff --git a/libs/ardour/session.cc b/libs/ardour/session.cc index 94051b0f9d..33d8b08832 100644 --- a/libs/ardour/session.cc +++ b/libs/ardour/session.cc @@ -148,6 +148,7 @@ PBD::Signal0<void> Session::Quit; PBD::Signal0<void> Session::FeedbackDetected; PBD::Signal0<void> Session::SuccessfulGraphSort; PBD::Signal2<void,std::string,std::string> Session::VersionMismatch; +PBD::Signal0<void> Session::EditorMixerChanged; const framecnt_t Session::bounce_chunk_size = 8192; static void clean_up_session_event (SessionEvent* ev) { delete ev; } diff --git a/libs/surfaces/osc/osc.cc b/libs/surfaces/osc/osc.cc index 98bf0505f9..f2fd8af867 100644 --- a/libs/surfaces/osc/osc.cc +++ b/libs/surfaces/osc/osc.cc @@ -249,8 +249,8 @@ OSC::start () periodic_connection = periodic_timeout->connect (sigc::mem_fun (*this, &OSC::periodic)); periodic_timeout->attach (main_loop()->get_context()); - // catch GUI select changes for GUI_select mode - StripableSelectionChanged.connect (session_connections, MISSING_INVALIDATOR, boost::bind (&OSC::gui_selection_changed, this, _1), this); + // catch current editor mixer changes for GUI_select mode + session->EditorMixerChanged.connect (session_connections, MISSING_INVALIDATOR, boost::bind (&OSC::gui_selection_changed, this), this); // catch track reordering // receive routes added @@ -1226,20 +1226,7 @@ OSC::get_surface (lo_address addr) // if we do this when OSC is started we get the wrong stripable // we don't need this until we actually have a surface to deal with if (!_select) { - // guess at which stripable is the current editor mixerstrip - // right now just choose the first one we find, may be the wrong one - // hopefully we will have access to session->current_strip at some point - StripableList stripables; - - session->get_stripables (stripables); - - for (StripableList::iterator it = stripables.begin(); it != stripables.end(); ++it) { - boost::shared_ptr<Stripable> s = *it; - if (s->is_selected()) { - _select = s; - break; - } - } + gui_selection_changed(); } // No surface create one with default values @@ -2611,13 +2598,11 @@ OSC::route_plugin_parameter_print (int ssid, int piid, int par, lo_message msg) } void -OSC::gui_selection_changed (StripableNotificationListPtr stripables) +OSC::gui_selection_changed () { boost::shared_ptr<Stripable> strip; - if (!stripables->empty()) { - strip = boost::dynamic_pointer_cast<Stripable>(session->get_editor_mixer().lock()); - } + strip = boost::dynamic_pointer_cast<Stripable>(session->get_editor_mixer().lock()); if (strip) { _select = strip; for (uint32_t it = 0; it < _surface.size(); ++it) { @@ -2628,7 +2613,6 @@ OSC::gui_selection_changed (StripableNotificationListPtr stripables) } } } - } // timer callbacks diff --git a/libs/surfaces/osc/osc.h b/libs/surfaces/osc/osc.h index d828dffae7..6a38d32a31 100644 --- a/libs/surfaces/osc/osc.h +++ b/libs/surfaces/osc/osc.h @@ -486,7 +486,7 @@ class OSC : public ARDOUR::ControlProtocol, public AbstractUI<OSCUIRequest> void end_listen (boost::shared_ptr<ARDOUR::Stripable>, lo_address); void drop_route (boost::weak_ptr<ARDOUR::Stripable>); void route_lost (boost::weak_ptr<ARDOUR::Stripable>); - void gui_selection_changed (ARDOUR::StripableNotificationListPtr stripables); + void gui_selection_changed (void); void route_name_changed (const PBD::PropertyChange&, boost::weak_ptr<ARDOUR::Route> r, lo_address addr); void recalcbanks (); |