Page 1 of 1

IsPlayingMusic, Bug or joke?

Posted: Wed Oct 21, 2020 4:16 pm
by Juan Carlos
I found this strange bug with the instruction IsMusicPlaying and as usual how work a instruction with one system and other.

Code: Select all

@MUSIC 1, "HappyBirthdaySong01.mp3"

PlayMusic(1, 1) ;HappyBirthdaySong01.

Function p_Musica()
 playing=IsMusicPlaying(1)
 ;If playing=True Then TextOut(#CENTER, #CENTER, "Music is End") ;Windows.
 If playing=False Then TextOut(#CENTER, #CENTER, "Music is End") ;MorphOS&AmigaOS3.x
EndFunction

InstallEventHandler({OnMusicEnd=p_Musica})

EscapeQuit(False)
Repeat
  WaitEvent
Forever
This time, as you like, a simple and clear code, where the instruction under Windows works in reverse way as to Amiga systems and in theory how does the manual say, in Windows with True and MorphOS&Amiga with False.
In my game project nows I have use both methods, activate it if the executable is for MorphOS&Amiga or if it is for Windows.
But this is not new, is being something habitual some instructions work to different way, sometimes by the operating system and others.........

Re: IsPlayingMusic, Bug or joke?

Posted: Wed Oct 21, 2020 8:50 pm
by emeck
Hi,
I can confirm this.

Using "playing=False" shows the text when music ends on MOS, but not on windows.

Changin to "playing=True" works on windows.

Re: IsPlayingMusic, Bug or joke?

Posted: Wed Oct 21, 2020 9:31 pm
by plouf
this confuse me too a bit but i THINK tha logical operatiosn SHOULD be inside brackets

does
If (playing=False) Then
works as expected in your tests ?

Re: IsPlayingMusic, Bug or joke?

Posted: Thu Oct 22, 2020 9:16 am
by Juan Carlos
plouf wrote: Wed Oct 21, 2020 9:31 pm this confuse me too a bit but i THINK tha logical operatiosn SHOULD be inside brackets

does
If (playing=False) Then
works as expected in your tests ?
I think that add the brackets isn't the solution because the official instruction is without them.

Re: IsPlayingMusic, Bug or joke?

Posted: Thu Oct 22, 2020 9:24 am
by Juan Carlos
emeck wrote: Wed Oct 21, 2020 8:50 pm Hi,
I can confirm this.

Using "playing=False" shows the text when music ends on MOS, but not on windows.

Changin to "playing=True" works on windows.
I think that this "bug" is heritage when in ancient versions of Hollywood this instruction and the equivalent for the samples, didn't worked fine, how I use this join the event handler OnMusicEnd the problem has appeared. Because with the instruction uses un basic mode with "true" to stop the music works fine.

Re: IsPlayingMusic, Bug or joke?

Posted: Wed Oct 28, 2020 10:37 pm
by airsoftsoftwair
Yes, this is a bug and will be fixed. Of course, it doesn't make much sense to call IsMusicPlaying() in a callback that signals playback end but it's a bug nevertheless...

Re: IsPlayingMusic, Bug or joke?

Posted: Wed Oct 28, 2020 10:40 pm
by Juan Carlos
airsoftsoftwair wrote: Wed Oct 28, 2020 10:37 pm Yes, this is a bug and will be fixed. Of course, it doesn't make much sense to call IsMusicPlaying() in a callback that signals playback end but it's a bug nevertheless...
If you use the instruction for other special work, yes.

Re: IsPlayingMusic, Bug or joke?

Posted: Fri Oct 30, 2020 9:47 pm
by airsoftsoftwair
MCVE provided, fix received!

Code: Select all

- Fix: IsMusicPlaying() sometimes returned TRUE even after the "OnMusicEnd" event callback had triggered