summaryrefslogtreecommitdiff
path: root/libs/surfaces/osc/osc.cc
diff options
context:
space:
mode:
authorLen Ovens <len@ovenwerks.net>2017-05-08 14:08:10 -0700
committerLen Ovens <len@ovenwerks.net>2017-05-09 07:55:32 -0700
commitf4d62a2a8e62fa1ddcd901dcca9cd0f2e81832fe (patch)
treed469fbb2892bb518eb0c58e19d15a5ed1db854f5 /libs/surfaces/osc/osc.cc
parent9b4d58393dd0d698cd4280bb4a1a17ad2a4de98d (diff)
OSC: automation mode get strip (step 2)
Diffstat (limited to 'libs/surfaces/osc/osc.cc')
-rw-r--r--libs/surfaces/osc/osc.cc39
1 files changed, 37 insertions, 2 deletions
diff --git a/libs/surfaces/osc/osc.cc b/libs/surfaces/osc/osc.cc
index 93571bb837..f17e2da848 100644
--- a/libs/surfaces/osc/osc.cc
+++ b/libs/surfaces/osc/osc.cc
@@ -862,7 +862,7 @@ OSC::catchall (const char *path, const char* types, lo_arg **argv, int argc, lo_
len = strlen (path);
- if (len >= 13 && !strcmp (&path[len-15], "/automation")) {
+ if (strstr (path, "/automation")) {
set_automation (path, len, argv, argc, msg);
ret = 0;
@@ -2189,9 +2189,44 @@ int
OSC::set_automation (const char *path, size_t len, lo_arg **argv, int argc, lo_message msg)
{
if (!session) return -1;
- //parse path first to find inlined parameter (or not)
+ OSCSurface *sur = get_surface(get_address (msg));
+ boost::shared_ptr<Stripable> strp = boost::shared_ptr<Stripable>();
+ uint32_t ctr = 0;
+ uint32_t aut = 0;
+
+ //parse path first to find stripable
+ if (!strncmp (path, "/strip/", 7)) {
+ // find ssid and stripable
+ if (argc > 1) {
+ strp = get_strip (argv[0]->i, get_address (msg));
+ aut = argv[1]->i;
+ } else {
+ uint32_t ssid = atoi (&(strrchr (path, '/' ))[1]);
+ strp = get_strip (ssid, get_address (msg));
+ aut = argv[0]->i;
+ }
+ ctr = 7;
+ } else if (!strncmp (path, "/select/", 8)) {
+ if (sur->expand_enable && sur->expand) {
+ strp = get_strip (sur->expand, get_address (msg));
+ } else {
+ strp = ControlProtocol::first_selected_stripable();
+ }
+ aut = argv[0]->i;
+ ctr = 8;
+ } else {
+ return -1;
+ }
+ if (strp) {
+ if ((!strncmp (&path[ctr], "fader", 5)) || (!strncmp (&path[ctr], "gain", 4))) {
+ std::cout << "Automation " << strp->name() << "'s gain" << " in mode: " << aut << "\n";
+ } else {
+ return -1;
+ }
+
+ }
return 0;
}