Dept. of incomplete documentation: what if BufDelay* needs to be multichannel?
[supercollider.git] / SCClassLibrary / deprecated / Helper / helper.sc
blob3482e92d0ac9da170c9005045c064cfbc68143be
1 /*
2 // Helper, ClassHelper, UGenHelper, TopicHelper
3 // (In this file: Helper)
4 // ________________________________
5 //
6 // Helper chooses  between ClassHelper, UGenHelpe, TopicHelper by verifying
7 // the class of the passed undocumentedObject. Only Helper must be used directly
8 // UGenHelper is fitted for ar/kr/ir methods.
9 // UGens not implementing the rate methods receive as a tag line:
10 // Name -->no ar/kr/ir methods: sorry, you have to complete as required
12 // Accepts as args the class name (for classes and ugens) or a string describing a topic
13 // Generates an html and then open it in with openHelpFile
15 // Usage: Helper(undocumentedObject, path)
16 // where if path.isNil, it prompts for a path where to save as
18 Helper(Helper, "Help/Helper.html")
19 // ok
20 Helper(Helper)
21 // prompt for path (must be complete).
23 Helper(SinOsc, "/Users/andreavalle/Library/Application\ Support/SuperCollider/Extensions/Help/mine/SinOsc.html")
24 Helper(SinOsc)
25 // In this case SinOsc has already a help file, so Helper opens that one
26 // as it calls SinOsc.openHelpFile
28 Helper("On_Helper", "/Users/andreavalle/Library/Application\ Support/SuperCollider/Extensions/Help/mine/On_Helper.html")
29 Helper("On_Helper")
30 // it's a bit boring to repeat the class or the topic name with html as a path
31 // but I don't see a way to propose to GUI save dialog a fileName, so in that case you would have
32 // to specify it the same.
33 // Document was indeed more flexible
35 // or with an Help extension:
37 // + Help {
39 //      *makeHelp { arg undocumentedObject, path ;
40 //              Helper( undocumentedObject )
42 //      }
44 // }
45 // Help.makeHelp(MyClass)
46 // e.g.
47 Help.makeHelp(Helper)
49 // Help.makeHelp(MyUGen)
50 // e.g.
51 Help.makeHelp(SinOsc)
53 // Help.makeHelp("MyClass")
54 // e.g. Help.makeHelp("Helper's corner")
56 // Escapes make the sources totally unreadable...
57 // andreavalle (started: 04/11/2007)
61 Helper {
63         *new { arg undocumentedObject, path ;
64                 this.deprecated;
65                 ^super.new.initHelper( undocumentedObject, path )
66         }
68         initHelper { arg undocumentedObject, path ;
69                 case
70                         { undocumentedObject.class == Meta_Object }
71                                 { ^ClassHelper.new( undocumentedObject, path )  }
72                         { undocumentedObject.class == String }
73                                 { ^TopicHelper.new( undocumentedObject, path ) }
74                         { undocumentedObject.superclasses.includes(UGen).not }
75                                 { ^ClassHelper.new( undocumentedObject, path ) }
76                         { undocumentedObject.superclasses.includes(UGen) }
77                                 { ^UGenHelper.new( undocumentedObject, path ) }
78                 }