summaryrefslogtreecommitdiff
path: root/libs/surfaces/osc
diff options
context:
space:
mode:
authorLen Ovens <len@ovenwerks.net>2017-05-09 12:40:20 -0700
committerLen Ovens <len@ovenwerks.net>2017-05-09 12:40:20 -0700
commitc3c7dfd3e822aebb85372565d324fa27c452c86f (patch)
tree89183fe7270708ae1f08ccd7c497687bb30f48c8 /libs/surfaces/osc
parent155401b8754b9bcdb9d5fa95817d65cb00af109e (diff)
OSC: Add Automation mode feedback to /strip
Diffstat (limited to 'libs/surfaces/osc')
-rw-r--r--libs/surfaces/osc/osc_route_observer.cc32
-rw-r--r--libs/surfaces/osc/osc_route_observer.h1
2 files changed, 29 insertions, 4 deletions
diff --git a/libs/surfaces/osc/osc_route_observer.cc b/libs/surfaces/osc/osc_route_observer.cc
index dc7677c331..beea83f84f 100644
--- a/libs/surfaces/osc/osc_route_observer.cc
+++ b/libs/surfaces/osc/osc_route_observer.cc
@@ -75,12 +75,15 @@ OSCRouteObserver::OSCRouteObserver (boost::shared_ptr<Stripable> s, lo_address a
}
if (feedback[1]) { // level controls
+ boost::shared_ptr<GainControl> gain_cont = _strip->gain_control();
if (gainmode) {
- _strip->gain_control()->Changed.connect (strip_connections, MISSING_INVALIDATOR, bind (&OSCRouteObserver::send_gain_message, this, X_("/strip/fader"), _strip->gain_control()), OSC::instance());
- send_gain_message ("/strip/fader", _strip->gain_control());
+ gain_cont->alist()->automation_state_changed.connect (strip_connections, MISSING_INVALIDATOR, bind (&OSCRouteObserver::gain_automation, this, X_("/strip/fader")), OSC::instance());
+ gain_cont->Changed.connect (strip_connections, MISSING_INVALIDATOR, bind (&OSCRouteObserver::send_gain_message, this, X_("/strip/fader"), gain_cont), OSC::instance());
+ gain_automation ("/strip/fader");
} else {
- _strip->gain_control()->Changed.connect (strip_connections, MISSING_INVALIDATOR, bind (&OSCRouteObserver::send_gain_message, this, X_("/strip/gain"), _strip->gain_control()), OSC::instance());
- send_gain_message ("/strip/gain", _strip->gain_control());
+ gain_cont->alist()->automation_state_changed.connect (strip_connections, MISSING_INVALIDATOR, bind (&OSCRouteObserver::gain_automation, this, X_("/strip/gain")), OSC::instance());
+ gain_cont->Changed.connect (strip_connections, MISSING_INVALIDATOR, bind (&OSCRouteObserver::send_gain_message, this, X_("/strip/gain"), gain_cont), OSC::instance());
+ gain_automation ("/strip/gain");
}
boost::shared_ptr<Controllable> trim_controllable = boost::dynamic_pointer_cast<Controllable>(_strip->trim_control());
@@ -358,6 +361,27 @@ OSCRouteObserver::send_gain_message (string path, boost::shared_ptr<Controllable
lo_message_free (msg);
}
+void
+OSCRouteObserver::gain_automation (string path)
+{
+ lo_message msg = lo_message_new ();
+ string apath = string_compose ("%1/automation", path);
+
+ if (feedback[2]) {
+ apath = set_path (apath);
+ } else {
+ lo_message_add_int32 (msg, ssid);
+ }
+
+ boost::shared_ptr<GainControl> control = _strip->gain_control();
+ lo_message_add_float (msg, control->alist()->automation_state());
+ send_gain_message (path, control);
+ lo_send_message (addr, apath.c_str(), msg);
+ lo_message_free (msg);
+}
+
+
+
string
OSCRouteObserver::set_path (string path)
{
diff --git a/libs/surfaces/osc/osc_route_observer.h b/libs/surfaces/osc/osc_route_observer.h
index ef9bfb7ba2..a445334b3c 100644
--- a/libs/surfaces/osc/osc_route_observer.h
+++ b/libs/surfaces/osc/osc_route_observer.h
@@ -65,6 +65,7 @@ class OSCRouteObserver
void text_with_id (std::string path, uint32_t id, std::string name);
void send_monitor_status (boost::shared_ptr<PBD::Controllable> controllable);
void send_gain_message (std::string path, boost::shared_ptr<PBD::Controllable> controllable);
+ void gain_automation (std::string path);
void send_trim_message (std::string path, boost::shared_ptr<PBD::Controllable> controllable);
std::string set_path (std::string path);
void clear_strip (std::string path, float val);