aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--classes/BowelyzerGUI.sc110
1 files changed, 76 insertions, 34 deletions
diff --git a/classes/BowelyzerGUI.sc b/classes/BowelyzerGUI.sc
index 403c911..728d73a 100644
--- a/classes/BowelyzerGUI.sc
+++ b/classes/BowelyzerGUI.sc
@@ -3,7 +3,6 @@ BowelyzerGUI{
var mainView, <settingsView, <channelContainerView,
<channels,
<indicators,
- //TODO: move to BowelyzerConfig
fadeOutTime = 0.3,
fadeOutSteps = 20,
minWidth=1280,
@@ -51,7 +50,7 @@ BowelyzerGUI{
//setup the main view, in which all other views reside
setupMainView{
arg config;
- var channelScrollView, forwardView, hubView, synthServerView, configView, layout;
+ var channelScrollView, configView, layout;
mainView = PageLayout.new("Bowelyzer");
mainView.asView.background = Color.fromHexString("#DBDBDB");
layout = mainView.asView.addFlowLayout(0@0, 0@0);
@@ -79,74 +78,114 @@ BowelyzerGUI{
this.setupSaveAsButton(configView);
this.setupLoadButton(configView);
+ this.setupAddressesAndPorts(settingsView.asView, config);
+
+ // go to next line in layout
+ layout.nextLine;
+ channelScrollView = ScrollView(mainView.asView, Rect(0 , 0, mainView.bounds.width, mainView.bounds.height-settingsView.bounds.height)).autohidesScrollers_(false).hasBorder_(true);
+ // container for channelViews
+ channelContainerView = View(parent: channelScrollView, bounds: Rect(0, 0, (channelViewWidth*config.at(\inputs).size)+buttonWidth, channelViewHeight));
+ channelContainerView.asView.background = Color.fromHexString("#FEFEFE");
+ channelContainerView.layout = HLayout();
+ channelContainerView.layout.spacing = 0;
+ channelContainerView.layout.margins = [0,0,0,0];
+ channelContainerView.name = \channelContainerView;
+ }
+
+ // setup Views for addresses and ports
+ setupAddressesAndPorts{
+ arg parent, config;
+ var forwardView, hubView, synthServerView;
+
//synthServer
- synthServerView = View(settingsView.asView);
+ synthServerView = View(parent, Rect(0, 0, settingsSubViewSize.x, settingsSubViewSize.y));
synthServerView.asView.background = Color.fromHexString("#DDDDEF");
synthServerView.layout = VLayout();
synthServerView.layout.spacing = 0;
synthServerView.layout.margins = settingsSubViewMargins;
synthServerView.name = "synthServer";
synthServerView.maxSize_(settingsSubViewSize);
- StaticText(synthServerView, Rect(0, 0, 140@20)).string_("synthServer").align_(\center);
+ StaticText(synthServerView, Rect(0, 0, 140@buttonHeight)).string_("synthServer").align_(\center);
this.setupEZText(synthServerView, "address", config.at(\synthServerAddress)).children.do({|item|
- if(item.isKindOf(StaticText),{item.align_(\left)});
- if(item.isKindOf(TextField),{item.align_(\right)});
+ if(item.isKindOf(StaticText),{
+ item.align_(\left);
+ });
+ if(item.isKindOf(TextField),{
+ item.align_(\right);
+ });
});
this.setupEZNumber(synthServerView, "port", config.at(\synthServerPort)).children.do({|item|
- if(item.isKindOf(StaticText),{item.align_(\left)});
- if(item.isKindOf(NumberBox),{item.align_(\right)});
+ if(item.isKindOf(StaticText),{
+ item.align_(\left);
+ });
+ if(item.isKindOf(NumberBox),{
+ item.align_(\right);
+ });
});
//hub
- hubView = View(settingsView.asView);
+ hubView = View(parent, Rect(0, 0, settingsSubViewSize.x, settingsSubViewSize.y));
hubView.asView.background = Color.fromHexString("#DDDDEF");
hubView.layout = VLayout();
hubView.layout.spacing = 0;
hubView.layout.margins = settingsSubViewMargins;
hubView.name = "hub";
hubView.maxSize_(settingsSubViewSize);
- StaticText(hubView, Rect(0, 0, 140@20)).string_("hub").align_(\center);
+ StaticText(hubView, Rect(0, 0, 140@buttonHeight)).string_("hub").align_(\center);
this.setupEZText(hubView, "address", config.at(\hubAddress)).children.do({|item|
- if(item.isKindOf(StaticText),{item.align_(\left)});
- if(item.isKindOf(TextField),{item.align_(\right)});
+ if(item.isKindOf(StaticText),{
+ item.align_(\left);
+ });
+ if(item.isKindOf(TextField),{
+ item.align_(\right);
+ });
});
this.setupEZNumber(hubView, "port", config.at(\hubPort)).children.do({|item|
- if(item.isKindOf(StaticText),{item.align_(\left)});
- if(item.isKindOf(NumberBox),{item.align_(\right)});
+ if(item.isKindOf(StaticText),{
+ item.align_(\left);
+ });
+ if(item.isKindOf(NumberBox),{
+ item.align_(\right);
+ });
});
//forward
- forwardView = View(settingsView.asView);
+ forwardView = View(parent, Rect(0, 0, settingsSubViewSize.x, settingsSubViewSize.y));
forwardView.asView.background = Color.fromHexString("#DDDDEF");
forwardView.layout = VLayout();
forwardView.layout.spacing = 0;
forwardView.layout.margins = settingsSubViewMargins;
forwardView.name = "forward";
forwardView.maxSize_(settingsSubViewSize);
- StaticText(forwardView, Rect(0, 0, 140@20)).string_("forward").align_(\center);
+ StaticText(forwardView, Rect(0, 0, 140@buttonHeight)).string_("forward").align_(\center);
this.setupEZText(forwardView, "address", config.at(\forwardAddress)).children.do({|item|
- if(item.isKindOf(StaticText),{item.align_(\left)});
- if(item.isKindOf(TextField),{item.align_(\right)});
+ if(item.isKindOf(StaticText),{
+ item.align_(\left);
+ });
+ if(item.isKindOf(TextField),{
+ item.align_(\right);
+ });
});
this.setupEZNumber(forwardView, "port", config.at(\forwardPort)).children.do({|item|
- if(item.isKindOf(StaticText),{item.align_(\left)});
- if(item.isKindOf(NumberBox),{item.align_(\right)});
+ if(item.isKindOf(StaticText),{
+ item.align_(\left);
+ });
+ if(item.isKindOf(NumberBox),{
+ item.align_(\right);
+ });
});
+ }
- // go to next line in layout
- layout.nextLine;
- channelScrollView = ScrollView(mainView.asView, Rect(0 , 0, mainView.bounds.width, mainView.bounds.height-settingsView.bounds.height)).autohidesScrollers_(false).hasBorder_(true);
- // container for channelViews
- channelContainerView = View(parent: channelScrollView, bounds: Rect(0, 0, (channelViewWidth*config.at(\inputs).size)+buttonWidth, channelViewHeight));
- channelContainerView.asView.background = Color.fromHexString("#FEFEFE");
- channelContainerView.layout = HLayout();
- channelContainerView.layout.spacing = 0;
- channelContainerView.layout.margins = [0,0,0,0];
- channelContainerView.name = \channelContainerView;
- //channelContainerView.maxSize_(((channelViewWidth*config.at(\inputs).size)+buttonWidth)@channelViewHeight);
+ // remove Views for addresses and ports
+ removeAddressesAndPorts{
+ settingsView.children.do({|setting, i|
+ if(setting.isKindOf(View) && ((setting.name == "hub") || (setting.name == "synthServer") || (setting.name == "forward")),{
+ setting.remove;
+ });
+ });
}
- //setup channel views
+ // setup channel views
setupChannelViews{
arg config;
config.at(\inputs).keysValuesDo({|name, input|
@@ -201,7 +240,7 @@ BowelyzerGUI{
meterView.layout.margins = [2,0,2,0];
//setup a toggle button for each channel
- this.setupPauseButton(meterView);
+ this.setupPauseButton(meterView, config.at(\controls).at(name).at(\active));
// setup a small View as indicator for incoming/outgoing OSC messages for each input
this.setupOSCIndicator(meterView);
@@ -371,7 +410,9 @@ BowelyzerGUI{
// setup a button to pause the Synth for a channel
setupPauseButton{
- arg parent;
+ arg parent, state;
+ var buttonState = 0;
+ if(state.not, {buttonState = 1});
^Button(parent, Rect(0, 0, buttonWidth, buttonHeight))
.states_([
["on", Color.black, Color.fromHexString("#99FF99")],
@@ -386,6 +427,7 @@ BowelyzerGUI{
address.sendMsg(type, name, controlValue);
})
.maxSize_(buttonWidth@buttonHeight)
+ .value_(buttonState)
;
}