From CSWiki
Revision as of 23:18, 2 December 2007 by Mnardell (talk | contribs)

Jump to: navigation, search

I have been experimenting with a pattern for loading external data, such that once the data is loaded into the ChucK VM, an event is triggered and a consumer of the data is informed that the data is ready for loadinginng

//GlobalSpace - All public class that holds globally accessible 
// Objects (in this case a user defined event class
//However you cannot (in v. use a straightforward
//approach to capturing non-primative types in a static variable
//So we do a bare declare of e...

public class GlobalSpace {
    static TheEvent @ e;
    //static int data[200];
    static DataObj  @ callback;	
// ...then use the following to do the assignment

new TheEvent @=> GlobalSpace.e;
//This seems to be a necessary hack to allow us to 
//use a non-primitive in a static variable space 

Michael Nardell