OSC: set Automation mode for fader
This commit is contained in:
parent
f4d62a2a8e
commit
56ebea48c0
@ -863,8 +863,7 @@ OSC::catchall (const char *path, const char* types, lo_arg **argv, int argc, lo_
|
||||
len = strlen (path);
|
||||
|
||||
if (strstr (path, "/automation")) {
|
||||
set_automation (path, len, argv, argc, msg);
|
||||
ret = 0;
|
||||
ret = set_automation (path, len, argv, argc, msg);
|
||||
|
||||
} else
|
||||
if (len >= 17 && !strcmp (&path[len-15], "/#current_value")) {
|
||||
@ -2190,7 +2189,7 @@ OSC::set_automation (const char *path, size_t len, lo_arg **argv, int argc, lo_m
|
||||
{
|
||||
if (!session) return -1;
|
||||
|
||||
|
||||
int ret = 1;
|
||||
OSCSurface *sur = get_surface(get_address (msg));
|
||||
boost::shared_ptr<Stripable> strp = boost::shared_ptr<Stripable>();
|
||||
uint32_t ctr = 0;
|
||||
@ -2201,12 +2200,20 @@ OSC::set_automation (const char *path, size_t len, lo_arg **argv, int argc, lo_m
|
||||
// find ssid and stripable
|
||||
if (argc > 1) {
|
||||
strp = get_strip (argv[0]->i, get_address (msg));
|
||||
if (argv[1]->f) {
|
||||
aut = (int)argv[1]->f;
|
||||
} else {
|
||||
aut = argv[1]->i;
|
||||
}
|
||||
} else {
|
||||
uint32_t ssid = atoi (&(strrchr (path, '/' ))[1]);
|
||||
strp = get_strip (ssid, get_address (msg));
|
||||
if (argv[0]->f) {
|
||||
aut = (int)argv[0]->f;
|
||||
} else {
|
||||
aut = argv[0]->i;
|
||||
}
|
||||
}
|
||||
ctr = 7;
|
||||
} else if (!strncmp (path, "/select/", 8)) {
|
||||
if (sur->expand_enable && sur->expand) {
|
||||
@ -2214,21 +2221,59 @@ OSC::set_automation (const char *path, size_t len, lo_arg **argv, int argc, lo_m
|
||||
} else {
|
||||
strp = ControlProtocol::first_selected_stripable();
|
||||
}
|
||||
if (argv[0]->f) {
|
||||
aut = (int)argv[0]->f;
|
||||
} else {
|
||||
aut = argv[0]->i;
|
||||
}
|
||||
ctr = 8;
|
||||
} else {
|
||||
return -1;
|
||||
return ret;
|
||||
}
|
||||
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;
|
||||
if (strp->gain_control ()) {
|
||||
switch (aut) {
|
||||
case 0:
|
||||
strp->gain_control()->set_automation_state (ARDOUR::AutoState::Off);
|
||||
ret = 0;
|
||||
break;
|
||||
case 'm':
|
||||
strp->gain_control()->set_automation_state (ARDOUR::AutoState::Off);
|
||||
ret = 0;
|
||||
break;
|
||||
case 1:
|
||||
strp->gain_control()->set_automation_state (ARDOUR::AutoState::Play);
|
||||
ret = 0;
|
||||
break;
|
||||
case 'p':
|
||||
strp->gain_control()->set_automation_state (ARDOUR::AutoState::Play);
|
||||
ret = 0;
|
||||
break;
|
||||
case 2:
|
||||
strp->gain_control()->set_automation_state (ARDOUR::AutoState::Write);
|
||||
ret = 0;
|
||||
break;
|
||||
case 'w':
|
||||
strp->gain_control()->set_automation_state (ARDOUR::AutoState::Write);
|
||||
ret = 0;
|
||||
break;
|
||||
case 3:
|
||||
strp->gain_control()->set_automation_state (ARDOUR::AutoState::Touch);
|
||||
ret = 0;
|
||||
break;
|
||||
case 't':
|
||||
strp->gain_control()->set_automation_state (ARDOUR::AutoState::Touch);
|
||||
ret = 0;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return 0;
|
||||
return ret;
|
||||
}
|
||||
|
||||
int
|
||||
|
Loading…
Reference in New Issue
Block a user