diff options
Diffstat (limited to 'engines/sword25/sfx/soundengine.h')
-rw-r--r-- | engines/sword25/sfx/soundengine.h | 126 |
1 files changed, 63 insertions, 63 deletions
diff --git a/engines/sword25/sfx/soundengine.h b/engines/sword25/sfx/soundengine.h index 35bab0c3d6..86efe4d3bd 100644 --- a/engines/sword25/sfx/soundengine.h +++ b/engines/sword25/sfx/soundengine.h @@ -23,7 +23,7 @@ * */ -/* +/* * This code is based on Broken Sword 2.5 engine * * Copyright (c) Malte Thiesen, Daniel Queteschiner and Michael Elsdoerfer @@ -67,7 +67,7 @@ public: // ----------------------------------------------------------------------------- // Enums and Types // ----------------------------------------------------------------------------- - + enum SOUND_TYPES { MUSIC = 0, SPEECH = 1, @@ -76,29 +76,29 @@ public: /** * The callback function of PlayDynamicSoundEx - * @param UserData User-specified pointer - * @param Data Pointer to the data buffer - * @param DataLength Length of the data to be written in bytes + * @param UserData User-specified pointer + * @param Data Pointer to the data buffer + * @param DataLength Length of the data to be written in bytes */ typedef void (*DynamicSoundReadCallback)(void *UserData, void *Data, unsigned int DataLength); // ----------------------------------------------------------------------------- // Constructor / destructor // ----------------------------------------------------------------------------- - - BS_SoundEngine(BS_Kernel* pKernel); + + BS_SoundEngine(BS_Kernel *pKernel); virtual ~BS_SoundEngine() {}; // -------------------------------------------------------------- // THIS METHOD MUST BE IMPLEMENTED BY THE SOUND ENGINE // -------------------------------------------------------------- - /** + /** * Initialises the sound engine - * @param SampleRate Specifies the sample rate to use. - * @param Channels The maximum number of channels. The default is 32. - * @return Returns true on success, otherwise false. - * @remark Calls to other methods may take place only if this + * @param SampleRate Specifies the sample rate to use. + * @param Channels The maximum number of channels. The default is 32. + * @return Returns true on success, otherwise false. + * @remark Calls to other methods may take place only if this * method was called successfully. */ virtual bool Init(unsigned int SampleRate, unsigned int Channels = 32) = 0; @@ -112,17 +112,17 @@ public: */ virtual void Update() = 0; - /** + /** * Sets the default volume for the different sound types - * @param Volume The default volume level (0 = off, 1 = full volume) - * @param Type The SoundType whose volume is to be changed + * @param Volume The default volume level (0 = off, 1 = full volume) + * @param Type The SoundType whose volume is to be changed */ virtual void SetVolume(float Volume, SOUND_TYPES Type) = 0; /** * Specifies the default volume of different sound types - * @param Type The SoundType - * @return Returns the standard sound volume for the given type + * @param Type The SoundType + * @return Returns the standard sound volume for the given type * (0 = off, 1 = full volume). */ virtual float GetVolume(SOUND_TYPES Type) = 0; @@ -139,115 +139,115 @@ public: /** * Pauses all sounds of a given layer. - * @param Layer The Sound Layer + * @param Layer The Sound Layer */ virtual void PauseLayer(unsigned int Layer) = 0; /** * Resumes all the sounds in a layer that was previously stopped with PauseLayer() - * @param Layer The Sound Layer + * @param Layer The Sound Layer */ virtual void ResumeLayer(unsigned int Layer) = 0; - + /** * Plays a sound - * @param FileName The filename of the sound to be played - * @param Type The type of sound - * @param Volume The volume of the sound (0 = off, 1 = full volume) - * @param Pan Panning (-1 = full left, 1 = right) - * @param Loop Indicates whether the sound should be looped - * @param LoopStart Indicates the starting loop point. If a value less than 0 is passed, the start + * @param FileName The filename of the sound to be played + * @param Type The type of sound + * @param Volume The volume of the sound (0 = off, 1 = full volume) + * @param Pan Panning (-1 = full left, 1 = right) + * @param Loop Indicates whether the sound should be looped + * @param LoopStart Indicates the starting loop point. If a value less than 0 is passed, the start * of the sound is used. - * @param LoopEnd Indicates the ending loop point. If a avlue is passed less than 0, the end of + * @param LoopEnd Indicates the ending loop point. If a avlue is passed less than 0, the end of * the sound is used. - * @param Layer The sound layer - * @return Returns true if the playback of the sound was started successfully. - * @remark If more control is needed over the playing, eg. changing the sound parameters + * @param Layer The sound layer + * @return Returns true if the playback of the sound was started successfully. + * @remark If more control is needed over the playing, eg. changing the sound parameters * for Volume and Panning, then PlaySoundEx should be used. */ virtual bool PlaySound(const Common::String &FileName, SOUND_TYPES Type, float Volume = 1.0f, float Pan = 0.0f, bool Loop = false, int LoopStart = -1, int LoopEnd = -1, unsigned int Layer = 0) = 0; /** * Plays a sound - * @param Type The type of sound - * @param Volume The volume of the sound (0 = off, 1 = full volume) - * @param Pan Panning (-1 = full left, 1 = right) - * @param Loop Indicates whether the sound should be looped - * @param LoopStart Indicates the starting loop point. If a value less than 0 is passed, the start + * @param Type The type of sound + * @param Volume The volume of the sound (0 = off, 1 = full volume) + * @param Pan Panning (-1 = full left, 1 = right) + * @param Loop Indicates whether the sound should be looped + * @param LoopStart Indicates the starting loop point. If a value less than 0 is passed, the start * of the sound is used. - * @param LoopEnd Indicates the ending loop point. If a avlue is passed less than 0, the end of + * @param LoopEnd Indicates the ending loop point. If a avlue is passed less than 0, the end of * the sound is used. - * @param Layer The sound layer - * @return Returns a handle to the sound. With this handle, the sound can be manipulated during playback. - * @remark If more control is needed over the playing, eg. changing the sound parameters + * @param Layer The sound layer + * @return Returns a handle to the sound. With this handle, the sound can be manipulated during playback. + * @remark If more control is needed over the playing, eg. changing the sound parameters * for Volume and Panning, then PlaySoundEx should be used. */ virtual unsigned int PlaySoundEx(const Common::String &FileName, SOUND_TYPES Type, float Volume = 1.0f, float Pan = 0.0f, bool Loop = false, int LoopStart = -1, int LoopEnd = -1, unsigned int Layer = 0) = 0; /** * Plays a sound generated at runtime - * @param ReadCallback A pointer to a callback function that is called when sound data is needed. + * @param ReadCallback A pointer to a callback function that is called when sound data is needed. * See the documentation for DynamicSoundReadCallback for more information. - * @param UserData A pointer to the data. These are passed to the callback function each time. + * @param UserData A pointer to the data. These are passed to the callback function each time. * If no such data is needed, this parameter can be set to NULL. - * @param Type The type of sound - * @param SampleRate The sample rate for the sound - * @param BitsPerSample The size of the sample in bits. This statement is independant of the number of + * @param Type The type of sound + * @param SampleRate The sample rate for the sound + * @param BitsPerSample The size of the sample in bits. This statement is independant of the number of * channels. Allowed values are 8, 16, 24, and 32. - * @param Channels The number of channels. Allowed values are 1 and 2. - * @param Volume The volume of the sound (0 = off, 1 = full volume) - * @param Pan Panning (-1 = full left, 1 = right) - * @param Layer The sound layer - * @return Returns a handle to the sound. With this handle, the sound can be manipulated during playback. - * @remark Dynamic sounds cannot be persisted. + * @param Channels The number of channels. Allowed values are 1 and 2. + * @param Volume The volume of the sound (0 = off, 1 = full volume) + * @param Pan Panning (-1 = full left, 1 = right) + * @param Layer The sound layer + * @return Returns a handle to the sound. With this handle, the sound can be manipulated during playback. + * @remark Dynamic sounds cannot be persisted. */ virtual unsigned int PlayDynamicSoundEx(DynamicSoundReadCallback ReadCallback, void *UserData, SOUND_TYPES Type, unsigned int SampleRate, unsigned int BitsPerSample, unsigned int Channels, float Volume = 1.0f, float Pan = 0.0f, unsigned int Layer = 0) = 0; /** * Sets the volume of a playing sound - * @param Handle The sound handle - * @param Volume The volume of the sound (0 = off, 1 = full volume) + * @param Handle The sound handle + * @param Volume The volume of the sound (0 = off, 1 = full volume) */ virtual void SetSoundVolume(unsigned int Handle, float Volume) = 0; /** * Sets the panning of a playing sound - * @param Handle The sound handle - * @param Pan Panning (-1 = full left, 1 = right) + * @param Handle The sound handle + * @param Pan Panning (-1 = full left, 1 = right) */ virtual void SetSoundPanning(unsigned int Handle, float Pan) = 0; /** * Pauses a playing sound - * @param Handle The sound handle + * @param Handle The sound handle */ virtual void PauseSound(unsigned int Handle) = 0; /** * Resumes a paused sound - * @param Handle The sound handle + * @param Handle The sound handle */ virtual void ResumeSound(unsigned int Handle) = 0; /** * Stops a playing sound - * @param Handle The sound handle - * @remark Calling this method invalidates the passed handle; it can no longer be used. + * @param Handle The sound handle + * @remark Calling this method invalidates the passed handle; it can no longer be used. */ virtual void StopSound(unsigned int Handle) = 0; /** * Returns whether a sound is paused - * @param Handle The sound handle - * @return Returns true if the sound is paused, false otherwise. + * @param Handle The sound handle + * @return Returns true if the sound is paused, false otherwise. */ virtual bool IsSoundPaused(unsigned int Handle) = 0; - + /** * Returns whether a sound is still playing. - * @param Handle The sound handle - * @return Returns true if the sound is playing, false otherwise. + * @param Handle The sound handle + * @return Returns true if the sound is playing, false otherwise. */ virtual bool IsSoundPlaying(unsigned int Handle) = 0; |