OSC: Add /select/vca/toggle
This commit is contained in:
parent
57ce573796
commit
e34f006658
@ -2743,6 +2743,7 @@ OSC::parse_sel_vca (const char *path, const char* types, lo_arg **argv, int argc
|
|||||||
s = sur->select;
|
s = sur->select;
|
||||||
int ret = 1; /* unhandled */
|
int ret = 1; /* unhandled */
|
||||||
if (s) {
|
if (s) {
|
||||||
|
boost::shared_ptr<Slavable> slv = boost::dynamic_pointer_cast<Slavable> (s);
|
||||||
string svalue = "";
|
string svalue = "";
|
||||||
uint32_t ivalue = 1024;
|
uint32_t ivalue = 1024;
|
||||||
if (strcmp (path, X_("/select/vca")) == 0) {
|
if (strcmp (path, X_("/select/vca")) == 0) {
|
||||||
@ -2758,7 +2759,6 @@ OSC::parse_sel_vca (const char *path, const char* types, lo_arg **argv, int argc
|
|||||||
}
|
}
|
||||||
boost::shared_ptr<VCA> vca = get_vca_by_name (svalue);
|
boost::shared_ptr<VCA> vca = get_vca_by_name (svalue);
|
||||||
if (vca) {
|
if (vca) {
|
||||||
boost::shared_ptr<Slavable> slv = boost::dynamic_pointer_cast<Slavable> (s);
|
|
||||||
if (ivalue) {
|
if (ivalue) {
|
||||||
slv->assign (vca);
|
slv->assign (vca);
|
||||||
} else {
|
} else {
|
||||||
@ -2771,6 +2771,26 @@ OSC::parse_sel_vca (const char *path, const char* types, lo_arg **argv, int argc
|
|||||||
PBD::warning << "OSC: setting a vca needs both the vca name and it's state" << endmsg;
|
PBD::warning << "OSC: setting a vca needs both the vca name and it's state" << endmsg;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if (!strncmp (path, X_("/select/vca/toggle"), 18)) {
|
||||||
|
if (argc == 1) {
|
||||||
|
if (types[0] == 's') {
|
||||||
|
svalue = &argv[0]->s;
|
||||||
|
string v_name = svalue.substr (0, svalue.rfind (" ["));
|
||||||
|
boost::shared_ptr<VCA> vca = get_vca_by_name (v_name);
|
||||||
|
if (s->slaved_to (vca)) {
|
||||||
|
slv->unassign (vca);
|
||||||
|
} else {
|
||||||
|
slv->assign (vca);
|
||||||
|
}
|
||||||
|
ret = 0;
|
||||||
|
} else {
|
||||||
|
PBD::warning << "OSC: toggling needs the vca name as a string" << endmsg;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
PBD::warning << "OSC: toggling a vca needs the vca name" << endmsg;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
else if (!strncmp (path, X_("/select/vca/only"), 16)) {
|
else if (!strncmp (path, X_("/select/vca/only"), 16)) {
|
||||||
if (argc == 1) {
|
if (argc == 1) {
|
||||||
if (types[0] == 'f') {
|
if (types[0] == 'f') {
|
||||||
|
@ -1100,12 +1100,13 @@ OSCSelectObserver::slaved_changed (boost::shared_ptr<VCA> vca, bool state)
|
|||||||
// we only want VCAs
|
// we only want VCAs
|
||||||
boost::shared_ptr<VCA> v = boost::dynamic_pointer_cast<VCA> (s);
|
boost::shared_ptr<VCA> v = boost::dynamic_pointer_cast<VCA> (s);
|
||||||
if (v) {
|
if (v) {
|
||||||
lo_message_add_string (reply, v->name().c_str());
|
string name;
|
||||||
if (_strip->slaved_to (v)) {
|
if (_strip->slaved_to (v)) {
|
||||||
lo_message_add_int32 (reply, 1);
|
name = string_compose ("%1 [X]", v->name());
|
||||||
} else {
|
} else {
|
||||||
lo_message_add_int32 (reply, 0);
|
name = string_compose ("%1 [_]", v->name());
|
||||||
}
|
}
|
||||||
|
lo_message_add_string (reply, name.c_str());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
lo_send_message (addr, X_("/select/vcas"), reply);
|
lo_send_message (addr, X_("/select/vcas"), reply);
|
||||||
|
Loading…
Reference in New Issue
Block a user