mirror of
https://github.com/brunoherbelin/vimix.git
synced 2025-12-21 15:20:00 +01:00
OSC source target by ID with # prefix
Targetting source by id should be with '#' + the number (e.g. /vimix/#2/alpha). For backward compatibility the '#' is still optional.
This commit is contained in:
@@ -191,7 +191,7 @@ void Control::RequestListener::ProcessMessage( const osc::ReceivedMessage& m,
|
|||||||
else if ( std::regex_match(target, osc_sourceid_reg_exp) )
|
else if ( std::regex_match(target, osc_sourceid_reg_exp) )
|
||||||
{
|
{
|
||||||
int i = 0;
|
int i = 0;
|
||||||
std::string num = target.substr(1);
|
std::string num = target.substr( target.find("#") == std::string::npos ? 1 : 2 );
|
||||||
if ( BaseToolkit::is_a_number(num, &i)){
|
if ( BaseToolkit::is_a_number(num, &i)){
|
||||||
Source *s = Mixer::manager().sourceAtIndex(i);
|
Source *s = Mixer::manager().sourceAtIndex(i);
|
||||||
if (s) {
|
if (s) {
|
||||||
@@ -201,7 +201,7 @@ void Control::RequestListener::ProcessMessage( const osc::ReceivedMessage& m,
|
|||||||
Control::manager().sendSourceAttibutes(remoteEndpoint, target, s);
|
Control::manager().sendSourceAttibutes(remoteEndpoint, target, s);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
Log::Info(CONTROL_OSC_MSG "Unknown target '%s' requested by %s.", target.c_str(), sender);
|
Log::Info(CONTROL_OSC_MSG "No source at ID %s targetted by %s.", num.c_str(), sender);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// General case: try to identify the target by name
|
// General case: try to identify the target by name
|
||||||
|
|||||||
@@ -27,7 +27,7 @@
|
|||||||
|
|
||||||
#define OSC_ALL "/all"
|
#define OSC_ALL "/all"
|
||||||
#define OSC_SELECTION "/selection"
|
#define OSC_SELECTION "/selection"
|
||||||
#define OSC_SOURCEID "(\\/)[[:digit:]]+$"
|
#define OSC_SOURCEID "(\\/#?)[[:digit:]]+$"
|
||||||
#define OSC_BATCH "(\\/batch#)[[:digit:]]+$"
|
#define OSC_BATCH "(\\/batch#)[[:digit:]]+$"
|
||||||
#define OSC_CURRENT "/current"
|
#define OSC_CURRENT "/current"
|
||||||
#define OSC_NEXT "/next"
|
#define OSC_NEXT "/next"
|
||||||
|
|||||||
Reference in New Issue
Block a user