GetMusicStatus
Status = GetMusicStatus(Index)
 
Parameters:

    Index= The Index of the music channel you wish to query
Returns:

    Status = The stats of this music (1=in use, 0 = Not in use)
 

The GetMusicStatus functions returns if a music channel is in use or not. If the music channel is always in use then GetMusicStatus will return a True(1), if not it'll return a False(0)




FACTS:


* Don't just assume a music resource is available (free for use), always check it's status prior to using it.




Mini Tutorial:


This example simply polls the status of music channel 1, if it's free it then loads a music.

  
  
; Display the status of Music #1
  Print "Music #1 Status:"+Str$(GetMusicStatus(1))
  
; check the sattus of Music #1
  If GetMusicStatus(1)=false
     Print "Loading Music"
     LoadMusic "MyMusicFile.wav",1
  Else
     Print "This Music Is NOT free for use"
  EndIf
  
; check the status of Music #1
  If GetMusicStatus(1)=false
     Print "Loading Music"
     LoadMusic "MyMusicFile.wav",1
  Else
     Print "This Music Is NOT free for use"
  EndIf
  
; Display the Screen and wait for the user to press a key
  Sync
  




This example would output.

  
  Music #1 Status:0
  Loading Music
  This Music Is Not Free For use
  

 
Related Info: :
 


(c) Copyright 2002 - 2024 - Kevin Picone - PlayBASIC.com