Up: GEOS SDK TechDocs | Up | Prev: SoundAllocMusic() ... | Next: SoundPlayToMusicStream() ...

SoundFreeMusic()

void 	SoundFreeMusic(
        MemHandle 		mh);

This routine frees up a music handle. The music must not be playing; call SoundStopMusic() if you are not sure. You may not use the music handle after calling this routine on it.

SoundFreeMusicNote()

void SoundFreeMusicNote(
        MemHandle 		mh);

This routine frees up the passed note handle. The note must not be playing when you call this routine; call SoundStopMusicNote() if you are not sure. You should not try to use the note's handle after freeing it.

SoundFreeMusicStream()

void SoundFreeMusicStream(
        MemHandle 		mh);

This routine frees up the music stream's token. No music must be playing via the stream; call SoundStopMusicStream() if you are not sure. Do not try to use the stream after calling this routine on it.

SoundFreeSampleStream()

void 	SoundFreeSampleStream(
        MemHandle 		mh);

This routine frees the passed sampled sound handle. You must not try to use this handle after calling this routine on it.

SoundGetExclusive()

void	SoundGetExclusive(void);

This routine grabs the exclusive semaphore for the sound library; if another thread has already grabbed the exclusive, this routine will wait until the exclusive is released. Sounds which are playing now will be permitted to finish, but from now on, only the thread calling this routine will be allowed to play new sounds. When done with the sound library exclusive, call SoundReleaseExclusive() .

SoundGetExclusiveNB()

Boolean	SoundGetExclusiveNB(void);

This routine grabs the exclusive semaphore for the sound library, doing so even if some other thread has already grabbed the exclusive. Sounds which are playing now will be permitted to finish, but from now on, only the thread calling this routine will be allowed to play new sounds. This routine will return true if another thread already has exclusive access.

When done with the sound library exclusive, call SoundReleaseExclusive() .

SoundInitMusic()

void SoundInitMusic(
        MemHandle 		mh, 
        byte 		voices);

This routine initializes a pre-defined simple music buffer structure. If the music buffer is stored in a fixed block, you can call SoundAllocMusic() instead. This allows a music buffer stored in a block referenced by a pointer to be playable using SoundPlayMusic() .

SoundPlayMusic()

word	SoundPlayMusic( /* Returns SOUND_ERROR_... value */
        MemHandle 		mh, 
        word		priority,
        word 		tempo, 
        EndOfSongFlags		flags);

This routine plays a buffer of music previously initialized by SoundInitMusic() or allocated by SoundAllocMusic() . The priority value will determine whether your sound will play if other sounds are already occupying the voices--pass a value such as SP_STANDARD. The tempo value will be used to determine the length of a 1/128th note. If your music buffer contained any notes whose lengths were measured by SSDTT_TEMPO delta type, then you should set this value accordingly. The flags argument determines whether the music's handle should be automatically freed when the sound is done playing. You may pass either or both of the flags UNLOCK_ON_EOS or DESTROY_ON_EOS.

Include: sound.h

SoundPlayMusicNote()

word 	SoundPlayMusicNote( /* Returns a SOUND_ERROR_... value */
        MemHandle 		mh,				/* handle of note */
        word 		priority, 
        word		tempo,				
        EndOfSongFlags		flags);			

This routine plays a buffer of music previously allocated by SoundAllocMusicNote() --the return value of that function is passed as mh . The priority value will determine whether your sound will play if other sounds are already occupying the voices--pass a value such as SP_STANDARD. The tempo value will be used to determine the length of a 1/128th note. If your note's delta type is SSDTT_TEMPO, then you should set this value accordingly. The flags argument determines whether the notes's handle should be automatically freed when the note is done playing. You may pass either or both of the flags UNLOCK_ON_EOS or DESTROY_ON_EOS.

This routine returns true if the library was unavailable (i.e. if some other thread had grabbed the sound exclusive).

Include: sound.h


Up: GEOS SDK TechDocs | Up | Prev: SoundAllocMusic() ... | Next: SoundPlayToMusicStream() ...