From 1457dffcf11574f6464cb8f808ad32c4d408f570 Mon Sep 17 00:00:00 2001 From: David Runge Date: Sat, 2 Jul 2016 02:31:46 +0200 Subject: Unifying port and address messages to only need one OSCdef on the receiving side each. --- BowelyzerGUI.sc | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/BowelyzerGUI.sc b/BowelyzerGUI.sc index 0e12738..3459557 100644 --- a/BowelyzerGUI.sc +++ b/BowelyzerGUI.sc @@ -37,7 +37,7 @@ BowelyzerGUI{ settingsView.layout.spacing = 0; settingsView.layout.margins = [0,0,0,0]; //settingsView.maxSize_(510@64); - + //config configView = View(settingsView.asView); configView.asView.background = Color.fromHexString("#DDDDEF"); @@ -252,7 +252,7 @@ BowelyzerGUI{ .maxSize_(40@20) ; } - + // create a save button, that launches a FileDialog on press setupSaveButton{ arg parent; @@ -322,9 +322,10 @@ BowelyzerGUI{ controlName = controlUnit.labelView.string.asSymbol, controlValue = controlUnit.value; if((type == "/synthServer") || (type == "/hub") || (type == "/forward"), { - type = type++"Address"; - postln("Sending: "++"["++type++", "++controlValue++"]"); - address.sendMsg(type, controlValue); + type = (type++"Address").replace("/","").asSymbol; + name = "/"++controlName; + postln("Sending: "++"["++name++", "++type++", "++controlValue++"]"); + address.sendMsg(name, type, controlValue); },{ postln("Sending: "++"["++type++", "++name++", "++controlName++", "++controlValue++"]"); address.sendMsg(type, name, controlName, controlValue); @@ -364,9 +365,10 @@ BowelyzerGUI{ controlName = controlUnit.labelView.string.asSymbol, controlValue = controlUnit.value; if((type == "/synthServer") || (type == "/hub") || (type == "/forward"), { - type = type++"Port"; - postln("Sending: "++"["++type++", "++controlValue++"]"); - address.sendMsg(type, controlValue); + type = (type++"Port").replace("/", "").asSymbol; + name = "/"++controlName; + postln("Sending: "++"["++name++", "++type++", "++controlValue++"]"); + address.sendMsg(name, type, controlValue); },{ postln("Sending: "++"["++type++", "++name++", "++controlName++", "++controlValue++"]"); address.sendMsg(type, name, controlName, controlValue); -- cgit v1.2.3-70-g09d2