IF3Si/scd/gui_main.scd

81 lines
2.2 KiB
Plaintext

/*
This file is part of "Interface Fractures III - Silicon".
Copyright (c) 2015 Luka Prinčič, All rights reserved.
This program is free software distributed under
GNU General Public Licence. See COPYING for more info.
- - - - - - - - - - - - - - - - - - - - - - - - - - - -
gui_main.scd - responsible for GUI elements under
the 'main' tab ...
********************************************************** */
~tab_views[~tab_names.at("main")].layout = HLayout(
nil,
HLayout(
nil,
Button()
.states_([
["Clock"],
["Clock", Color.gray(0.2), Color.grey(0.8)] ])
.mouseDownAction_({ | state |
switch(state.value,
0, {
postln("\n- - - - - - - - - - - - - - - - - - - - - - - - - - - - ");
postln("~~~ starting clock!");
TempoClock.default.sched(0, ~mainTimeline);
~mainTimeline.reset;
},
1, {
postln("\n~~~ stopping clock!");
~mainTimeline.stop;
//~mainTimeline.reset;
postln("~~~ some synths might still be running");
}
);
})
.minHeight_(70).minWidth_(70),
nil,
Button().minHeight_(70).minWidth_(70)
.states_([ ["draw Spectrum"], ["draw Spectrum", Color.gray(0.2), Color.grey(0.8)] ])
.mouseDownAction_({ | state |
switch(state.value,
0, { postln("~~~ draw Spectrum on!");
~zarquOsc.sendMsg("/sc", "drawSpectrumToggle", 1); },
1, { postln("~~~ draw Spectrum off!");
~zarquOsc.sendMsg("/sc", "drawSpectrumToggle", 0); }
);
}),
Button().minHeight_(70).minWidth_(70)
.states_([ ["Test pattern"], ["Test pattern", Color.gray(0.2), Color.grey(0.8)] ])
.mouseDownAction_({ | state |
switch(state.value,
0, { postln("~~~ test pattern on!");
~zarquOsc.sendMsg("/sc", "testPatternToggle", 1); },
1, { postln("~~~ test pattern off!");
~zarquOsc.sendMsg("/sc", "testPatternToggle", 0); }
);
}),
Button().minHeight_(70).minWidth_(70)
.states_([ ["Test picture"], ["Test picture", Color.gray(0.2), Color.grey(0.8)] ])
.mouseDownAction_({ | state |
switch(state.value,
0, { postln("~~~ test picture on!");
~zarquOsc.sendMsg("/sc", "testPictureToggle", 1); },
1, { postln("~~~ test pattern off!");
~zarquOsc.sendMsg("/sc", "testPictureToggle", 0); }
);
}),
nil
),
nil
);