aboutsummaryrefslogtreecommitdiffstats
path: root/BowelyzerGUI.sc
diff options
context:
space:
mode:
authorDavid Runge <dave@sleepmap.de>2016-06-29 20:24:38 +0200
committerDavid Runge <dave@sleepmap.de>2016-06-29 20:24:38 +0200
commit2f2d4268b7d5fbc6677b482e45ebe97a9db6d19d (patch)
tree6b62c6e60e191c8b47e234e2dbab5c68bb5d7bcf /BowelyzerGUI.sc
parente0fc99f204bdd6fffef611b9a3b4290cb001971c (diff)
downloadbowelyzer-2f2d4268b7d5fbc6677b482e45ebe97a9db6d19d.tar.gz
bowelyzer-2f2d4268b7d5fbc6677b482e45ebe97a9db6d19d.tar.bz2
bowelyzer-2f2d4268b7d5fbc6677b482e45ebe97a9db6d19d.tar.xz
bowelyzer-2f2d4268b7d5fbc6677b482e45ebe97a9db6d19d.zip
BowelyzerGUI.sc: Moving LevelIndicator listener to Bowelyzer.sc. Removing all of the helper functions. Removing useless controlName in toggle message. Bowelyzer.sc: Adding usage of LevelIndicator listener and OSC indicator listener. Separating those from plain listeners for GUI elements. All should now properly survive the renaming of channels. Further clarifying names in setup functions for readability.
Diffstat (limited to 'BowelyzerGUI.sc')
-rw-r--r--BowelyzerGUI.sc62
1 files changed, 3 insertions, 59 deletions
diff --git a/BowelyzerGUI.sc b/BowelyzerGUI.sc
index f50ac63..99d1f47 100644
--- a/BowelyzerGUI.sc
+++ b/BowelyzerGUI.sc
@@ -1,11 +1,10 @@
BowelyzerGUI{
- var mainView,
- channelContainerView,
+ var mainView, channelContainerView,
<channels,
<indicators,
//TODO: move to BowelyzerConfig
- fadeOutTime = 1.0,
+ fadeOutTime = 0.5,
fadeOutSteps = 20,
minWidth=1280,
minHeight=720;
@@ -81,12 +80,9 @@ BowelyzerGUI{
// setup a small View as indicator for incoming/outgoing OSC messages for each input
this.setupOSCIndicator(meterView);
this.addOSCIndicatorFadeOutTask(name);
- indicators.at(name).play(AppClock);
-
// setup LevelIndicator for each input
this.setupLevelIndicator(meterView);
- this.setupLevelListener(name, NetAddr.new(config.at(\synthServerAddress), config.at(\synthServerPort)));
controlsView = View(controlMeterContainerView.asView, Rect(0,0, channelView.bounds.width*0.9, channelView.bounds.height));
controlsView.asView.background = Color.fromHexString("#EEEFEE");
@@ -117,7 +113,6 @@ BowelyzerGUI{
^View(parent, Rect(0,0,40,40))
.name_(\OSCIndicator)
.background_(Color.fromHexString("#EEEFEE"))
- //.background_(Color.fromHexString("#99EF99"))
.maxSize_(40@20)
.visible_(true)
;
@@ -159,56 +154,6 @@ BowelyzerGUI{
}
- // setup a listener for a level indicator by name and source (of synth server)
- setupLevelListener{
- arg name, source;
- postln("Setting up LevelListener for: "++name);
- OSCdef.newMatching(
- key: \levels++name,
- func: {|msg, time, addr, recvPort|
- var msgName = msg[0].asString.replace("/levels/", "").asSymbol;
- {
- channels.do({|channel|
- if(channel.name.asSymbol == msgName,{
- channel.children.do({|channelChild|
- if(channelChild.name.asSymbol == \meterAndControls,{
- channelChild.children.do({|meterAndControls|
- if(meterAndControls.name.asSymbol == \meterView, {
- meterAndControls.children.do({|meterView|
- if(meterView.isKindOf(LevelIndicator), {
- //postln("Setting up LevelIndicator for "++msgName);
- meterView.value = msg[3].ampdb.linlin(-40, 0, 0, 1);
- meterView.peakLevel = msg[4].ampdb.linlin(-40, 0, 0, 1);
- });
- });
- });
- });
- });
- });
- });
- });
- }.defer;
- },
- path: "/levels/"++name,
- srcID: source
- );
- }
-
- startLevelListener{
- arg name;
- OSCdef(\levels++name).enable;
- }
-
- stopLevelListener{
- arg name;
- OSCdef(\levels++name).disable;
- }
-
- freeLevelListener{
- arg name;
- OSCdef(\levels++name).free;
- }
-
setupLevelIndicator{
arg parent;
^LevelIndicator(
@@ -230,9 +175,8 @@ BowelyzerGUI{
var address = NetAddr.new("127.0.0.1", NetAddr.langPort),
type = "/toggle",
name = controlUnit.parent.parent.parent.name.asSymbol,
- controlName = \active,
controlValue = controlUnit.value;
- address.sendMsg(type, name, controlName, controlValue);
+ address.sendMsg(type, name, controlValue);
})
.maxSize_(40@20);
}