19 #ifndef SOUND_HANDLER_H
20 #define SOUND_HANDLER_H
31 #include <boost/scoped_ptr.hpp>
46 class StreamingSoundData;
106 virtual void stop_all_sounds();
121 virtual int create_sound(std::auto_ptr<SimpleBuffer>
data,
132 virtual void stopEventSound(
int sound_handle);
136 virtual void stopAllEventSounds();
144 virtual void delete_sound(
int sound_handle);
177 bool allowMultiple,
unsigned int inPoint = 0,
178 unsigned int outPoint =
179 std::numeric_limits<unsigned int>::max());
186 bool isSoundPlaying(
int id)
const;
196 virtual void set_volume(
int sound_handle,
int volume);
202 virtual unsigned int get_duration(
int sound_handle)
const;
209 virtual unsigned int tell(
int sound_handle)
const;
219 virtual int get_volume(
int sound_handle)
const;
231 virtual void stopStreamingSound(
int handle);
248 size_t sampleCount,
int seekSamples,
int streamId);
287 int getStreamBlock(
int handle)
const;
313 virtual void reset();
319 virtual void unmute();
324 virtual bool is_muted()
const;
327 virtual void pause() { _paused=
true; }
416 virtual void fetchSamples(boost::int16_t* to,
unsigned int nSamples);
443 virtual void mix(boost::int16_t* outSamples, boost::int16_t* inSamples,
444 unsigned int nSamples,
float volume) = 0;
451 void setAudioDump(
const std::string& wavefile);
456 bool streamingSound()
const;
476 virtual void plugInputStream(std::auto_ptr<InputStream> in);
479 virtual void unplugAllInputStreams();
482 bool hasInputStreams()
const;
487 virtual void delete_all_sounds();
492 size_t _soundsStarted;
495 size_t _soundsStopped;
506 typedef std::vector<EmbedSound*> Sounds;
513 typedef std::vector<StreamingSoundData*> StreamingSounds;
518 StreamingSounds _streamingSounds;
521 void stopEmbedSoundInstances(
EmbedSound& def);
526 typedef std::set<InputStream*> InputStreams;
531 InputStreams _inputStreams;
536 void unplugCompletedInputStreams();
538 boost::scoped_ptr<WAVWriter> _wavWriter;
547 #elif defined(SOUND_AHI)
550 #elif defined(SOUND_MKIT)
558 #endif // SOUND_HANDLER_H
int getFinalVolume() const
Sound output functions.
Definition: sound_handler.h:297
Definition: klash_part.cpp:331
Definition of an embedded sound.
Definition: EmbedSound.h:48
sound_handler * create_sound_handler_sdl(media::MediaHandler *m)
Definition: sound_handler_sdl.cpp:235
Sound mixer.
Definition: sound_handler.h:87
SimpleBuffer data
Definition: LocalConnection_as.cpp:153
size_t numSoundsStarted() const
Special test-fuction. Reports how many times a sound has been started.
Definition: sound_handler.h:388
Definition of an embedded sound.
Definition: StreamingSoundData.h:48
size_t numSoundsStopped() const
Special test-fuction. Reports how many times a sound has been stopped.
Definition: sound_handler.h:394
tuple v
Definition: test.py:11
bool isPaused() const
return true if audio is paused
Definition: sound_handler.h:333
sound_handler(media::MediaHandler *m)
Definition: sound_handler.h:460
#define DSOEXPORT
Definition: dsodefs.h:55
void setFinalVolume(int v)
Set the volume to apply to mixed output.
Definition: sound_handler.h:303
std::vector< SoundEnvelope > SoundEnvelopes
A vector of SoundEnvelope objects.
Definition: SoundEnvelope.h:60
unsigned long StreamBlockId
Identifier of a streaming sound block.
Definition: sound_handler.h:97
Definition: GnashKey.h:159
virtual void unpause()
gnash calls this to unpause audio
Definition: sound_handler.h:330
unsigned int(* aux_streamer_ptr)(void *udata, boost::int16_t *samples, unsigned int nSamples, bool &eof)
Definition: AuxStream.h:31
virtual void pause()
gnash calls this to pause audio
Definition: sound_handler.h:327