aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Runge <dave@sleepmap.de>2016-08-09 15:19:10 +0200
committerDavid Runge <dave@sleepmap.de>2016-08-09 15:19:10 +0200
commit12c4549cd2b9e2ddfac8999ea6c8e5982de2743c (patch)
tree9afdb4aba5fca62ecf0faff4cf85bdfeb1c8438f
parentb5a38478f95ac80e013b6ed875a699b7d747dbbd (diff)
downloadbowelyzer-12c4549cd2b9e2ddfac8999ea6c8e5982de2743c.tar.gz
bowelyzer-12c4549cd2b9e2ddfac8999ea6c8e5982de2743c.tar.bz2
bowelyzer-12c4549cd2b9e2ddfac8999ea6c8e5982de2743c.tar.xz
bowelyzer-12c4549cd2b9e2ddfac8999ea6c8e5982de2743c.zip
classes/BowelyzerGUI.sc: Renaming of indicators to oSCIndicators for clarification. Adding of a forwardIndicator (similar to oSCIndicators), that indicates problems with the forward address by changing the background color to red.
-rw-r--r--classes/BowelyzerGUI.sc66
1 files changed, 53 insertions, 13 deletions
diff --git a/classes/BowelyzerGUI.sc b/classes/BowelyzerGUI.sc
index 162f26a..5833ea2 100644
--- a/classes/BowelyzerGUI.sc
+++ b/classes/BowelyzerGUI.sc
@@ -2,7 +2,8 @@ BowelyzerGUI{
var mainView, <settingsView, <channelContainerView, lowerView, <configFilePathView,
<channels,
- <indicators,
+ <oSCIndicators,
+ <forwardIndicator,
fadeOutTime = 0.3,
fadeOutSteps = 20,
minWidth=1280,
@@ -25,8 +26,6 @@ BowelyzerGUI{
headViewWidth = 300,
controlsViewWidth = 246,
controlsViewHeight = 700,
-// controlGroups = #["general", "amplitude", "pitch", "hf"],
-// controlGroupGeneral = #[\sendReplyFreq, \freqRange, ],
sliderWidth = 238,
sliderHeight = 40
;
@@ -45,7 +44,7 @@ BowelyzerGUI{
controlMeterContainerViewSize = controlMeterContainerViewWidth@controlMeterContainerViewHeight;
channelViewSize = channelViewWidth@channelViewHeight;
channels = Set.new(config.config.at(\inputs).size);
- indicators = Dictionary.new(config.config.at(\inputs).size);
+ oSCIndicators = Dictionary.new(config.config.at(\inputs).size);
this.setupMainView(config.config, config.configFilePath);
this.setupChannelViews(config.config);
}
@@ -69,13 +68,16 @@ BowelyzerGUI{
settingsView.layout.spacing = 4;
settingsView.layout.margins = [0,0,0,0];
settingsView.name = "settingsView";
-
+ //TODO: set minWidth for settingsView
this.setupConfigView;
this.setupConfigFilePathView(configFilePath);
+ //TODO: increase minHeight of settingsView
+ //TODO: add FreqScopeView and expose bus selection in buttonView
this.setupSettingsSpacer;
this.setupSynthServerView(config);
this.setupHubView(config);
this.setupForwardView(config);
+ this.addForwardIndicatorFadeOutTask;
// go to next line in layout
layout.nextLine;
@@ -91,6 +93,7 @@ BowelyzerGUI{
buttonView.name = "buttonView";
buttonView.layout.insert(this.setupChannelAddButton, 0);
buttonView.layout.insert(this.setupGlobalToggleButton, 1);
+ //TODO: add sortChannelsButton (alphabetically/by channel)
buttonView.layout.insert(nil, 2);
lowerView.layout.insert(buttonView, 0);
@@ -250,6 +253,7 @@ BowelyzerGUI{
// setup channel views
setupChannelViews{
arg config;
+ //TODO: setup alphabetically
config.at(\inputs).keysValuesDo({|name, input|
this.setupChannelView(name, config);
});
@@ -519,10 +523,10 @@ BowelyzerGUI{
pingOSCIndicator{
arg name;
{
- if(indicators.includesKey(name),{
- indicators.at(name).stop;
- indicators.at(name).reset;
- indicators.at(name).start(AppClock);
+ if(oSCIndicators.includesKey(name),{
+ oSCIndicators.at(name).stop;
+ oSCIndicators.at(name).reset;
+ oSCIndicators.at(name).start(AppClock);
});
}.defer;
}
@@ -532,7 +536,7 @@ BowelyzerGUI{
arg name;
{
name = name.asString;
- indicators.put(
+ oSCIndicators.put(
name.asSymbol,
Task({
channels.do({|channel|
@@ -566,13 +570,49 @@ BowelyzerGUI{
freeOSCIndicatorFadeOutTask{
arg name;
{
- if(indicators.includesKey(name.asSymbol), {
- indicators.at(name).stop;
- indicators.removeAt(name);
+ if(oSCIndicators.includesKey(name.asSymbol), {
+ oSCIndicators.at(name).stop;
+ oSCIndicators.removeAt(name);
});
}.defer;
}
+ // ping the forward indicator, restarting its fadeout Task
+ pingForwardIndicator{
+ {
+ forwardIndicator.stop;
+ forwardIndicator.reset;
+ forwardIndicator.start(AppClock);
+ }.defer;
+ }
+
+ // setup a Task for changing the forwardView background color (on catching an error while trying to send to that address)
+ addForwardIndicatorFadeOutTask{
+ {
+ forwardIndicator = Task({
+ settingsView.children.do({|setting|
+ if(setting.isKindOf(View) && setting.name == "forward", {
+ setting.background_(Color.fromHexString("#FF9999"));
+ fadeOutSteps.do({|item,i|
+ setting.background_(setting.background.blend(Color.fromHexString("#DBDBDB"), (fadeOutTime/fadeOutSteps)));
+ (fadeOutTime/fadeOutSteps).wait;
+ });
+ setting.background_(Color.fromHexString("#DBDBDB"));
+ });
+ });
+ })
+ }.defer;
+ }
+
+ // free the forwardIndicatorFadeOutTask
+ freeForwardIndicatorFadeOutTask{
+ arg name;
+ {
+ forwardIndicator.stop;
+ }.defer;
+ }
+
+
// setup a new LevelIndicator
setupLevelIndicator{
arg parent;