Skip to content

Commit

Permalink
Refresh solo button on OSC Message (#7438)
Browse files Browse the repository at this point in the history
The solo button is non-local and so requires a rebuild when
it changes. The various mechanisms we have do this but OSC
did not. So start a list of param types which when OSC set
push a rebuild and add solo, mute, and scenesel all to them.

Closes #7417
  • Loading branch information
baconpaul authored Jan 14, 2024
1 parent 23d9ee0 commit 5fb6ba1
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 0 deletions.
28 changes: 28 additions & 0 deletions scripts/osc-tests/OSC_test_solo.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
from osc4py3.as_eventloop import *
from osc4py3 import oscbuildparse as obp
from osc4py3.oscmethod import *
import time

def set_solo(val):
print("Setting solo to ", val)
msg = obp.OSCMessage("/param/a/mixer/osc1/solo", ",f", [val])
osc_send(msg, "oscout")
osc_process()

### config
ip = "127.0.0.1"
surgeOSCInPort = 53280 #Surge XT default OSC in port

osc_startup()
osc_udp_client(ip, surgeOSCInPort, "oscout")

for i in range(40):
set_solo(False)
time.sleep(2)
set_solo(True)
time.sleep(2)

set_solo(False)


osc_terminate()
9 changes: 9 additions & 0 deletions src/surge-xt/SurgeSynthProcessor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -737,6 +737,15 @@ void SurgeSynthProcessor::processBlockOSC()
pval = Parameter::intScaledToFloat(pval, om.param->val_max.i, om.param->val_min.i);
surge->setParameter01(surge->idForParameter(om.param), pval, true);
surge->storage.getPatch().isDirty = true;

// Special cases: A few control types require a rebuild and
// SGE Value Callbacks would do it as would the VST3 param handler
// so put them here for now. Bit of a hack...
auto ct = om.param->ctrltype;
if (ct == ct_bool_solo || ct == ct_bool_mute || ct == ct_scenesel)
{
surge->refresh_editor = true;
}
}
break;

Expand Down

0 comments on commit 5fb6ba1

Please sign in to comment.