2 // get options from command line passed by SCSpawn.exe
3 setFromCmdString { arg str;
5 segments = str.split($ ).reject(_ == "");
6 Server.program = segments.first;
7 segments.drop(1).clump(2).do { |pair|
8 var opt, val; #opt, val = pair;
9 if (opt[0] != $-) { "" + opt + "is not a valid server option!".postln };
10 opt = opt.drop(1).asSymbol;
11 if (opt == \t) { protocol = \tcp; };
12 if (opt == \u) { protocol = \udp; };
13 if (opt == \a) { numPrivateAudioBusChannels = val.asInteger };
14 if (opt == \c) { numControlBusChannels = val.asInteger };
15 if (opt == \i) { numInputBusChannels = val.asInteger };
16 if (opt == \o) { numOutputBusChannels = val.asInteger };
17 if (opt == \b) { numBuffers = val.asInteger };
18 if (opt == \n) { maxNodes = val.asInteger };
19 if (opt == \d) { maxSynthDefs = val.asInteger };
20 if (opt == \z) { blockSize = val.asInteger };
21 if (opt == \Z) { hardwareBufferSize = val.asInteger };
22 if (opt == \m) { memSize = val.asInteger };
23 if (opt == \r) { numRGens = val.asInteger };
24 if (opt == \w) { numWireBufs = val.asInteger };
25 if (opt == \S) { sampleRate = val.asInteger };
26 if (opt == \D) { loadDefs = (val != "0") };
27 // inputStreamsEnabled, outputStreamsEnabled, device, port number not yet handled.