OSC set current by source name

This commit is contained in:
Bruno Herbelin
2025-01-18 09:49:52 +01:00
parent 0dd5f73508
commit 928e798d86

View File

@@ -152,6 +152,7 @@ void Control::RequestListener::ProcessMessage( const osc::ReceivedMessage& m,
// Current source target: apply attribute to the current sources
else if ( target.compare(OSC_CURRENT) == 0 )
{
Source *_cs = Mixer::manager().findSource(attribute.substr(1));
int sourceid = -1;
if ( attribute.compare(OSC_SYNC) == 0) {
// send the status of all sources
@@ -175,6 +176,12 @@ void Control::RequestListener::ProcessMessage( const osc::ReceivedMessage& m,
// send the status of all sources
Control::manager().sendSourcesStatus(remoteEndpoint, m.ArgumentStream());
}
else if ( _cs != nullptr ) {
// set current to given source by name
Mixer::manager().setCurrentSource(_cs);
// send the status of all sources
Control::manager().sendSourcesStatus(remoteEndpoint, m.ArgumentStream());
}
// all other attributes operate on current source
else {
// apply attributes to current source