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