View Single Post
  #4  
Old 03-26-2008, 02:37 AM
Inverness Inverness is offline
Incubator
Inverness's Avatar
Join Date: Aug 2004
Location: Houston, Texas
Posts: 3,613
Inverness is a jewel in the roughInverness is a jewel in the rough
facepalm.jpg

Well until then you can always measure the length yourself then keep the lengths in a variable somewhere.
PHP Code:
public function play2(fname, catcher) {
  
temp.i = 0;

  if (
catcher.type() != 2) {
    return 
false;
  }
  for (
i = 0; i < this.music.size(); i ++) {
    if (
this.music[i][0] == fname) {
      
catcher.scheduleevent(this.music[i][1], "MusicStopped", fname);
      
play(fname);
      return 
true;
    }
  }
  return 
false;
} 
That is assuming musiclen doesn't work with midis.
PHP Code:
public function play2(fname, catcher) {
  if (
catcher.type() != 2) {
    return 
false;
  }
  
play(fname);
  if (
musiclen > 0) { // assuming musiclen is in seconds
    
catcher.scheduleevent(musiclen, "MusicStopped", fname);
    return 
true;
  }
  return 
false;
} 
__________________
Reply With Quote