22 #ifndef TITANIC_SOUND_MANAGER_H 23 #define TITANIC_SOUND_MANAGER_H 25 #include "titanic/core/list.h" 26 #include "titanic/support/simple_file.h" 27 #include "titanic/sound/audio_buffer.h" 28 #include "titanic/sound/proximity.h" 29 #include "titanic/sound/qmixer.h" 30 #include "titanic/sound/wave_file.h" 31 #include "titanic/true_talk/dialogue_file.h" 36 VOL_NORMAL = -1, VOL_QUIET = -2, VOL_VERY_QUIET = -3, VOL_MUTE = -4
48 double _speechPercent;
49 double _masterPercent;
50 double _parrotPercent;
101 virtual void proc9(
int handle) {}
114 virtual void setVolume(
int handle, uint volume, uint seconds) = 0;
134 virtual void setPolarPosition(
int handle,
double range,
double azimuth,
double elevation, uint panRate) {}
139 virtual bool isActive(
int handle) = 0;
210 double directionX,
double directionY,
double directionZ,
bool stopSounds) {}
241 _iChannel(0), _endFn(
nullptr), _talker(
nullptr) {}
243 ListItem(), _waveFile(waveFile), _iChannel(iChannel), _endFn(endFn), _talker(talker) {}
251 void add(
CWaveFile *waveFile,
int iChannel, CEndTalkerFn endFn,
TTtalker *talker);
256 void flushChannel(
int iChannel);
261 void flushChannel(
CWaveFile *waveFile,
int iChannel);
266 bool contains(
const CWaveFile *waveFile)
const;
280 PositioningMode _positioningMode;
282 Slot() : _waveFile(0), _isTimed(0), _ticks(0), _channel(-1),
283 _handle(0), _positioningMode(POSMODE_NONE) {}
289 uint _channelsVolume[16];
290 int _channelsMode[16];
297 void updateVolume(
int channel, uint panRate);
302 void updateVolumes();
307 static void soundFinished(
int iChannel,
CWaveFile *waveFile,
void *soundManager);
317 void setChannelVolume(
int iChannel, uint volume, uint mode);
322 int resetChannel(
int iChannel);
380 virtual void setCanFree(
int handle);
393 void setVolume(
int handle, uint volume, uint seconds)
override;
403 void setVectorPosition(
int handle,
double x,
double y,
double z, uint panRate)
override;
413 void setPolarPosition(
int handle,
double range,
double azimuth,
double elevation, uint panRate)
override;
459 double directionX,
double directionY,
double directionZ,
bool stopSounds)
override;
virtual void setListenerPosition(double posX, double posY, double posZ, double directionX, double directionY, double directionZ, bool stopSounds)
Definition: sound_manager.h:209
virtual void setPolarPosition(int handle, double range, double azimuth, double elevation, uint panRate)
Definition: sound_manager.h:134
virtual void postLoad()
Definition: sound_manager.h:189
virtual void stopChannel(int channel)=0
Definition: audio_buffer.h:32
Definition: proximity.h:36
virtual CWaveFile * loadSpeech(CDialogueFile *dialogueFile, int speechId)
Definition: sound_manager.h:67
virtual void setVolume(int handle, uint volume, uint seconds)=0
virtual void preLoad()
Definition: sound_manager.h:179
Definition: simple_file.h:49
virtual bool isActive(const CWaveFile *waveFile)
Definition: sound_manager.h:144
virtual void setMusicPercent(double percent)=0
void load(SimpleFile *file)
Definition: sound_manager.h:184
Definition: tt_talker.h:33
virtual void setParrotPercent(double percent)=0
double getMusicVolume() const
Definition: sound_manager.h:215
virtual void postSave()
Definition: sound_manager.h:204
virtual void stopAllChannels()=0
Definition: sound_manager.h:273
virtual uint getLatency() const
Definition: sound_manager.h:154
virtual void setSpeechPercent(double percent)=0
double getSpeechVolume() const
Definition: sound_manager.h:220
virtual bool isActive(int handle)=0
Definition: sound_manager.h:42
Definition: sound_manager.h:246
virtual void stopSound(int handle)=0
uint getModeVolume(VolumeMode mode)
virtual void setVectorPosition(int handle, double x, double y, double z, uint panRate)
Definition: sound_manager.h:124
virtual int playSound(CWaveFile &waveFile, CProximity &prox)=0
Definition: sound_manager.h:233
virtual CWaveFile * loadSound(const CString &name)
Definition: sound_manager.h:60
virtual CWaveFile * loadMusic(CAudioBuffer *buffer, DisposeAfterUse::Flag disposeAfterUse)
Definition: sound_manager.h:84
Definition: dialogue_file.h:51
Definition: wave_file.h:35
virtual CWaveFile * loadMusic(const CString &name)
Definition: sound_manager.h:77
void save(SimpleFile *file) const
Definition: sound_manager.h:199
virtual void setMasterPercent(double percent)=0
virtual void preSave()
Definition: sound_manager.h:194
virtual void waveMixPump()=0
double getParrotVolume() const
Definition: sound_manager.h:225