19 #ifndef SOUND_HANDLER_H 20 #define SOUND_HANDLER_H 46 class StreamingSoundData;
106 virtual void stop_all_sounds();
121 virtual int create_sound(std::unique_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);
273 void playStream(
int handle, StreamBlockId blockId);
287 int getStreamBlock(
int handle)
const;
313 virtual void reset();
324 bool is_muted()
const;
327 virtual void pause() { _paused=
true; }
416 virtual void fetchSamples(std::int16_t* to,
unsigned int nSamples);
443 virtual void mix(std::int16_t* outSamples, std::int16_t* inSamples,
444 unsigned int nSamples,
float volume);
451 void setAudioDump(
const std::string& wavefile);
456 bool streamingSound()
const;
476 virtual void plugInputStream(std::unique_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;
501 std::atomic<bool> _muted;
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 std::unique_ptr<WAVWriter> _wavWriter;
547 #elif defined(SOUND_AHI) 550 #elif defined(SOUND_MKIT) 558 #endif // SOUND_HANDLER_H
size_t numSoundsStarted() const
Special test-fuction. Reports how many times a sound has been started.
Definition: sound_handler.h:388
Definition: klash_part.cpp:331
Definition of an embedded sound.
Definition: EmbedSound.h:49
int getFinalVolume() const
Sound output functions.
Definition: sound_handler.h:297
sound_handler * create_sound_handler_mkit(media::MediaHandler *m)
Definition: sound_handler_mkit.cpp:269
unsigned int(* aux_streamer_ptr)(void *udata, std::int16_t *samples, unsigned int nSamples, bool &eof)
Definition: AuxStream.h:31
sound_handler * create_sound_handler_sdl(media::MediaHandler *m)
Definition: sound_handler_sdl.cpp:234
Sound mixer.
Definition: sound_handler.h:87
SimpleBuffer data
Definition: LocalConnection_as.cpp:151
Anonymous namespace for callbacks, local functions, event handlers etc.
Definition: dbus_ext.cpp:40
size_t numSoundsStopped() const
Special test-fuction. Reports how many times a sound has been stopped.
Definition: sound_handler.h:394
Definition of an embedded sound.
Definition: StreamingSoundData.h:47
sound_handler * create_sound_handler_aos4(media::MediaHandler *m)
Definition: sound_handler_ahi.cpp:259
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
A simple buffer of bytes.
Definition: SimpleBuffer.h:38
Definition: GnashKey.h:159
virtual void unpause()
gnash calls this to unpause audio
Definition: sound_handler.h:330
bool isPaused() const
return true if audio is paused
Definition: sound_handler.h:333
virtual void pause()
gnash calls this to pause audio
Definition: sound_handler.h:327