21 #ifndef SOUND_HANDLER_SDL_H
22 #define SOUND_HANDLER_SDL_H
27 #include <SDL_audio.h>
28 #include <boost/thread/mutex.hpp>
48 SDL_AudioSpec audioSpec;
60 mutable boost::mutex _mutex;
63 mutable boost::mutex _mutedMutex;
66 void mix(boost::int16_t* outSamples, boost::int16_t* inSamples,
67 unsigned int nSamples,
float volume);
86 static void sdl_audio_callback (
void *udata, Uint8 *stream,
int buffer_length_in);
103 size_t sample_count,
int seekSamples,
int streamId);
117 virtual void reset();
123 virtual int get_volume(
int sound_handle)
const;
126 virtual void set_volume(
int sound_handle,
int volume);
145 virtual void pause();
152 virtual unsigned int get_duration(
int sound_handle)
const;
155 virtual unsigned int tell(
int sound_handle)
const;
165 void fetchSamples(boost::int16_t* to,
unsigned int nSamples);
171 #endif // SOUND_HANDLER_SDL_H
void fetchSamples(boost::int16_t *to, unsigned int nSamples)
Fetch mixed samples.
Definition: sound_handler_sdl.cpp:241
Definition: klash_part.cpp:331
virtual int createStreamingSound(const media::SoundInfo &sinfo)
Streaming sound functions:
Definition: sound_handler_sdl.cpp:137
virtual void unmute()
Call this to unmute audio.
Definition: sound_handler_sdl.cpp:323
virtual int get_volume(int sound_handle) const
Gets the volume for a given sound buffer slot.
Definition: sound_handler_sdl.cpp:199
virtual void stop_all_sounds()
Mixed functions:
Definition: sound_handler_sdl.cpp:191
virtual void stopEventSound(int sound_handle)
Remove scheduled requests to play the specified sound buffer slot.
Definition: sound_handler_sdl.cpp:162
void plugInputStream(std::auto_ptr< InputStream > in)
Plug an InputStream to the mixer.
Definition: sound_handler_sdl.cpp:298
void unplugInputStream(InputStream *id)
Unplug an external InputStream from the mixer.
Definition: sound_handler_sdl.cpp:355
virtual void stopAllEventSounds()
Stop all instances of all playing event sounds.
Definition: sound_handler_sdl.cpp:169
virtual StreamBlockId addSoundBlock(std::auto_ptr< SimpleBuffer > buf, size_t sample_count, int seekSamples, int streamId)
Definition: sound_handler_sdl.cpp:152
Sound mixer.
Definition: sound_handler.h:87
virtual bool is_muted() const
Returns whether or not sound is muted.
Definition: sound_handler_sdl.cpp:330
SimpleBuffer data
Definition: LocalConnection_as.cpp:153
Anonymous namespace for callbacks, local functions, event handlers etc.
Definition: dbus_ext.cpp:40
virtual void mute()
Call this to mute audio.
Definition: sound_handler_sdl.cpp:316
virtual unsigned int tell(int sound_handle) const
Gets the playhead position in milliseconds of an event sound.
Definition: sound_handler_sdl.cpp:228
virtual media::SoundInfo * get_sound_info(int soundHandle) const
Returns a SoundInfo object for the sound with the given id.
Definition: sound_handler_sdl.cpp:214
virtual unsigned int get_duration(int sound_handle) const
Gets the duration in milliseconds of an event sound.
Definition: sound_handler_sdl.cpp:221
virtual void unpause()
gnash calls this to unpause audio
Definition: sound_handler_sdl.cpp:344
virtual void reset()
Discard all sound inputs (slots and aux streamers) and clear scheduling.
Definition: sound_handler_sdl.cpp:116
virtual void pause()
gnash calls this to pause audio
Definition: sound_handler_sdl.cpp:337
virtual void delete_sound(int sound_handle)
Discard the sound data for an embedded event sound.
Definition: sound_handler_sdl.cpp:184
SDL-based sound_handler.
Definition: sound_handler_sdl.h:43
~SDL_sound_handler()
Definition: sound_handler_sdl.cpp:122
virtual void stopStreamingSound(int sound_handle)
Remove scheduled requests to play the specified sound buffer slot.
Definition: sound_handler_sdl.cpp:176
unsigned long StreamBlockId
Identifier of a streaming sound block.
Definition: sound_handler.h:97
Definition: GnashKey.h:159
SDL_sound_handler(media::MediaHandler *m)
Definition: sound_handler_sdl.cpp:107
virtual void set_volume(int sound_handle, int volume)
Sets the volume for a given event sound.
Definition: sound_handler_sdl.cpp:207
virtual int create_sound(std::auto_ptr< SimpleBuffer > data, const media::SoundInfo &sinfo)
Event sound functions:
Definition: sound_handler_sdl.cpp:144