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;
}