13
0

OSC: Select should be able to rename as well.

This commit is contained in:
Len Ovens 2018-02-16 22:54:16 -08:00
parent dffecfa4c6
commit a29d3c1b31
2 changed files with 23 additions and 0 deletions

View File

@ -568,6 +568,7 @@ OSC::register_callbacks()
// Controls for the Selected strip // Controls for the Selected strip
REGISTER_CALLBACK (serv, X_("/select/recenable"), "i", sel_recenable); REGISTER_CALLBACK (serv, X_("/select/recenable"), "i", sel_recenable);
REGISTER_CALLBACK (serv, X_("/select/record_safe"), "i", sel_recsafe); REGISTER_CALLBACK (serv, X_("/select/record_safe"), "i", sel_recsafe);
REGISTER_CALLBACK (serv, X_("/select/name"), "s", sel_rename);
REGISTER_CALLBACK (serv, X_("/select/group"), "s", sel_group); REGISTER_CALLBACK (serv, X_("/select/group"), "s", sel_group);
REGISTER_CALLBACK (serv, X_("/select/mute"), "i", sel_mute); REGISTER_CALLBACK (serv, X_("/select/mute"), "i", sel_mute);
REGISTER_CALLBACK (serv, X_("/select/solo"), "i", sel_solo); REGISTER_CALLBACK (serv, X_("/select/solo"), "i", sel_solo);
@ -3704,6 +3705,26 @@ OSC::route_rename (int ssid, char *newname, lo_message msg) {
return 0; return 0;
} }
int
OSC::sel_rename (char *newname, lo_message msg) {
if (!session) {
return -1;
}
OSCSurface *sur = get_surface(get_address (msg));
boost::shared_ptr<Stripable> s;
if (sur->expand_enable) {
s = get_strip (sur->expand, get_address (msg));
} else {
s = _select;
}
if (s) {
s->set_name(std::string(newname));
}
return 0;
}
int int
OSC::strip_group (int ssid, char *group, lo_message msg) { OSC::strip_group (int ssid, char *group, lo_message msg) {
if (!session) { if (!session) {

View File

@ -494,6 +494,7 @@ class OSC : public ARDOUR::ControlProtocol, public AbstractUI<OSCUIRequest>
PATH_CALLBACK1_MSG(bank_delta,f); PATH_CALLBACK1_MSG(bank_delta,f);
PATH_CALLBACK1_MSG(use_group,f); PATH_CALLBACK1_MSG(use_group,f);
PATH_CALLBACK1_MSG_s(sel_group,s); PATH_CALLBACK1_MSG_s(sel_group,s);
PATH_CALLBACK1_MSG_s(sel_rename,s);
PATH_CALLBACK1_MSG(sel_recenable,i); PATH_CALLBACK1_MSG(sel_recenable,i);
PATH_CALLBACK1_MSG(sel_recsafe,i); PATH_CALLBACK1_MSG(sel_recsafe,i);
PATH_CALLBACK1_MSG(sel_mute,i); PATH_CALLBACK1_MSG(sel_mute,i);
@ -716,6 +717,7 @@ class OSC : public ARDOUR::ControlProtocol, public AbstractUI<OSCUIRequest>
int monitor_set_dim (uint32_t state); int monitor_set_dim (uint32_t state);
int monitor_set_mono (uint32_t state); int monitor_set_mono (uint32_t state);
int sel_group (char *g, lo_message msg); int sel_group (char *g, lo_message msg);
int sel_rename (char *n, lo_message msg);
int sel_recenable (uint32_t state, lo_message msg); int sel_recenable (uint32_t state, lo_message msg);
int sel_recsafe (uint32_t state, lo_message msg); int sel_recsafe (uint32_t state, lo_message msg);
int sel_mute (uint32_t state, lo_message msg); int sel_mute (uint32_t state, lo_message msg);