summaryrefslogtreecommitdiff
path: root/libs
diff options
context:
space:
mode:
authorLen Ovens <len@ovenwerks.net>2018-02-17 07:26:23 -0800
committerLen Ovens <len@ovenwerks.net>2018-02-18 09:16:16 -0800
commit08632d623e2a9bf515520ed6450ad9f86ed9b3d8 (patch)
tree2404e0f8fa3633c071b48422c2b9eb4c78ce1cf4 /libs
parent66fa0778abcb08026a9f0eabfecbe44ae5dbdd76 (diff)
OSC: select comment should feedback when comment changed
Diffstat (limited to 'libs')
-rw-r--r--libs/surfaces/osc/osc.cc1
-rw-r--r--libs/surfaces/osc/osc_select_observer.cc20
-rw-r--r--libs/surfaces/osc/osc_select_observer.h1
3 files changed, 17 insertions, 5 deletions
diff --git a/libs/surfaces/osc/osc.cc b/libs/surfaces/osc/osc.cc
index fe4b7c45ba..332ea54067 100644
--- a/libs/surfaces/osc/osc.cc
+++ b/libs/surfaces/osc/osc.cc
@@ -3812,7 +3812,6 @@ OSC::strip_select_group (boost::shared_ptr<Stripable> s, char *group)
rg->set_name (grp);
}
} else {
- // nothing to change
return 0;
}
} else {
diff --git a/libs/surfaces/osc/osc_select_observer.cc b/libs/surfaces/osc/osc_select_observer.cc
index 724bf818a8..5b68f08241 100644
--- a/libs/surfaces/osc/osc_select_observer.cc
+++ b/libs/surfaces/osc/osc_select_observer.cc
@@ -135,8 +135,13 @@ OSCSelectObserver::refresh_strip (boost::shared_ptr<ARDOUR::Stripable> new_strip
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 ();
+ if (rt) {
+ rt->route_group_changed.connect (strip_connections, MISSING_INVALIDATOR, boost::bind (&OSCSelectObserver::group_name, this), OSC::instance());
+ group_name ();
+
+ rt->comment_changed.connect (strip_connections, MISSING_INVALIDATOR, boost::bind (&OSCSelectObserver::comment_changed, this), OSC::instance());
+ comment_changed ();
+ }
_strip->presentation_info().PropertyChanged.connect (strip_connections, MISSING_INVALIDATOR, boost::bind (&OSCSelectObserver::pi_changed, this, _1), OSC::instance());
_osc.float_message (X_("/select/hide"), _strip->is_hidden (), addr);
@@ -639,8 +644,6 @@ OSCSelectObserver::name_changed (const PBD::PropertyChange& what_changed)
_osc.text_message (X_("/select/name"), _strip->name(), addr);
boost::shared_ptr<Route> route = boost::dynamic_pointer_cast<Route> (_strip);
if (route) {
- //spit out the comment at the same time
- _osc.text_message (X_("/select/comment"), route->comment(), addr);
// lets tell the surface how many inputs this strip has
_osc.float_message (X_("/select/n_inputs"), (float) route->n_inputs().n_total(), addr);
// lets tell the surface how many outputs this strip has
@@ -662,6 +665,15 @@ OSCSelectObserver::group_name ()
}
void
+OSCSelectObserver::comment_changed ()
+{
+ boost::shared_ptr<Route> rt = boost::dynamic_pointer_cast<Route> (_strip);
+ if (rt) {
+ _osc.text_message (X_("/select/comment"), rt->comment(), addr);
+ }
+}
+
+void
OSCSelectObserver::pi_changed (PBD::PropertyChange const& what_changed)
{
_osc.float_message (X_("/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 34de6be319..b12d707d83 100644
--- a/libs/surfaces/osc/osc_select_observer.h
+++ b/libs/surfaces/osc/osc_select_observer.h
@@ -97,6 +97,7 @@ class OSCSelectObserver
void name_changed (const PBD::PropertyChange& what_changed);
void group_name ();
+ void comment_changed ();
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);