home *** CD-ROM | disk | FTP | other *** search
/ ring.yamanashi.ac.jp/pub/pc/freem/action/ / action.zip / baku100.zip / baku100 / Kernel / Resources / SoundEffect.tonyu < prev   
Text File  |  2006-12-23  |  599b  |  35 lines

  1. extends CustomResource;
  2.  
  3. native _n_loadSE;
  4. function loadSE(n) {
  5.    return _n_loadSE (n);
  6. }
  7.  
  8. function onInit() {
  9.   setGlobal(getName(),this);
  10.   p=loadSE(getURL());
  11.   //print (strcat("sound ",getName())) ;
  12.   //print (getGlobal (getName()) );
  13.   return $_istat_completed; 
  14. }
  15.  
  16. native _n_play;
  17. function play(ar,v) {
  18.    if (p) {
  19.       if (v==null) return _n_play (p,ar,128); 
  20.       return _n_play (p,ar,v);
  21.    }
  22. }
  23.  
  24. native _n_freeSE;
  25. function release() {
  26.   if (p) {
  27.     //print ("freeing "+getName());
  28.     _n_freeSE(p); 
  29.   }
  30.   p=null; 
  31. }
  32.  
  33. destructor free() {
  34.   release();
  35. }