IsPlayingMusic, Bug or joke?

Report any Hollywood bugs here
Post Reply
User avatar
Juan Carlos
Posts: 710
Joined: Mon Sep 06, 2010 1:02 pm

IsPlayingMusic, Bug or joke?

Post 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.........

User avatar
emeck
Posts: 96
Joined: Fri Apr 03, 2015 3:17 pm

Re: IsPlayingMusic, Bug or joke?

Post 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.
PowerBook 5.2 MorphOS 3.15
PowerBook 5.8 MorphOS 3.15
Amiga 1200 BPPC/BVision AOS4.1 FE

plouf
Posts: 157
Joined: Sun Feb 04, 2018 11:51 pm
Location: Athens,Greece

Re: IsPlayingMusic, Bug or joke?

Post 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 ?
Christos

User avatar
Juan Carlos
Posts: 710
Joined: Mon Sep 06, 2010 1:02 pm

Re: IsPlayingMusic, Bug or joke?

Post 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.

User avatar
Juan Carlos
Posts: 710
Joined: Mon Sep 06, 2010 1:02 pm

Re: IsPlayingMusic, Bug or joke?

Post 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.

User avatar
airsoftsoftwair
Posts: 4431
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: IsPlayingMusic, Bug or joke?

Post 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...

User avatar
Juan Carlos
Posts: 710
Joined: Mon Sep 06, 2010 1:02 pm

Re: IsPlayingMusic, Bug or joke?

Post 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.

User avatar
airsoftsoftwair
Posts: 4431
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: IsPlayingMusic, Bug or joke?

Post by airsoftsoftwair »

MCVE provided, fix received!

Code: Select all

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

Post Reply