diff options
author | Len Ovens <len@ovenwerks.net> | 2016-07-28 17:51:12 -0700 |
---|---|---|
committer | Len Ovens <len@ovenwerks.net> | 2016-07-28 17:51:12 -0700 |
commit | 3f88a660b38d0e1b87d43e399733fc20c72cd74a (patch) | |
tree | 80b042885a3ed6fe7dcdf52684f3d53ea83639f5 | |
parent | 67cbdc6cf2dd03303a9a257096da7708aad085cb (diff) |
OSC: make send enables work in MB
-rw-r--r-- | libs/surfaces/osc/osc_select_observer.cc | 35 | ||||
-rw-r--r-- | libs/surfaces/osc/osc_select_observer.h | 2 |
2 files changed, 31 insertions, 6 deletions
diff --git a/libs/surfaces/osc/osc_select_observer.cc b/libs/surfaces/osc/osc_select_observer.cc index 99c1c2c82f..300d37eaf6 100644 --- a/libs/surfaces/osc/osc_select_observer.cc +++ b/libs/surfaces/osc/osc_select_observer.cc @@ -145,8 +145,8 @@ OSCSelectObserver::OSCSelectObserver (boost::shared_ptr<Stripable> s, lo_address } // 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()); + _strip->comp_enable_controllable ()->Changed.connect (strip_connections, MISSING_INVALIDATOR, boost::bind (&OSCSelectObserver::enable_message, this, X_("/select/comp_enable"), _strip->comp_enable_controllable()), OSC::instance()); + enable_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()); @@ -243,8 +243,8 @@ OSCSelectObserver::send_init() } if (_strip->send_enable_controllable (nsends)) { - _strip->send_enable_controllable(nsends)->Changed.connect (strip_connections, MISSING_INVALIDATOR, boost::bind (&OSCSelectObserver::change_message_with_id, this, X_("/select/send_enable"), nsends + 1, _strip->send_enable_controllable(nsends)), OSC::instance()); - change_message_with_id ("/select/send_enable", nsends + 1, _strip->send_enable_controllable(nsends)); + _strip->send_enable_controllable(nsends)->Changed.connect (strip_connections, MISSING_INVALIDATOR, boost::bind (&OSCSelectObserver::enable_message_with_id, this, X_("/select/send_enable"), nsends + 1, _strip->send_enable_controllable(nsends)), OSC::instance()); + enable_message_with_id ("/select/send_enable", nsends + 1, _strip->send_enable_controllable(nsends)); sends = true; } else if (sends) { // not used by Ardour, just mixbus so in Ardour always true @@ -371,6 +371,18 @@ OSCSelectObserver::change_message (string path, boost::shared_ptr<Controllable> } void +OSCSelectObserver::enable_message (string path, boost::shared_ptr<Controllable> controllable) +{ + float val = controllable->get_value(); + if (val) { + clear_strip (path, 1); + } else { + clear_strip (path, 0); + } + +} + +void OSCSelectObserver::change_message_with_id (string path, uint32_t id, boost::shared_ptr<Controllable> controllable) { lo_message msg = lo_message_new (); @@ -388,6 +400,17 @@ OSCSelectObserver::change_message_with_id (string path, uint32_t id, boost::shar } void +OSCSelectObserver::enable_message_with_id (string path, uint32_t id, boost::shared_ptr<Controllable> controllable) +{ + float val = controllable->get_value(); + if (val) { + clear_strip_with_id (path, id, 1); + } else { + clear_strip_with_id (path, id, 0); + } +} + +void OSCSelectObserver::text_message (string path, std::string text) { lo_message msg = lo_message_new (); @@ -522,8 +545,8 @@ OSCSelectObserver::eq_init() change_message ("/select/eq_hpf", _strip->eq_hpf_controllable()); } if (_strip->eq_enable_controllable ()) { - _strip->eq_enable_controllable ()->Changed.connect (eq_connections, MISSING_INVALIDATOR, boost::bind (&OSCSelectObserver::change_message, this, X_("/select/eq_enable"), _strip->eq_enable_controllable()), OSC::instance()); - change_message ("/select/eq_enable", _strip->eq_enable_controllable()); + _strip->eq_enable_controllable ()->Changed.connect (eq_connections, MISSING_INVALIDATOR, boost::bind (&OSCSelectObserver::enable_message, this, X_("/select/eq_enable"), _strip->eq_enable_controllable()), OSC::instance()); + enable_message ("/select/eq_enable", _strip->eq_enable_controllable()); } uint32_t eq_bands = _strip->eq_band_cnt (); diff --git a/libs/surfaces/osc/osc_select_observer.h b/libs/surfaces/osc/osc_select_observer.h index d751ec2b3e..7d4f2f00d7 100644 --- a/libs/surfaces/osc/osc_select_observer.h +++ b/libs/surfaces/osc/osc_select_observer.h @@ -59,8 +59,10 @@ class OSCSelectObserver void name_changed (const PBD::PropertyChange& what_changed); void change_message (std::string path, boost::shared_ptr<PBD::Controllable> controllable); + void enable_message (std::string path, boost::shared_ptr<PBD::Controllable> controllable); void comp_mode (void); void change_message_with_id (std::string path, uint32_t id, boost::shared_ptr<PBD::Controllable> controllable); + void enable_message_with_id (std::string path, uint32_t id, boost::shared_ptr<PBD::Controllable> controllable); void text_message (std::string path, std::string text); void text_with_id (std::string path, uint32_t id, std::string name); void monitor_status (boost::shared_ptr<PBD::Controllable> controllable); |