What I am trying to achieve is that when using Pause it Pauses, and Resumes.
With Stop it simply STOPs, and if after that using PAUSE, it would play from beginning.
With PLAY, it would always start playing from beginning.
Nothing hard there. Except, I would need one command, which is IsMusicPaused (is there one somewhere that I missed?), for so far I haven't been able to get the PLAY-button to play from beginning when in PAUSE-mode, without adding my own variable which keep track if music file is paused or not. I think it would be better that there would be a command to check this, just like IsMusicPlaying (it could actually notify in this whether music is playing, and also, if it is in pause mode), instead of having to add own Variable to keep track of it.
I also encountered a bug probably (this isn't full example):
Code: Select all
Local ID = MakeButton(Nil, #SIMPLEBUTTON, X, Y, ButW, ButH, {OnMouseDown=Function()
If IsMusicPlaying(1) = True
PauseMusic(1)
Else
ResumeMusic(1)
EndIf
Local ID = MakeButton(Nil, #SIMPLEBUTTON, X, Y, ButW, ButH, {OnMouseDown=Function()
StopMusic(1)
PlayMusic(1)
EndFunction})
InsertItem(Player.Buttons, ID)
The second button is the PLAY-button. Idea is that what I was hoping was that if this button would be played after the PauseMusic() has happened (music is on PAUSE-state) then it would first StopMusic() and then PlayMusic(), meaning it in practice would play the music from the beginning.
By otherwords, thought this could be a hack around the problem of having no way to find out if music is in pause mode or not, by forcing music be stopped and then played from beginning.
Result: Instead of playing the music from beginning, as was the intention, it actually works same as ResumeMusic(), continuing the music playing from location I paused it at. I suppose this isn't intended behavior.
Hollywood 10, Windows 11.