diff options
author | Len Ovens <len@ovenwerks.net> | 2018-01-31 11:47:03 -0800 |
---|---|---|
committer | Len Ovens <len@ovenwerks.net> | 2018-01-31 11:48:10 -0800 |
commit | f549fcfb7663ec0c37b1e176a742fbe6616fdab3 (patch) | |
tree | 46e308632516708933bd58b4e53ec3bb3fb70a41 /libs | |
parent | df27c986ec458e9d78cf4a625fe17f0ce6f0cf0c (diff) |
OSC: Add group name feedback to strips
Diffstat (limited to 'libs')
-rw-r--r-- | libs/surfaces/osc/osc_route_observer.cc | 20 | ||||
-rw-r--r-- | libs/surfaces/osc/osc_route_observer.h | 1 | ||||
-rw-r--r-- | libs/surfaces/osc/osc_select_observer.cc | 19 | ||||
-rw-r--r-- | libs/surfaces/osc/osc_select_observer.h | 1 |
4 files changed, 41 insertions, 0 deletions
diff --git a/libs/surfaces/osc/osc_route_observer.cc b/libs/surfaces/osc/osc_route_observer.cc index ea7be9041e..fec639ea01 100644 --- a/libs/surfaces/osc/osc_route_observer.cc +++ b/libs/surfaces/osc/osc_route_observer.cc @@ -28,6 +28,8 @@ #include "ardour/monitor_control.h" #include "ardour/dB.h" #include "ardour/meter.h" +#include "ardour/route.h" +#include "ardour/route_group.h" #include "ardour/solo_isolate_control.h" #include "osc.h" @@ -129,6 +131,10 @@ OSCRouteObserver::refresh_strip (boost::shared_ptr<ARDOUR::Stripable> new_strip, _strip->PropertyChanged.connect (strip_connections, MISSING_INVALIDATOR, boost::bind (&OSCRouteObserver::name_changed, this, boost::lambda::_1), OSC::instance()); name_changed (ARDOUR::Properties::name); + boost::shared_ptr<Route> rt = boost::dynamic_pointer_cast<Route> (_strip); + rt->route_group_changed.connect (strip_connections, MISSING_INVALIDATOR, boost::bind (&OSCRouteObserver::group_name, this), OSC::instance()); + group_name (); + _strip->presentation_info().PropertyChanged.connect (strip_connections, MISSING_INVALIDATOR, boost::bind (&OSCRouteObserver::pi_changed, this, _1), OSC::instance()); _osc.int_message_with_id ("/strip/hide", ssid, _strip->is_hidden (), in_line, addr); @@ -244,6 +250,7 @@ OSCRouteObserver::clear_strip () _osc.float_message_with_id ("/strip/expand", ssid, 0, in_line, addr); if (feedback[0]) { // buttons are separate feedback _osc.text_message_with_id ("/strip/name", ssid, " ", in_line, addr); + _osc.text_message_with_id ("/strip/group/name", ssid, " ", in_line, addr); _osc.float_message_with_id ("/strip/mute", ssid, 0, in_line, addr); _osc.float_message_with_id ("/strip/solo", ssid, 0, in_line, addr); _osc.float_message_with_id ("/strip/recenable", ssid, 0, in_line, addr); @@ -348,6 +355,19 @@ OSCRouteObserver::name_changed (const PBD::PropertyChange& what_changed) } void +OSCRouteObserver::group_name () +{ + boost::shared_ptr<Route> rt = boost::dynamic_pointer_cast<Route> (_strip); + + RouteGroup *rg = rt->route_group(); + if (rg) { + _osc.text_message_with_id ("/strip/group/name", ssid, rg->name(), in_line, addr); + } else { + _osc.text_message_with_id ("/strip/group/name", ssid, " ", in_line, addr); + } +} + +void OSCRouteObserver::pi_changed (PBD::PropertyChange const& what_changed) { _osc.int_message_with_id ("/strip/hide", ssid, _strip->is_hidden (), in_line, addr); diff --git a/libs/surfaces/osc/osc_route_observer.h b/libs/surfaces/osc/osc_route_observer.h index 70fc3cc6c0..2fb040bedb 100644 --- a/libs/surfaces/osc/osc_route_observer.h +++ b/libs/surfaces/osc/osc_route_observer.h @@ -73,6 +73,7 @@ class OSCRouteObserver void name_changed (const PBD::PropertyChange& what_changed); + void group_name (); void pi_changed (PBD::PropertyChange const&); void send_change_message (std::string path, boost::shared_ptr<PBD::Controllable> controllable); void send_monitor_status (boost::shared_ptr<PBD::Controllable> controllable); diff --git a/libs/surfaces/osc/osc_select_observer.cc b/libs/surfaces/osc/osc_select_observer.cc index d08c454b26..fd95522738 100644 --- a/libs/surfaces/osc/osc_select_observer.cc +++ b/libs/surfaces/osc/osc_select_observer.cc @@ -31,6 +31,7 @@ #include "ardour/solo_isolate_control.h" #include "ardour/solo_safe_control.h" #include "ardour/route.h" +#include "ardour/route_group.h" #include "ardour/send.h" #include "ardour/plugin.h" #include "ardour/plugin_insert.h" @@ -133,6 +134,10 @@ OSCSelectObserver::refresh_strip (boost::shared_ptr<ARDOUR::Stripable> new_strip _strip->PropertyChanged.connect (strip_connections, MISSING_INVALIDATOR, boost::bind (&OSCSelectObserver::name_changed, this, boost::lambda::_1), OSC::instance()); name_changed (ARDOUR::Properties::name); + boost::shared_ptr<Route> rt = boost::dynamic_pointer_cast<Route> (_strip); + rt->route_group_changed.connect (strip_connections, MISSING_INVALIDATOR, boost::bind (&OSCSelectObserver::group_name, this), OSC::instance()); + group_name (); + _strip->presentation_info().PropertyChanged.connect (strip_connections, MISSING_INVALIDATOR, boost::bind (&OSCSelectObserver::pi_changed, this, _1), OSC::instance()); _osc.float_message ("/select/hide", _strip->is_hidden (), addr); @@ -271,6 +276,7 @@ OSCSelectObserver::clear_observer () // all strip buttons should be off and faders 0 and etc. _osc.float_message ("/select/expand", 0, addr); _osc.text_message ("/select/name", " ", addr); + _osc.text_message ("/select/group/name", " ", addr); _osc.text_message ("/select/comment", " ", addr); _osc.float_message ("/select/mute", 0, addr); _osc.float_message ("/select/solo", 0, addr); @@ -643,6 +649,19 @@ OSCSelectObserver::name_changed (const PBD::PropertyChange& what_changed) } void +OSCSelectObserver::group_name () +{ + boost::shared_ptr<Route> rt = boost::dynamic_pointer_cast<Route> (_strip); + + RouteGroup *rg = rt->route_group(); + if (rg) { + _osc.text_message ("/select/group/name", rg->name(), addr); + } else { + _osc.text_message ("/select/group/name", " ", addr); + } +} + +void OSCSelectObserver::pi_changed (PBD::PropertyChange const& what_changed) { _osc.float_message ("/select/hide", _strip->is_hidden (), addr); diff --git a/libs/surfaces/osc/osc_select_observer.h b/libs/surfaces/osc/osc_select_observer.h index 1339a3484b..34de6be319 100644 --- a/libs/surfaces/osc/osc_select_observer.h +++ b/libs/surfaces/osc/osc_select_observer.h @@ -96,6 +96,7 @@ class OSCSelectObserver uint32_t _expand; void name_changed (const PBD::PropertyChange& what_changed); + void group_name (); void pi_changed (PBD::PropertyChange const&); void change_message (std::string path, boost::shared_ptr<PBD::Controllable> controllable); void enable_message (std::string path, boost::shared_ptr<PBD::Controllable> controllable); |