Sound.stopMusic() and event-handler

For test results, bug reports, announcements of new builds etc.

Moderators: winston, another_commander, Getafix

Post Reply
User avatar
Svengali
Commander
Commander
Posts: 2370
Joined: Sat Oct 20, 2007 2:52 pm

Sound.stopMusic() and event-handler

Post by Svengali »

I'm currently overhauling the Hyperradio and spotted one thing:

Code: Select all

this.shipWillDockWithStation = function()
 {
   Sound.stopMusic(this.hyperradio_current);
 }
Works superb, but when I use the same in this.shipDockedWithStation the sound won't stop. Is it a bug or a feature?
User avatar
JensAyton
Grand Admiral Emeritus
Grand Admiral Emeritus
Posts: 6657
Joined: Sat Apr 02, 2005 2:43 pm
Location: Sweden
Contact:

Post by JensAyton »

Bug. When the player docks, the game attempts to play “OoliteDocked.ogg” if there is a file by that name. However, the code that plays the music loses track of the currently-playing music when given a non-existant file name. This is a general problem not limited to that particular case.

The fix looks trivial, but I need to write a test case. :-)
User avatar
Svengali
Commander
Commander
Posts: 2370
Joined: Sat Oct 20, 2007 2:52 pm

Post by Svengali »

Thanks Ahruman.

If we know that it isn't working on some points then we could use the working event-handlers. Thanks for your time and I really like the new stuff :-)

BTW: While testing the new Sound.playMusic I've spotted that sometimes - after playing a song there is a stutter, as if Oolite tries to play something again. It's short (<0.5secs) but you can hear it.
User avatar
JensAyton
Grand Admiral Emeritus
Grand Admiral Emeritus
Posts: 6657
Joined: Sat Apr 02, 2005 2:43 pm
Location: Sweden
Contact:

Post by JensAyton »

Fixed for 1.71.2 amd 1.72.
User avatar
JensAyton
Grand Admiral Emeritus
Grand Admiral Emeritus
Posts: 6657
Joined: Sat Apr 02, 2005 2:43 pm
Location: Sweden
Contact:

Post by JensAyton »

Svengali wrote:
BTW: While testing the new Sound.playMusic I've spotted that sometimes - after playing a song there is a stutter, as if Oolite tries to play something again. It's short (<0.5secs) but you can hear it.
I suspect this is SDL’s fault. (You’re on Windows, are you not?)
User avatar
Svengali
Commander
Commander
Posts: 2370
Joined: Sat Oct 20, 2007 2:52 pm

Post by Svengali »

Ahruman wrote:
I suspect this is SDL’s fault. (You’re on Windows, are you not?)
To my shame - yes :-)
User avatar
Svengali
Commander
Commander
Posts: 2370
Joined: Sat Oct 20, 2007 2:52 pm

Re: Sound.stopMusic() and event-handler

Post by Svengali »

Now (v1.71.2) it has changed. this.shipWillDockWithStation doesn't work without error and this.shipDockedWithStation works superb. Again only for Sound.stopMusic(this.hyperradio_current).
User avatar
JensAyton
Grand Admiral Emeritus
Grand Admiral Emeritus
Posts: 6657
Joined: Sat Apr 02, 2005 2:43 pm
Location: Sweden
Contact:

Post by JensAyton »

*grumblegrumblebahhumbug*
Post Reply