Graal Forums  

Go Back   Graal Forums > Development Forums > Future Improvements
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 03-26-2008, 12:00 AM
Twinny Twinny is offline
My empire of dirt
Twinny's Avatar
Join Date: Mar 2006
Location: Australia
Posts: 2,422
Twinny is just really niceTwinny is just really nice
Send a message via AIM to Twinny
onMusicStopped()

Would be a handy event as using ismusicplaying() to check can really lag your computer out.
Reply With Quote
  #2  
Old 03-26-2008, 12:25 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
Or you can check musiclen and musicpos and schedule an event to happen at the time it finishes.
__________________
Reply With Quote
  #3  
Old 03-26-2008, 01:01 AM
Twinny Twinny is offline
My empire of dirt
Twinny's Avatar
Join Date: Mar 2006
Location: Australia
Posts: 2,422
Twinny is just really niceTwinny is just really nice
Send a message via AIM to Twinny
Quote:
Originally Posted by Inverness View Post
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
Reply With Quote
  #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(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;

__________________
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


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


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