aboutsummaryrefslogtreecommitdiffstats
path: root/BowelyzerGUI.sc
diff options
context:
space:
mode:
Diffstat (limited to 'BowelyzerGUI.sc')
-rw-r--r--BowelyzerGUI.sc91
1 files changed, 70 insertions, 21 deletions
diff --git a/BowelyzerGUI.sc b/BowelyzerGUI.sc
index bf07ac6..f9d0633 100644
--- a/BowelyzerGUI.sc
+++ b/BowelyzerGUI.sc
@@ -1,6 +1,6 @@
BowelyzerGUI{
- var mainView, channelContainerView,
+ var mainView, settingsView, channelContainerView,
<channels,
<indicators,
//TODO: move to BowelyzerConfig
@@ -21,21 +21,62 @@ BowelyzerGUI{
indicators = Dictionary.new(config.at(\inputs).size);
this.setupMainView(config);
this.setupChannelViews(config);
- //TODO: add Button for adding new channel
- //TODO: add Button to save/load setup
}
//setup the main view, in which all other views reside
setupMainView{
arg config;
+ var forwardView, hubView, synthServerView;
mainView = PageLayout.new("Bowelyzer");
mainView.asView.background = Color.fromHexString("#DBDBDB");
+ settingsView = View(mainView.asView, Rect(0,0, mainView.bounds.width/config.at(\inputs).size, 60));
+ settingsView.asView.background = Color.fromHexString("#99EF99");
+ settingsView.layout = HLayout();
+ settingsView.layout.spacing = 0;
+ settingsView.layout.margins = [0,0,0,0];
+ settingsView.maxSize_(450@60);
+ //forward
+ forwardView = View(settingsView.asView);
+ forwardView.asView.background = Color.grey;
+ forwardView.layout = VLayout();
+ forwardView.layout.spacing = 0;
+ forwardView.layout.margins = [2,0,2,0];
+ forwardView.maxSize_(150@60);
+ StaticText(forwardView, Rect(0, 0, 150@20)).string_("forward").align_(\center);
+ this.setupEZText(forwardView, "address", config.at(\forwardAddress));
+ this.setupEZNumber(forwardView, "port", config.at(\forwardPort));
+ //hub
+ hubView = View(settingsView.asView);
+ hubView.asView.background = Color.grey;
+ hubView.layout = VLayout();
+ hubView.layout.spacing = 0;
+ hubView.layout.margins = [2,0,2,0];
+ hubView.maxSize_(150@60);
+ StaticText(hubView, Rect(0, 0, 150@20)).string_("hub").align_(\center);
+ this.setupEZText(hubView, "address", config.at(\hubAddress));
+ this.setupEZNumber(hubView, "port", config.at(\hubPort));
+ //synthServer
+ synthServerView = View(settingsView.asView);
+ synthServerView.asView.background = Color.grey;
+ synthServerView.layout = VLayout();
+ synthServerView.layout.spacing = 0;
+ synthServerView.layout.margins = [2,0,2,0];
+ synthServerView.maxSize_(150@60);
+ StaticText(synthServerView, Rect(0, 0, 150@20)).string_("synthServer").align_(\center);
+ this.setupEZText(synthServerView, "address", config.at(\synthServerAddress));
+ this.setupEZNumber(synthServerView, "port", config.at(\synthServerPort));
+
+ //TODO: add headView for hub, forward and scsynth addresses, save and load setup
+ //TODO: add Button to save/load setup
+ //TODO: add EZText for addresses
+ //TODO: add EZNumber for ports
channelContainerView = View(mainView.asView, Rect(0, 0, mainView.bounds.width/config.at(\inputs).size, mainView.bounds.height));
channelContainerView.asView.background = Color.fromHexString("#FEFEFE");
channelContainerView.layout = HLayout();
- channelContainerView.layout.spacing = 10;
- channelContainerView.layout.margins = [4,0,4,0];
- //TODO: add vertical scroll
+ channelContainerView.layout.spacing = 0;
+ channelContainerView.layout.margins = [0,0,0,0];
+ channelContainerView.maxSize_((340*config.at(\inputs).size)@680);
+ //TODO: add Button for adding new channel
}
//setup channel views
@@ -48,31 +89,35 @@ BowelyzerGUI{
channelView.name = name;
channelView.layout = VLayout();
channelView.layout.spacing = 0;
- channelView.layout.margins = [0,10,0,0];
+ channelView.layout.margins = [2,0,2,0];
+ channelView.maxSize_(300@680);
// adding name textfield of input
headView = View(channelView.asView, Rect(0, 0, channelView.bounds.width/config.at(\inputs).size, 40));
headView.asView.background = Color.fromHexString("#DDEFDD");
headView.name = \inputs;
headView.layout = HLayout();
headView.layout.spacing = 0;
- headView.layout.margins = [4,0,4,0];
- headView.maxHeight_(30);
+ headView.layout.margins = [2,0,0,0];
+ headView.maxHeight_(26);
this.setupEZText(headView, "name", name.asString);
this.setupEZNumber(headView, "input", config.at(\inputs).at(name));
- controlMeterContainerView = View(channelView.asView, Rect(0, 0, channelView.bounds.width/config.at(\inputs).size, channelView.bounds.height));
+ //controlMeterContainerView = View(channelView.asView, Rect(0, 0, channelView.bounds.width/config.at(\inputs).size, channelView.bounds.height));
+ controlMeterContainerView = View(channelView.asView);
controlMeterContainerView.asView.background = Color.fromHexString("#DDDDEF");
controlMeterContainerView.name = \meterAndControls;
controlMeterContainerView.layout = HLayout();
- channelView.layout.spacing = 0;
- channelView.layout.margins = [4,0,4,0];
+ controlMeterContainerView.maxHeight_(channelView.bounds.height-headView.bounds.height);
+ controlMeterContainerView.layout.spacing = 0;
+ controlMeterContainerView.layout.margins = [0,0,0,0];
+
meterView = View(controlMeterContainerView.asView, Rect(0,0, channelView.bounds.width*0.1, channelView.bounds.height));
meterView.asView.background = Color.fromHexString("#EEEFEE");
meterView.name = \meterView;
meterView.layout = VLayout();
meterView.maxWidth = 60;
- meterView.layout.spacing = 20;
- meterView.layout.margins = [0,10,0,0];
+ meterView.layout.spacing = 0;
+ meterView.layout.margins = [0,0,0,0];
//setup a toggle button for each channel
this.setupPauseButton(meterView);
@@ -88,7 +133,7 @@ BowelyzerGUI{
controlsView.asView.background = Color.fromHexString("#EEEFEE");
controlsView.name = \controls;
controlsView.layout = VLayout();
- controlsView.layout.spacing = 2;
+ controlsView.layout.spacing = 0;
controlsView.layout.margins = [0,0,0,0];
config.at(\controls).at(name).order.do({|control, i|
@@ -158,7 +203,7 @@ BowelyzerGUI{
arg parent;
^LevelIndicator(
parent
- ).maxSize_(50@600)
+ ).maxSize_(40@600)
.style_(\led)
.drawsPeak_(true);
}
@@ -178,7 +223,8 @@ BowelyzerGUI{
controlValue = controlUnit.value;
address.sendMsg(type, name, controlValue);
})
- .maxSize_(40@20);
+ .maxSize_(40@20)
+ ;
}
@@ -186,7 +232,7 @@ BowelyzerGUI{
arg parent, control, value;
^EZText(
parent: parent,
- bounds: 140@20,
+ bounds: 150@20,
label: control,
action: {
arg controlUnit;
@@ -197,7 +243,7 @@ BowelyzerGUI{
controlValue = controlUnit.value;
address.sendMsg(type, name, controlName, controlValue);
},
- labelWidth: 40,
+ labelWidth: 50,
textWidth: 100,
initVal:value.asString,
layout: \horz,
@@ -208,6 +254,7 @@ BowelyzerGUI{
setupEZNumber{
arg parent, control, value;
+ //TODO: make choosing of size and action/message generic
^EZNumber(
parent: parent,
bounds: 100@20,
@@ -223,11 +270,13 @@ BowelyzerGUI{
address.sendMsg(type, name, controlName, controlValue);
},
initVal:value,
- unitWidth:0,
+ //unitWidth:0,
layout: \horz,
margin: nil
)
- .view.maxSize_(100@20);
+ //.view.maxSize_(100@20);
+ .view.maxHeight_(20)
+ ;
}
setupEZSlider{