Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   Future Improvements (https://forums.graalonline.com/forums/forumdisplay.php?f=10)
-   -   onMusicStopped() (https://forums.graalonline.com/forums/showthread.php?t=79188)

Twinny 03-26-2008 12:00 AM

onMusicStopped()
 
Would be a handy event as using ismusicplaying() to check can really lag your computer out.

Inverness 03-26-2008 12:25 AM

Or you can check musiclen and musicpos and schedule an event to happen at the time it finishes.

Twinny 03-26-2008 01:01 AM

Quote:

Originally Posted by Inverness (Post 1382376)
Or you can check musiclen and musicpos and schedule an event to happen at the time it finishes.

musicpos doesn't work for midis =( ...atleast not for me anyways

Inverness 03-26-2008 02:37 AM

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(fnamecatcher) {
  
temp.0;

  if (
catcher.type() != 2) {
    return 
false;
  }
  for (
0this.music.size(); ++) {
    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(fnamecatcher) {
  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;




All times are GMT +2. The time now is 11:45 PM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.