I've added a nopause parameter (exactly the same idea as you, CC ) which can take the values :
0 -> nopause is off : the sound is paused if the spacebar is pressed.
1 -> nopause is on : the sound is not paused if the spacebar is pressed.
If the nopause parameter is not precised in the play function, the default value is 0.
Here's a .cel script example :
Code: Select all
{
play { channel 1 volume 1 loop 1 filename "music.wav" nopause 1 }
wait { duration 1 }
play { channel 2 volume 1 loop 1 filename "comment.wav" }
wait { duration 50 }
}
And Here's the same script in .celx format :
Code: Select all
celestia:play(1, 1, 1, "music.wav", 1)
wait(1)
celestia:play(2, 1, 1, "comment.wav")
wait(50)
I had to change several files to add this fifth parameter to the playSoundFile function. I won't post all the changes here since you can download the updated celestia_1.4.1_patch2.zip file with new modified source files...
I also noticed a little issue that doesn't come from my code : a looping file which is paused during its second loop doesn't resume playing. That's strange because during the 1st, 3rd, 4th, etc... loops, the pause/resume functions work perfectly.
That may come from the AL_PAUSED state definition in the openAL code. I will post a message for this issue on the OpenAL dev forum...