old quark gui: openOS is not osx only
[supercollider.git] / SCClassLibrary / deprecated / deprecated-3.5.sc
blob07aac443ff76265ed74331fcce3d463e8821d167
1 UI {
2         classvar resetActions, shutdownActions;
4         initClass {
5                 resetActions = Array.new;
6                 shutdownActions = Array.new; // braindead extensions may rely on these
7         }
9         *registerForReset {|aFunction|
10                 this.deprecated(thisMethod, OnError.class.findMethod(\add));
11                 OnError.add(aFunction)
12         }
13         *registerForShutdown {|aFunction|
14                 this.deprecated(thisMethod, ShutDown.class.findMethod(\add));
15                 ShutDown.add(aFunction)
16         }
19 Pflow : FilterPattern {
20         *new {
21                 Error("Pflow was replaced. please use Pstep instead").throw;
22         }
25 Model {
26         var <>dependants;
28         *new {
29                 this.deprecated(thisMethod, Object.class.findMethod(\new));
30                 "NB Model's functionality is duplicated by Object".postln;
31                 ^super.new;
32         }
33         changed { arg what ... moreArgs;
34                 dependants.do({ arg item;
35                         item.update(this, what, *moreArgs);
36                 });
37         }
38         addDependant { arg dependant;
39                 if (dependants.isNil, {
40                         dependants = IdentitySet.new(4);
41                 });
42                 dependants.add(dependant);
43         }
44         removeDependant { arg dependant;
45                 if (dependants.notNil, {
46                         dependants.remove(dependant);
47                 });
48         }
49         release {
50                 dependants = nil;
51         }
54 Panner : MultiOutUGen {
55         checkNInputs { arg n;
56                 this.deprecated(UGen.class.findMethod(\checkNInputs));
57                 ^super.checkNInputs(n)
58         }
59         checkInputs { this.deprecated; ^this.checkNInputs(1) }
62 XFade : UGen {
63         checkNInputs { arg n;
64                 this.deprecated(UGen.class.findMethod(\checkNInputs));
65                 ^super.checkNInputs(n)
66         }
69 GetFileDialog {
71         *new { arg function;
72                 // platform neutral (eventually)
73                 this.deprecated(thisMethod, File.class.findMethod(\openDialog));
74                 File.openDialog(nil,
75                         { arg path; function.value(true,path) },
76                         {  function.value(false) } );
77                 //CocoaDialog.getPaths({arg paths; function.value(paths.first) },nil)
78         }
79         // warning:  doesn't handle doAction (no instance)
84 GetStringDialog  {
86         *new { arg prompt,defaultString="",func;
87                 var b;
88                 this.deprecated(thisMethod);
89                 Sheet({ arg l;
90                         b =     TextField(l,Rect(0,0,150,30));
91                         b.string = String.new ++ defaultString;
92                         b.action = {arg field; func.value(true,field.value); l.close; };
93                 },prompt);
94                 { b.focus }.defer;
95         }
98 + Mix {
100         *ar { arg array;
101                 this.deprecated(thisMethod, Mix.class.findMethod(\new));
102                 ^this.new(array);
103         }
104         *arFill { arg n,func;
105                 this.deprecated(thisMethod, Mix.class.findMethod(\fill));
106                 ^this.fill(n,func);
107         }
110 + SimpleNumber {
111         // rgb() still will not work in variable declarations in classes
112         // because rgb is no longer a literal
114         // move them to init methods
115         rgb { arg green,blue;
116                 this.deprecated(thisMethod, Color.class.findMethod(\new255));
117                 ^Color(this / 255.0,green / 255.0, blue / 255.0)
118         }
122 + Synth {
124         *stop {
125                 this.deprecated(thisMethod, Server.findMethod(\free));
126                 RootNode.new.freeAll;
127         }
128         *play { arg func;
129                 this.deprecated(thisMethod, Synth.class.findMethod(\new));
130                 Server.default.doWhenBooted({
131                         func.play;
132                 })
133         }
134         play {
135                 this.deprecated(thisMethod, Synth.class.findMethod(\new));
136                 //if not already playing, play
137         }
138         *sampleRate {
139                 this.deprecated(thisMethod, Server.findMethod(\sampleRate));
140                 ^Server.default.sampleRate ? Server.default.options.sampleRate ? 44100.0
141         }
145 + RawArray {
147         write { arg path;
148                 var file;
149                 this.deprecated(thisMethod, File.findMethod(\write));
150                 file = File.new(path, "wb");
151                 if (file.notNil, {
152                         file.write(this);
153                         if(file.length < this.size,{
154                                 Error("Write file failed !!!! " ++ path).throw;
155                         });
156                         file.close;
157                 });
158         }
162 + ServerOptions {
163         blockAllocClass {
164                 this.deprecated(thisMethod)
165         }
166         blockAllocClass_ {
167                 this.deprecated(thisMethod)
168         }
170         rendezvous_ {|bool|
171                 zeroConf = bool;
172                 this.deprecated(thisMethod, ServerOptions.findMethod(\zeroConf_))
173         }
175         rendezvous {|bool|
176                 this.deprecated(thisMethod, ServerOptions.findMethod(\zeroConf));
177                 ^zeroConf;
178         }
180         numAudioBusChannels_{|num|
181                 this.numPrivateAudioBusChannels = num - (numInputBusChannels + numOutputBusChannels);
182                 this.deprecated(thisMethod);
183         }
186 + Server {
187         // Buffer objects are cached in an Array for easy
188         // auto buffer info updating
189         addBuf { |buffer|
190                 this.deprecated(thisMethod, Buffer.findRespondingMethodFor(\cache));
191                 buffer.cache;
192         }
194         freeBuf { |i|
195                 var     buf;
196                 this.deprecated(thisMethod, Buffer.findRespondingMethodFor(\uncache));
197                 if((buf = Buffer.cachedBufferAt(this, i)).notNil) { buf.free };
198         }
200         // /b_info on the way
201         // keeps a reference count of waiting Buffers so that only one responder is needed
202         waitForBufInfo {
203                 this.deprecated(thisMethod, Buffer.findRespondingMethodFor(\cache));
204         }
206         resetBufferAutoInfo {
207                 this.deprecated(thisMethod, Meta_Buffer.findRespondingMethodFor(\clearServerCaches));
208                 Buffer.clearServerCaches(this);
209         }
212 + Node {
213         // map to Bus objects
214         busMap { arg firstControl, aBus ... args;
215                 var values;
216                 this.deprecated(thisMethod, Node.findMethod(\map));
217                 values = List.new;
218                 args.pairsDo({ arg control, bus; values.addAll([control, bus.index, bus.numChannels])});
219                 server.sendMsg(48, nodeID, firstControl, aBus.index, aBus.numChannels, *values);
220                 //"/n_mapn"
221         }
222         busMapMsg { arg firstControl, aBus ... args;
223                 var values;
224                 this.deprecated(thisMethod, Node.findMethod(\mapMsg));
225                 values = List.new;
226                 args.pairsDo({ arg control, bus; values.addAll([control, bus.index, bus.numChannels])});
227                 ^[48, nodeID, firstControl, aBus.index, aBus.numChannels] ++ values;
228                 //"/n_mapn"
229         }
232 + SynthDef {
233         memStore { arg libname = \global, completionMsg, keepDef = true;
234                 this.deprecated(thisMethod, this.class.findRespondingMethodFor(\add));
235                 this.add(libname, completionMsg, keepDef);
236         }
239 + Env {
240         shapeNumber { arg shapeName;
241                 this.deprecated(thisMethod, this.class.class.findMethod(\shapeNumber));
242                 ^this.class.shapeNumber(shapeName)
243         }
246 + Help {
247         searchGUI {
248                 this.deprecated(thisMethod, Meta_Help.findRespondingMethodFor(\gui));
249                 ^this.gui
250         }
253 + Collection{
254         occurencesOf { | obj |
255                 this.deprecated(thisMethod, Collection.findRespondingMethodFor(\occurrencesOf));
256                 ^this.occurrencesOf(obj);
257         }
260 + Buffer {
261         copy { arg buf, dstStartAt = 0, srcStartAt = 0, numSamples = -1;
262                 if(buf.notNil) {
263                         this.deprecated(thisMethod, this.class.findRespondingMethodFor(\copyData));
264                         this.copyData(buf, dstStartAt, srcStartAt, numSamples);
265                 } {
266                         ^super.copy
267                 }
268         }