clean up indentation and spacing
[supercollider.git] / SCClassLibrary / Common / GUI / PlusGUI / Control / UGen-scope.sc
blob792a92a8262da95c1f7ebec2d22ca1b7de8c5f8d
1 + UGen {
2         scope { arg name = "UGen Scope", bufsize = 4096, zoom;
3                 var gui;
4                 gui = GUI.current;
5                 ^SynthDef.wrap({ var bus, numChannels, rate, scope;
6                         numChannels = this.numChannels;
7                         rate = this.rate;
8                         bus = Bus.perform(rate, Server.internal, numChannels);
9                         switch(rate,
10                                 \audio, {Out.ar(bus.index, this)},
11                                 \control, {Out.kr(bus.index, this)}
12                         );
14                         {
15                                 scope = gui.stethoscope.new( gui.stethoscope.defaultServer, numChannels, bus.index, bufsize, zoom,
16                                         rate);
17                                 scope.window.name_(name.asString).bounds_( gui.stethoscope.tileBounds);
18                                 gui.stethoscope.ugenScopes.add(scope);
19                                 scope.window.onClose = { scope.free; bus.free;
20                                         gui.stethoscope.ugenScopes.remove(scope)};
21                                 CmdPeriod.doOnce({ {scope.window.close}.defer });
22                         }.defer(0.001);
23                         this;
24                 })
25         }
29 + Array {
30         scope { arg name = "UGen Scope", bufsize = 4096, zoom;
31                 var gui;
32                 gui = GUI.current;
33                 ^SynthDef.wrap({ var bus, numChannels, rate, scope;
34                         numChannels = this.numChannels;
35                         rate = this.rate;
36                         bus = Bus.perform(rate, Server.internal, numChannels);
37                         switch(rate,
38                                 \audio, {Out.ar(bus.index, this)},
39                                 \control, {Out.kr(bus.index, this)}
40                         );
42                         {
43                                 scope = gui.stethoscope.new( gui.stethoscope.defaultServer, numChannels, bus.index, bufsize, zoom,
44                                         rate);
45                                 scope.window.name_(name.asString).bounds_( gui.stethoscope.tileBounds);
46                                 gui.stethoscope.ugenScopes.add(scope);
47                                 scope.window.onClose = { scope.free; bus.free;                                  gui.stethoscope.ugenScopes.remove(scope)};
48                                 CmdPeriod.doOnce({ {scope.window.close}.defer });
49                         }.defer(0.001);
50                         this;
51                 })
52         }