[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [sc-dev] move Model to Core?
Hi,
The Main customizing question that Stefan mentions is indeed
a central one. The need to deviate from the default Main
will come up with very high probability in the work of most
users at some stage. I just overwrite several methods of
Main in my own library - so I don't have to remove the Main.sc
file, but I have to put up with the warnings of overwriting
methods in the message window on compiling. (SK: same?)
I'd say ways have to be devised to enable customization of
Main methods without overwriting them. Stefan's idea seems
good to me:
Any user class (Say for example hypothetical "X_MIDI" class)
can in it's *initClass method write in some globally accessible
slots, functions that contain custom startUp, shutDown, or other
Main method behaviors. Main methods will use these entries
to do the customization. That is, if you want to customize the
shutDown actions, you write in those slots at *initClass time.
The fastest and simplest way to do that is to declare the
slots as writable class variables of Main:
Main {
classvar <>startUp;
classvar <>shutDown;
classvar <>guiWindow;
// etc. ...
}
Iannis Zannos
---------------------------
On Sun, 23 Nov 2003, stefan kersten wrote:
> hi ron,
>
> On Sun, Nov 23, 2003 at 01:07:21PM -0500, Ronald J. Kuivila wrote:
> > How is an extension class is going to do it for you? It seems like gui
> > dependancies are always seeping into the general library. For example,
> > what would you do about the calls to Server-makeWindow?
>
> i'd make a method, say startUpInitialGUI or something, with an empty
> implementation in Main.sc. the class extension would overwrite this
> method to do something useful. same goes for newSCWindow etc.
>
> a more generic approach would be to have a global 'feature list'. each
> class of primitives (GUI, MIDI, HID, etc.) could push a symbol on the
> feature list and each SC class accessing primitives during
> startup/shutdown/CmdPeriod could test for a feature and only call the
> primitive when the feature is present. thoughts?
>
> to me, it doesn't matter much because i have my own version of Main
> anyway and know what to exclude from the library. but the out-of-the
> box experience for new users on linux would be improved a lot.
>
> <sk>
>
> _______________________________________________
> sc-dev mailing list
> sc-dev@xxxxxxxxxxxxxxx
> http://www.create.ucsb.edu/mailman/listinfo/sc-dev
>
--
Iannis Zannos
Research Director
Center for Research in Electronic Art Technology
Music Department / MAT,
University of California, Santa Barbara,
Santa Barbara, California 93106
Tel: (805) 893-8352
Fax: (805) 893-7194
http://www.create.ucsb.edu/~iani/