From 08632d623e2a9bf515520ed6450ad9f86ed9b3d8 Mon Sep 17 00:00:00 2001 From: Len Ovens Date: Sat, 17 Feb 2018 07:26:23 -0800 Subject: OSC: select comment should feedback when comment changed --- libs/surfaces/osc/osc.cc | 1 - libs/surfaces/osc/osc_select_observer.cc | 20 ++++++++++++++++---- libs/surfaces/osc/osc_select_observer.h | 1 + 3 files changed, 17 insertions(+), 5 deletions(-) (limited to 'libs') 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 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 new_strip name_changed (ARDOUR::Properties::name); boost::shared_ptr rt = boost::dynamic_pointer_cast (_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 = boost::dynamic_pointer_cast (_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 @@ -661,6 +664,15 @@ OSCSelectObserver::group_name () } } +void +OSCSelectObserver::comment_changed () +{ + boost::shared_ptr rt = boost::dynamic_pointer_cast (_strip); + if (rt) { + _osc.text_message (X_("/select/comment"), rt->comment(), addr); + } +} + void OSCSelectObserver::pi_changed (PBD::PropertyChange const& what_changed) { 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 controllable); void enable_message (std::string path, boost::shared_ptr controllable); -- cgit v1.2.3