From 295a7dfcf3acf664046ca5331555647ddd4b0dbc Mon Sep 17 00:00:00 2001 From: Len Ovens Date: Thu, 7 Jul 2016 11:36:31 -0700 Subject: [PATCH] OSC: Add feedback for known pan controls and known compressor controls --- libs/surfaces/osc/osc_select_observer.cc | 55 ++++++++++++++++++++++++ libs/surfaces/osc/osc_select_observer.h | 1 + 2 files changed, 56 insertions(+) diff --git a/libs/surfaces/osc/osc_select_observer.cc b/libs/surfaces/osc/osc_select_observer.cc index 682391e1fb..037030402f 100644 --- a/libs/surfaces/osc/osc_select_observer.cc +++ b/libs/surfaces/osc/osc_select_observer.cc @@ -128,6 +128,50 @@ OSCSelectObserver::OSCSelectObserver (boost::shared_ptr s, lo_address } } + if (feedback[13]) { // Well known controls + // Rest of possible pan controls... Untested because I can't find a way to get them in the GUI :) + if (_strip->pan_elevation_control ()) { + _strip->pan_elevation_control()->Changed.connect (strip_connections, MISSING_INVALIDATOR, boost::bind (&OSCSelectObserver::change_message, this, X_("/select/pan_elevation_position"), _strip->pan_elevation_control()), OSC::instance()); + change_message ("/select/pan_elevation_position", _strip->pan_elevation_control()); + } + if (_strip->pan_frontback_control ()) { + _strip->pan_frontback_control()->Changed.connect (strip_connections, MISSING_INVALIDATOR, boost::bind (&OSCSelectObserver::change_message, this, X_("/select/pan_frontback_position"), _strip->pan_frontback_control()), OSC::instance()); + change_message ("/select/pan_frontback_position", _strip->pan_frontback_control()); + } + if (_strip->pan_lfe_control ()) { + _strip->pan_lfe_control()->Changed.connect (strip_connections, MISSING_INVALIDATOR, boost::bind (&OSCSelectObserver::change_message, this, X_("/select/pan_lfe_position"), _strip->pan_lfe_control()), OSC::instance()); + change_message ("/select/pan_lfe_position", _strip->pan_lfe_control()); + } + // Compressor + if (_strip->comp_enable_controllable ()) { + _strip->comp_enable_controllable ()->Changed.connect (strip_connections, MISSING_INVALIDATOR, boost::bind (&OSCSelectObserver::change_message, this, X_("/select/comp_enable"), _strip->comp_enable_controllable()), OSC::instance()); + change_message ("/select/comp_enable", _strip->comp_enable_controllable()); + } + if (_strip->comp_threshold_controllable ()) { + _strip->comp_threshold_controllable ()->Changed.connect (strip_connections, MISSING_INVALIDATOR, boost::bind (&OSCSelectObserver::change_message, this, X_("/select/comp_threshold"), _strip->comp_threshold_controllable()), OSC::instance()); + change_message ("/select/comp_threshold", _strip->comp_threshold_controllable()); + } + if (_strip->comp_speed_controllable ()) { + _strip->comp_speed_controllable ()->Changed.connect (strip_connections, MISSING_INVALIDATOR, boost::bind (&OSCSelectObserver::change_message, this, X_("/select/comp_speed"), _strip->comp_speed_controllable()), OSC::instance()); + change_message ("/select/comp_speed", _strip->comp_speed_controllable()); + } + if (_strip->comp_mode_controllable ()) { + _strip->comp_mode_controllable ()->Changed.connect (strip_connections, MISSING_INVALIDATOR, boost::bind (&OSCSelectObserver::change_message, this, X_("/select/comp_mode"), _strip->comp_mode_controllable()), OSC::instance()); + change_message ("/select/comp_mode", _strip->comp_mode_controllable()); + text_message ("/select/comp_mode_name", _strip->comp_mode_name(_strip->comp_mode_controllable()->get_value())); + text_message ("/select/comp_speed_name", _strip->comp_speed_name(_strip->comp_mode_controllable()->get_value())); + } + if (_strip->comp_makeup_controllable ()) { + _strip->comp_makeup_controllable ()->Changed.connect (strip_connections, MISSING_INVALIDATOR, boost::bind (&OSCSelectObserver::change_message, this, X_("/select/comp_makeup"), _strip->comp_makeup_controllable()), OSC::instance()); + change_message ("/select/comp_makeup", _strip->comp_makeup_controllable()); + } + if (_strip->comp_redux_controllable ()) { + _strip->comp_redux_controllable ()->Changed.connect (strip_connections, MISSING_INVALIDATOR, boost::bind (&OSCSelectObserver::change_message, this, X_("/select/comp_redux"), _strip->comp_redux_controllable()), OSC::instance()); + change_message ("/select/comp_redux", _strip->comp_redux_controllable()); + } + + } + tick(); } @@ -383,6 +427,17 @@ OSCSelectObserver::change_message (string path, boost::shared_ptr lo_message_free (msg); } +void +OSCSelectObserver::text_message (string path, std::string text) +{ + lo_message msg = lo_message_new (); + + lo_message_add_string (msg, text.c_str()); + + lo_send_message (addr, path.c_str(), msg); + lo_message_free (msg); +} + void OSCSelectObserver::monitor_status (boost::shared_ptr controllable) { diff --git a/libs/surfaces/osc/osc_select_observer.h b/libs/surfaces/osc/osc_select_observer.h index dd79405a56..448f9cf4da 100644 --- a/libs/surfaces/osc/osc_select_observer.h +++ b/libs/surfaces/osc/osc_select_observer.h @@ -58,6 +58,7 @@ class OSCSelectObserver void name_changed (const PBD::PropertyChange& what_changed); void change_message (std::string path, boost::shared_ptr controllable); + void text_message (std::string path, std::string text); void monitor_status (boost::shared_ptr controllable); void gain_message (std::string path, boost::shared_ptr controllable); void trim_message (std::string path, boost::shared_ptr controllable);