Ogre Video and Audio Plugins  master
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Modules Pages
OgreOggSound::OgreOggISound Class Referenceabstract

A single sound object. More...

#include <OgreOggISound.h>

Inheritance diagram for OgreOggSound::OgreOggISound:

Classes

class  SoundListener
 Listener callback. More...
 

Public Member Functions

void play (bool immediate=false)
 
void pause (bool immediate=false)
 
void stop (bool immediate=false)
 
void loop (bool loop)
 
bool isLooping ()
 
virtual void setLoopOffset (float startTime)
 
float getLoopOffset ()
 
virtual void setSource (ALuint &src)=0
 
void startFade (bool dir, float fadeTime, FadeControl actionOnCompletion=OgreOggSound::FC_NONE)
 
bool isTemporary () const
 
virtual bool isMono ()=0
 
void markTemporary ()
 
void disable3D (bool disable)
 
bool is3Ddisabled ()
 
virtual void setPlayPosition (float seconds)
 
virtual float getPlayPosition () const
 
SoundState getState () const
 
bool isPlaying () const
 
bool isPaused () const
 
bool isStopped () const
 
bool isRelativeToListener () const
 
void setGiveUpSourceOnStop (bool giveup=false)
 
void setPosition (float posx, float posy, float posz)
 
void setPosition (const Ogre::Vector3 &pos)
 
void setDirection (float dirx, float diry, float dirz)
 
void setDirection (const Ogre::Vector3 &dir)
 
void setVelocity (float velx, float vely, float velz)
 
void setVelocity (const Ogre::Vector3 &vel)
 
void setVolume (float gain)
 
float getVolume () const
 
void setMaxVolume (float maxGain)
 
float getMaxVolume ()
 
void setMinVolume (float minGain)
 
float getMinVolume ()
 
void setConeAngles (float insideAngle=360.f, float outsideAngle=360.f)
 
float getConeInsideAngle ()
 
float getConeOutsideAngle ()
 
void setOuterConeVolume (float gain=0.f)
 
float getOuterConeVolume ()
 
void setMaxDistance (float maxDistance)
 
const float getMaxDistance () const
 
void setRolloffFactor (float rolloffFactor)
 
const float getRolloffFactor () const
 
void setReferenceDistance (float referenceDistance)
 
const float getReferenceDistance () const
 
void setPitch (float pitch)
 
const float getPitch () const
 
void setRelativeToListener (bool relative)
 
const Ogre::Vector3getPosition () const
 
const Ogre::Vector3getDirection () const
 
bool isFading () const
 
virtual void update (float fTime)
 
ALuint getSource () const
 
const Ogre::StringgetName (void) const
 
virtual const Ogre::StringgetFileName (void) const
 
Ogre::uint8 getPriority () const
 
void setPriority (Ogre::uint8 priority)
 
bool addCuePoint (float seconds)
 
void removeCuePoint (unsigned short index)
 
void clearCuePoints ()
 
void setCuePoint (unsigned short index)
 
float getCuePoint (unsigned short index)
 
unsigned int getNumCuePoints ()
 
float getAudioLength () const
 
virtual const Ogre::StringgetMovableType (void) const
 
virtual const Ogre::AxisAlignedBoxgetBoundingBox (void) const
 
virtual float getBoundingRadius (void) const
 
Ogre::SceneManagergetSceneManager () const
 
void setListener (SoundListener *listener)
 
void _setSharedProperties (sharedAudioBuffer *buffer)
 
void _getSharedProperties (BufferListPtr &buffers, float &length, ALenum &format)
 
- Public Member Functions inherited from Ogre::MovableObject
 MovableObject ()
 
 MovableObject (const String &name)
 
virtual ~MovableObject ()
 
MovableObjectFactory_getCreator (void) const
 
LightList_getLightList ()
 
SceneManager_getManager (void) const
 
virtual const Affine3_getParentNodeFullTransform (void) const
 
virtual void _notifyCreator (MovableObjectFactory *fact)
 
virtual void _notifyCurrentCamera (Camera *cam)
 
virtual void _notifyManager (SceneManager *man)
 
virtual void _releaseManualHardwareResources ()
 
virtual void _restoreManualHardwareResources ()
 
void addQueryFlags (uint32 flags)
 
void addVisibilityFlags (uint32 flags)
 
void detachFromParent (void)
 
Real getBoundingRadiusScaled () const
 
bool getCastShadows (void) const
 
const AxisAlignedBoxgetDarkCapBounds (const Light &light, Real dirLightExtrusionDist) const override
 
EdgeDatagetEdgeList (void)
 
const AxisAlignedBoxgetLightCapBounds (void) const override
 
uint32 getLightMask () const
 
ListenergetListener (void) const
 
const StringgetName (void) const
 
NodegetParentNode (void) const
 
SceneNodegetParentSceneNode (void) const
 
Real getPointExtrusionDistance (const Light *l) const
 
virtual uint32 getQueryFlags (void) const
 
bool getReceivesShadows ()
 
Real getRenderingDistance (void) const
 
Real getRenderingMinPixelSize () const
 
uint8 getRenderQueueGroup (void) const
 
const ShadowRenderableListgetShadowVolumeRenderableList (ShadowTechnique shadowTechnique, const Light *light, HardwareIndexBufferSharedPtr *indexBuffer, size_t *indexBufferUsedSize, bool extrudeVertices, Real extrusionDist, unsigned long flags=0)
 
virtual uint32 getTypeFlags (void) const
 
const AnygetUserAny (void) const
 
UserObjectBindingsgetUserObjectBindings ()
 
const UserObjectBindingsgetUserObjectBindings () const
 
virtual uint32 getVisibilityFlags (void) const
 
bool getVisible (void) const
 
virtual const AxisAlignedBoxgetWorldBoundingBox (bool derive=false) const
 
virtual const SpheregetWorldBoundingSphere (bool derive=false) const
 
bool isAttached (void) const
 
bool isDebugDisplayEnabled (void) const
 
virtual bool isInScene (void) const
 
bool isParentTagPoint () const
 
virtual bool isVisible (void) const
 
const LightListqueryLights (void) const
 
void removeQueryFlags (uint32 flags)
 
void removeVisibilityFlags (uint32 flags)
 
void setCastShadows (bool enabled)
 
void setDebugDisplayEnabled (bool enabled)
 
void setLightMask (uint32 lightMask)
 
void setListener (Listener *listener)
 
void setQueryFlags (uint32 flags)
 
void setRenderingDistance (Real dist)
 
void setRenderingMinPixelSize (Real pixelSize)
 
virtual void setRenderQueueGroup (uint8 queueID)
 
virtual void setRenderQueueGroupAndPriority (uint8 queueID, ushort priority)
 
void setUserAny (const Any &anything)
 
void setVisibilityFlags (uint32 flags)
 
void setVisible (bool visible)
 
- Public Member Functions inherited from Ogre::ShadowCaster
virtual ~ShadowCaster ()
 
virtual ShadowRenderableListIterator getShadowVolumeRenderableIterator (ShadowTechnique shadowTechnique, const Light *light, HardwareIndexBufferSharedPtr *indexBuffer, size_t *indexBufferUsedSize, bool extrudeVertices, Real extrusionDistance, unsigned long flags=0)
 
bool hasEdgeList ()
 
- Public Member Functions inherited from Ogre::AnimableObject
 AnimableObject ()
 
virtual ~AnimableObject ()
 
virtual AnimableValuePtr createAnimableValue (const String &valueName)
 
const StringVectorgetAnimableValueNames (void) const
 

Protected Member Functions

 OgreOggISound (const Ogre::String &name, Ogre::SceneManager *scnMgr)
 
virtual ~OgreOggISound ()
 
virtual void _openImpl (Ogre::DataStreamPtr &fileStream)=0
 
virtual void _openImpl (const Ogre::String &fName, sharedAudioBuffer *buffer=0)
 
virtual void _playImpl ()=0
 
virtual void _pauseImpl ()=0
 
virtual void _stopImpl ()=0
 
virtual void _release ()=0
 
virtual void _updateRenderQueue (Ogre::RenderQueue *queue)
 
virtual void _notifyAttached (Ogre::Node *node, bool isTagPoint=false)
 
virtual void _notifyMoved (void)
 
virtual void visitRenderables (Ogre::Renderable::Visitor *visitor, bool debugRenderables)
 
void _initSource ()
 
void _markPlayPosition ()
 
void _recoverPlayPosition ()
 
void _updateFade (float fTime=0.f)
 
virtual void _updateAudioBuffers ()=0
 
virtual void _prebuffer ()=0
 
virtual bool _queryBufferInfo ()=0
 

Protected Attributes

float mFadeTimer
 
float mFadeTime
 
float mFadeInitVol
 
float mFadeEndVol
 
bool mFade
 
FadeControl mFadeEndAction
 
Ogre::DataStreamPtr mAudioStream
 
ov_callbacks mOggCallbacks
 
SoundListenermSoundListener
 
size_t mBufferSize
 
ALuint mSource
 
Ogre::SceneManagermScnMgr
 
Ogre::uint8 mPriority
 
Ogre::Vector3 mPosition
 
Ogre::Vector3 mDirection
 
Ogre::Vector3 mVelocity
 
float mGain
 
float mMaxGain
 
float mMinGain
 
float mMaxDistance
 
float mRolloffFactor
 
float mReferenceDistance
 
float mPitch
 
float mOuterConeGain
 
float mInnerConeAngle
 
float mOuterConeAngle
 
float mPlayTime
 
Ogre::String mName
 
SoundState mState
 
bool mLoop
 
bool mDisable3D
 
bool mGiveUpSource
 
bool mStream
 
bool mSourceRelative
 
bool mLocalTransformDirty
 
bool mPlayPosChanged
 
bool mSeekable
 
bool mTemporary
 
bool mInitialised
 
Ogre::uint8 mAwaitingDestruction
 
BufferListPtr mBuffers
 
ALenum mFormat
 
unsigned long mAudioOffset
 
unsigned long mAudioEnd
 
float mLoopOffset
 
float mLoopStart
 
ALfloat mPlayPos
 
std::deque< float > mCuePoints
 

Friends

class OgreOggSoundManager
 

Additional Inherited Members

- Public Types inherited from Ogre::ShadowCaster
typedef std::vector< ShadowRenderable * > ShadowRenderableList
 
typedef VectorIterator< ShadowRenderableListShadowRenderableListIterator
 
- Static Public Member Functions inherited from Ogre::MovableObject
static uint32 getDefaultQueryFlags ()
 
static uint32 getDefaultVisibilityFlags ()
 
static void setDefaultQueryFlags (uint32 flags)
 
static void setDefaultVisibilityFlags (uint32 flags)
 
- Static Public Member Functions inherited from Ogre::ShadowCaster
static void clearShadowRenderableList (ShadowRenderableList &shadowRenderables)
 
static void extrudeVertices (const HardwareVertexBufferSharedPtr &vertexBuffer, size_t originalVertexCount, const Vector4 &lightPos, Real extrudeDist)
 

Detailed Description

A single sound object.

provides functions for setting audio properties on a 3D sound as well as stop/pause/play operations.

Constructor & Destructor Documentation

◆ OgreOggISound()

OgreOggSound::OgreOggISound::OgreOggISound ( const Ogre::String name,
Ogre::SceneManager scnMgr 
)
protected

Superclass describing a single sound object.

Parameters
nameName of sound within manager
scnMgrSceneManager which created this sound (if the sound was created through the plugin method createMovableobject()).

◆ ~OgreOggISound()

virtual OgreOggSound::OgreOggISound::~OgreOggISound ( )
protectedvirtual

Superclass destructor.

Member Function Documentation

◆ _getSharedProperties()

void OgreOggSound::OgreOggISound::_getSharedProperties ( BufferListPtr buffers,
float &  length,
ALenum &  format 
)

Gets properties of a shared resource.

Remarks
Gets a number of properties relating to audio of a shared resource.
Parameters
buffersReference to an array of OpenAL buffers
lengthReference to an object to store audio length
formatReference to an object to store buffer format

◆ _initSource()

void OgreOggSound::OgreOggISound::_initSource ( )
protected

Inits source object

Remarks
Initialises all the source objects states ready for playback.

◆ _markPlayPosition()

void OgreOggSound::OgreOggISound::_markPlayPosition ( )
protected

Stores the current play position of the sound

Remarks
Only for static sounds at present so that when re-activated it begins exactly where it left off.

◆ _notifyAttached()

virtual void OgreOggSound::OgreOggISound::_notifyAttached ( Ogre::Node node,
bool  isTagPoint = false 
)
protectedvirtual

Notifys object its been attached to a node

Remarks
Overridden from MovableObject.

Reimplemented from Ogre::MovableObject.

◆ _notifyMoved()

virtual void OgreOggSound::OgreOggISound::_notifyMoved ( void  )
protectedvirtual

Notifys object its been moved

Remarks
Overridden from MovableObject.

Reimplemented from Ogre::MovableObject.

◆ _openImpl() [1/2]

virtual void OgreOggSound::OgreOggISound::_openImpl ( const Ogre::String fName,
sharedAudioBuffer buffer = 0 
)
inlineprotectedvirtual

Open implementation.

Remarks
Abstract function Optional opening function for (Static sounds only)

Reimplemented in OgreOggSound::OgreOggStaticWavSound, and OgreOggSound::OgreOggStaticSound.

◆ _openImpl() [2/2]

virtual void OgreOggSound::OgreOggISound::_openImpl ( Ogre::DataStreamPtr fileStream)
protectedpure virtual

◆ _pauseImpl()

virtual void OgreOggSound::OgreOggISound::_pauseImpl ( )
protectedpure virtual

◆ _playImpl()

virtual void OgreOggSound::OgreOggISound::_playImpl ( )
protectedpure virtual

◆ _prebuffer()

virtual void OgreOggSound::OgreOggISound::_prebuffer ( )
protectedpure virtual

Prefills buffers with audio data.

Remarks
Loads audio data from the stream into the predefined data buffers and queues them onto the source ready for playback.

Implemented in OgreOggSound::OgreOggStreamWavSound, OgreOggSound::OgreOggStreamSound, OgreOggSound::OgreOggStreamBufferSound, OgreOggSound::OgreOggStaticWavSound, and OgreOggSound::OgreOggStaticSound.

◆ _queryBufferInfo()

virtual bool OgreOggSound::OgreOggISound::_queryBufferInfo ( )
protectedpure virtual

Calculates buffer size and format.

Remarks
Calculates a block aligned buffer size of 250ms using sound properties.

Implemented in OgreOggSound::OgreOggStreamWavSound, OgreOggSound::OgreOggStreamSound, OgreOggSound::OgreOggStreamBufferSound, OgreOggSound::OgreOggStaticWavSound, and OgreOggSound::OgreOggStaticSound.

◆ _recoverPlayPosition()

void OgreOggSound::OgreOggISound::_recoverPlayPosition ( )
protected

Sets the previous play position of the sound

Remarks
Uses a previously stored play position to ensure sound playback starts where it left off

◆ _release()

virtual void OgreOggSound::OgreOggISound::_release ( )
protectedpure virtual

◆ _setSharedProperties()

void OgreOggSound::OgreOggISound::_setSharedProperties ( sharedAudioBuffer buffer)

Sets properties of a shared resource.

Remarks
Sets a number of properties relating to audio of a shared resource.
Parameters
bufferPointer to the shared buffer to copy the properties from.

◆ _stopImpl()

virtual void OgreOggSound::OgreOggISound::_stopImpl ( )
protectedpure virtual

◆ _updateAudioBuffers()

virtual void OgreOggSound::OgreOggISound::_updateAudioBuffers ( )
protectedpure virtual

◆ _updateFade()

void OgreOggSound::OgreOggISound::_updateFade ( float  fTime = 0.f)
protected

Updates a fade

Remarks
Updates a fade action.

◆ _updateRenderQueue()

virtual void OgreOggSound::OgreOggISound::_updateRenderQueue ( Ogre::RenderQueue queue)
protectedvirtual

Updates RenderQueue

Remarks
Overridden from MovableObject.

Implements Ogre::MovableObject.

◆ addCuePoint()

bool OgreOggSound::OgreOggISound::addCuePoint ( float  seconds)

Adds a time position in a sound as a cue point

Remarks
Allows the setting of a 'jump-to' point within an audio file. Returns true on success.
Parameters
secondsCue point in seconds

◆ clearCuePoints()

void OgreOggSound::OgreOggISound::clearCuePoints ( )
inline

Clears entire list of cue points

◆ disable3D()

void OgreOggSound::OgreOggISound::disable3D ( bool  disable)

Allows switchable spatialisation for this sound.

Remarks
Switch's spatialisation on/off for mono sounds, no-effect for stereo sounds.
Note
If disabling spatialisation, reference distance is set to 1 and Positon is set to ZERO, so may need resetting should spatialisation be re-enabled later.
Note also that node inherited positioning/orientation is disabled in this mode, however manual positioning/orientation is still available allowing some control over speaker output.

◆ getAudioLength()

float OgreOggSound::OgreOggISound::getAudioLength ( ) const
inline

Gets the length of the audio file in seconds

Remarks
Only valid after file has been opened AND file is seekable.

◆ getBoundingBox()

virtual const Ogre::AxisAlignedBox& OgreOggSound::OgreOggISound::getBoundingBox ( void  ) const
virtual

Gets bounding box

Remarks
Overridden from MovableObject.

Implements Ogre::MovableObject.

◆ getBoundingRadius()

virtual float OgreOggSound::OgreOggISound::getBoundingRadius ( void  ) const
virtual

Gets bounding radius

Remarks
Overridden from MovableObject.

Implements Ogre::MovableObject.

◆ getConeInsideAngle()

float OgreOggSound::OgreOggISound::getConeInsideAngle ( )

Gets sounds cone inside angle

Remarks
This function gets the inside angle (in degrees) of the sound cone used by this sound.

◆ getConeOutsideAngle()

float OgreOggSound::OgreOggISound::getConeOutsideAngle ( )

Gets sounds cone outside angle

Remarks
This function gets the outside angle (in degrees) of the sound cone used by this sound.

◆ getCuePoint()

float OgreOggSound::OgreOggISound::getCuePoint ( unsigned short  index)

Gets a previously set cue point by index

Parameters
indexPosition in cue point list to get

◆ getDirection()

const Ogre::Vector3& OgreOggSound::OgreOggISound::getDirection ( ) const
inline

Gets the sounds direction

◆ getFileName()

virtual const Ogre::String& OgreOggSound::OgreOggISound::getFileName ( void  ) const
inlinevirtual

Gets the sounds file name

Reimplemented in OgreOggSound::OgreOggStaticWavSound, and OgreOggSound::OgreOggStaticSound.

◆ getLoopOffset()

float OgreOggSound::OgreOggISound::getLoopOffset ( )
inline

Gets the start point of a loopable section of audio in seconds.

◆ getMaxDistance()

const float OgreOggSound::OgreOggISound::getMaxDistance ( ) const

Gets sounds maximum distance

Remarks
Returns -1 on error

◆ getMaxVolume()

float OgreOggSound::OgreOggISound::getMaxVolume ( )

Gets sounds maximum attenuation volume

Remarks
This function gets the maximum volume level of the sound when closest to the listener.

◆ getMinVolume()

float OgreOggSound::OgreOggISound::getMinVolume ( )

Gets sounds minimum attenuation volume

Remarks
This function gets the minimum volume level of the sound when furthest away from the listener.

◆ getMovableType()

virtual const Ogre::String& OgreOggSound::OgreOggISound::getMovableType ( void  ) const
virtual

Gets movable type string

Remarks
Overridden from MovableObject.

Implements Ogre::MovableObject.

◆ getName()

const Ogre::String& OgreOggSound::OgreOggISound::getName ( void  ) const
inline

Gets the sounds name

◆ getNumCuePoints()

unsigned int OgreOggSound::OgreOggISound::getNumCuePoints ( )
inline

Returns number of cue points

◆ getOuterConeVolume()

float OgreOggSound::OgreOggISound::getOuterConeVolume ( )

Gets sounds outer cone volume

Remarks
This function gets the volume level heard at the outer cone angle.

◆ getPitch()

const float OgreOggSound::OgreOggISound::getPitch ( ) const

Gets sounds pitch

Remarks
Returns -1 on error

◆ getPlayPosition()

virtual float OgreOggSound::OgreOggISound::getPlayPosition ( ) const
virtual

Gets the position of the playback cursor in seconds

Reimplemented in OgreOggSound::OgreOggStreamWavSound, OgreOggSound::OgreOggStreamSound, and OgreOggSound::OgreOggStreamBufferSound.

◆ getPosition()

const Ogre::Vector3& OgreOggSound::OgreOggISound::getPosition ( ) const
inline

Gets sounds position

◆ getPriority()

Ogre::uint8 OgreOggSound::OgreOggISound::getPriority ( ) const
inline

Gets the sounds priority

◆ getReferenceDistance()

const float OgreOggSound::OgreOggISound::getReferenceDistance ( ) const

Gets sounds reference distance

Remarks
Returns -1 on error

◆ getRolloffFactor()

const float OgreOggSound::OgreOggISound::getRolloffFactor ( ) const

Gets sounds rolloff factor

Remarks
Returns -1 on error

◆ getSceneManager()

Ogre::SceneManager* OgreOggSound::OgreOggISound::getSceneManager ( ) const
inline

Gets the SceneManager pointer registered at creation.

Remarks
This will only be set if the sound was created through the plugin method createMovableobject().

◆ getSource()

ALuint OgreOggSound::OgreOggISound::getSource ( ) const
inline

Gets the sounds source

◆ getState()

SoundState OgreOggSound::OgreOggISound::getState ( ) const
inline

Gets the current state the sound is in

◆ getVolume()

float OgreOggSound::OgreOggISound::getVolume ( ) const

Gets sounds volume

Remarks
Gets the current gain value.

◆ is3Ddisabled()

bool OgreOggSound::OgreOggISound::is3Ddisabled ( )

Queries switchable spatialisation for this sound.

Remarks
Get whether spatialisation is on/off for mono sounds (for stereo sounds the effect does not apply).

◆ isFading()

bool OgreOggSound::OgreOggISound::isFading ( ) const
inline

Returns fade status.

◆ isLooping()

bool OgreOggSound::OgreOggISound::isLooping ( )
inline

Gets looping status.

Remarks
Gets whether the looping status is enabled

◆ isMono()

virtual bool OgreOggSound::OgreOggISound::isMono ( )
pure virtual

◆ isPaused()

bool OgreOggSound::OgreOggISound::isPaused ( ) const
inline

Returns pause status.

Remarks
Checks for a valid source before checking the state value

◆ isPlaying()

bool OgreOggSound::OgreOggISound::isPlaying ( ) const
inline

Returns play status.

Remarks
Checks for a valid source before checking the state value

◆ isRelativeToListener()

bool OgreOggSound::OgreOggISound::isRelativeToListener ( ) const
inline

Returns position status.

Remarks
Returns whether position is local to listener or in world-space

◆ isStopped()

bool OgreOggSound::OgreOggISound::isStopped ( ) const
inline

Returns stop status.

Remarks
Checks for a valid source before checking the state value

◆ isTemporary()

bool OgreOggSound::OgreOggISound::isTemporary ( ) const
inline

Returns whether this sound is temporary

◆ loop()

void OgreOggSound::OgreOggISound::loop ( bool  loop)
inline

Sets looping status.

Remarks
Parameters
loopBoolean: true == loop

◆ markTemporary()

void OgreOggSound::OgreOggISound::markTemporary ( )
inline

Marks sound as temporary

Remarks
Auto-destroys itself after finishing playing.

◆ pause()

void OgreOggSound::OgreOggISound::pause ( bool  immediate = false)

Pauses sound.

◆ play()

void OgreOggSound::OgreOggISound::play ( bool  immediate = false)

Plays sound.

◆ removeCuePoint()

void OgreOggSound::OgreOggISound::removeCuePoint ( unsigned short  index)

Removes a cue point

◆ setConeAngles()

void OgreOggSound::OgreOggISound::setConeAngles ( float  insideAngle = 360.f,
float  outsideAngle = 360.f 
)

Sets sounds cone angles

Remarks
This value sets the angles of the sound cone used by this sound.
Parameters
insideAngleAngle over which the volume is at maximum (in degrees)
outsideAngleAngle over which the volume is at minimum (in degrees)

◆ setCuePoint()

void OgreOggSound::OgreOggISound::setCuePoint ( unsigned short  index)

Shifts the play position to a previously set cue point position.

Parameters
indexPosition in cue point list to apply

◆ setDirection() [1/2]

void OgreOggSound::OgreOggISound::setDirection ( const Ogre::Vector3 dir)

Sets sounds direction.

Parameters
dir3D vector direction

◆ setDirection() [2/2]

void OgreOggSound::OgreOggISound::setDirection ( float  dirx,
float  diry,
float  dirz 
)

Sets sounds direction.

Parameters
dirxx coord
diryy coord
dirzz coord

◆ setGiveUpSourceOnStop()

void OgreOggSound::OgreOggISound::setGiveUpSourceOnStop ( bool  giveup = false)
inline

Sets whether source is given up when stopped.

Remarks
This flag indicates that the sound should immediately give up its source if finished playing or manually stopped. Useful for infrequent sounds or sounds which only play once. Allows other sounds immediate access to a playable source object.
Parameters
giveupIf true, releases source immediately (default: false)

◆ setListener()

void OgreOggSound::OgreOggISound::setListener ( SoundListener listener)
inline

Sets a listener object to be notified of events.

Remarks
Allows state changes to be signaled to an interested party.
Parameters
listenerListener object pointer.

◆ setLoopOffset()

virtual void OgreOggSound::OgreOggISound::setLoopOffset ( float  startTime)
inlinevirtual

Sets the start point of a loopable section of audio.

Remarks
Allows user to define any start point for a loopable sound, by default this would be 0, or the entire audio data, but this function can be used to offset the start of the loop.
Parameters
startTimePosition in seconds to offset the loop point.
Note
The sound will start playback from the beginning of the audio data but upon looping, if set, it will loop back to the new offset position.
(Streamed sounds ONLY)

Reimplemented in OgreOggSound::OgreOggStreamWavSound, and OgreOggSound::OgreOggStreamSound.

◆ setMaxDistance()

void OgreOggSound::OgreOggISound::setMaxDistance ( float  maxDistance)

Sets sounds maximum distance

Remarks
This value sets the maximum distance at which attenuation is stopped. Beyond this distance the volume remains constant.
Parameters
maxDistanceDistance.

◆ setMaxVolume()

void OgreOggSound::OgreOggISound::setMaxVolume ( float  maxGain)

Sets sounds maximum attenuation volume

Remarks
This value sets the maximum volume level of the sound when closest to the listener.
Parameters
maxGainVolume scalar (0..1)

◆ setMinVolume()

void OgreOggSound::OgreOggISound::setMinVolume ( float  minGain)

Sets sounds minimum attenuation volume

Remarks
This value sets the minimum volume level of the sound when furthest away from the listener.
Parameters
minGainVolume scalar (0..1)

◆ setOuterConeVolume()

void OgreOggSound::OgreOggISound::setOuterConeVolume ( float  gain = 0.f)

Sets sounds outer cone volume

Remarks
This value sets the volume level heard at the outer cone angle. Usually 0 so no sound heard when not within sound cone.
Parameters
gainVolume scalar (0..1)

◆ setPitch()

void OgreOggSound::OgreOggISound::setPitch ( float  pitch)

Sets sounds pitch

Remarks
This affects the playback speed of the sound
Parameters
pitchPitch (>0).

◆ setPlayPosition()

virtual void OgreOggSound::OgreOggISound::setPlayPosition ( float  seconds)
virtual

Sets the position of the playback cursor in seconds

Parameters
secondsPlay position in seconds

Reimplemented in OgreOggSound::OgreOggStreamWavSound, OgreOggSound::OgreOggStreamSound, and OgreOggSound::OgreOggStreamBufferSound.

◆ setPosition() [1/2]

void OgreOggSound::OgreOggISound::setPosition ( const Ogre::Vector3 pos)

Sets sounds position.

Parameters
pos3D vector position

◆ setPosition() [2/2]

void OgreOggSound::OgreOggISound::setPosition ( float  posx,
float  posy,
float  posz 
)

Sets sounds position.

Parameters
posxx position
posyy position
poszz position

◆ setPriority()

void OgreOggSound::OgreOggISound::setPriority ( Ogre::uint8  priority)
inline

Sets the sounds priority

Remarks
This can be used to specify a priority to the sound which will be checked when re-using sources. Higher priorities will tend to keep their sources.
Parameters
priorityPriority (between 0..255)

◆ setReferenceDistance()

void OgreOggSound::OgreOggISound::setReferenceDistance ( float  referenceDistance)

Sets sounds reference distance

Remarks
This value sets the half-volume distance. The distance at which the volume would be reduced by half.
Parameters
referenceDistanceDistance (>0).

◆ setRelativeToListener()

void OgreOggSound::OgreOggISound::setRelativeToListener ( bool  relative)

Sets whether the positional information is relative to the listener

Remarks
This specifies whether the sound is attached to listener or in world-space. Default: world-space
Parameters
relativeBoolean yes/no.

◆ setRolloffFactor()

void OgreOggSound::OgreOggISound::setRolloffFactor ( float  rolloffFactor)

Sets sounds rolloff factor

Remarks
This value sets the rolloff factor applied to the attenuation of the volume over distance. Effectively scales the volume change affect.
Parameters
rolloffFactorFactor (>0).

◆ setSource()

virtual void OgreOggSound::OgreOggISound::setSource ( ALuint &  src)
pure virtual

◆ setVelocity() [1/2]

void OgreOggSound::OgreOggISound::setVelocity ( const Ogre::Vector3 vel)

Sets sounds velocity.

Parameters
vel3D vector velocity

◆ setVelocity() [2/2]

void OgreOggSound::OgreOggISound::setVelocity ( float  velx,
float  vely,
float  velz 
)

Sets sounds velocity.

Parameters
velxx velocity
velyy velocity
velzz velocity

◆ setVolume()

void OgreOggSound::OgreOggISound::setVolume ( float  gain)

Sets sounds volume

Remarks
Sets sounds current gain value (0..1).
Parameters
gainvolume scalar.

◆ startFade()

void OgreOggSound::OgreOggISound::startFade ( bool  dir,
float  fadeTime,
FadeControl  actionOnCompletion = OgreOggSound::FC_NONE 
)

Starts a fade in/out of the sound volume

Remarks
Triggers a fade in/out of the sounds volume over time. Uses the current volume as the initial level to fade from, then either 0 or mMaxGain will be used as the fade to level.
Parameters
dirDirection to fade. (true=in | false=out)
fadeTimeTime over which to fade (>0)
actionOnCompletionOptional action to perform when fading has finished (default: NONE)

◆ stop()

void OgreOggSound::OgreOggISound::stop ( bool  immediate = false)

Stops sound.

◆ update()

virtual void OgreOggSound::OgreOggISound::update ( float  fTime)
virtual

Updates sund

Remarks
Updates sounds position, buffers and state
Parameters
fTimeElapsed frametime.

◆ visitRenderables()

virtual void OgreOggSound::OgreOggISound::visitRenderables ( Ogre::Renderable::Visitor visitor,
bool  debugRenderables 
)
protectedvirtual

Renderable callback

Remarks
Overridden function from MovableObject.

Implements Ogre::MovableObject.

Friends And Related Function Documentation

◆ OgreOggSoundManager

friend class OgreOggSoundManager
friend

Member Data Documentation

◆ mAudioEnd

unsigned long OgreOggSound::OgreOggISound::mAudioEnd
protected

◆ mAudioOffset

unsigned long OgreOggSound::OgreOggISound::mAudioOffset
protected

◆ mAudioStream

Ogre::DataStreamPtr OgreOggSound::OgreOggISound::mAudioStream
protected

◆ mAwaitingDestruction

Ogre::uint8 OgreOggSound::OgreOggISound::mAwaitingDestruction
protected

◆ mBuffers

BufferListPtr OgreOggSound::OgreOggISound::mBuffers
protected

◆ mBufferSize

size_t OgreOggSound::OgreOggISound::mBufferSize
protected

◆ mCuePoints

std::deque<float> OgreOggSound::OgreOggISound::mCuePoints
protected

◆ mDirection

Ogre::Vector3 OgreOggSound::OgreOggISound::mDirection
protected

◆ mDisable3D

bool OgreOggSound::OgreOggISound::mDisable3D
protected

◆ mFade

bool OgreOggSound::OgreOggISound::mFade
protected

◆ mFadeEndAction

FadeControl OgreOggSound::OgreOggISound::mFadeEndAction
protected

◆ mFadeEndVol

float OgreOggSound::OgreOggISound::mFadeEndVol
protected

◆ mFadeInitVol

float OgreOggSound::OgreOggISound::mFadeInitVol
protected

◆ mFadeTime

float OgreOggSound::OgreOggISound::mFadeTime
protected

◆ mFadeTimer

float OgreOggSound::OgreOggISound::mFadeTimer
protected

Variables used to fade sound

◆ mFormat

ALenum OgreOggSound::OgreOggISound::mFormat
protected

◆ mGain

float OgreOggSound::OgreOggISound::mGain
protected

◆ mGiveUpSource

bool OgreOggSound::OgreOggISound::mGiveUpSource
protected

◆ mInitialised

bool OgreOggSound::OgreOggISound::mInitialised
protected

◆ mInnerConeAngle

float OgreOggSound::OgreOggISound::mInnerConeAngle
protected

◆ mLocalTransformDirty

bool OgreOggSound::OgreOggISound::mLocalTransformDirty
protected

◆ mLoop

bool OgreOggSound::OgreOggISound::mLoop
protected

◆ mLoopOffset

float OgreOggSound::OgreOggISound::mLoopOffset
protected

◆ mLoopStart

float OgreOggSound::OgreOggISound::mLoopStart
protected

◆ mMaxDistance

float OgreOggSound::OgreOggISound::mMaxDistance
protected

◆ mMaxGain

float OgreOggSound::OgreOggISound::mMaxGain
protected

◆ mMinGain

float OgreOggSound::OgreOggISound::mMinGain
protected

◆ mName

Ogre::String OgreOggSound::OgreOggISound::mName
protected

◆ mOggCallbacks

ov_callbacks OgreOggSound::OgreOggISound::mOggCallbacks
protected

◆ mOuterConeAngle

float OgreOggSound::OgreOggISound::mOuterConeAngle
protected

◆ mOuterConeGain

float OgreOggSound::OgreOggISound::mOuterConeGain
protected

◆ mPitch

float OgreOggSound::OgreOggISound::mPitch
protected

◆ mPlayPos

ALfloat OgreOggSound::OgreOggISound::mPlayPos
protected

◆ mPlayPosChanged

bool OgreOggSound::OgreOggISound::mPlayPosChanged
protected

◆ mPlayTime

float OgreOggSound::OgreOggISound::mPlayTime
protected

◆ mPosition

Ogre::Vector3 OgreOggSound::OgreOggISound::mPosition
protected

◆ mPriority

Ogre::uint8 OgreOggSound::OgreOggISound::mPriority
protected

◆ mReferenceDistance

float OgreOggSound::OgreOggISound::mReferenceDistance
protected

◆ mRolloffFactor

float OgreOggSound::OgreOggISound::mRolloffFactor
protected

◆ mScnMgr

Ogre::SceneManager* OgreOggSound::OgreOggISound::mScnMgr
protected

◆ mSeekable

bool OgreOggSound::OgreOggISound::mSeekable
protected

◆ mSoundListener

SoundListener* OgreOggSound::OgreOggISound::mSoundListener
protected

◆ mSource

ALuint OgreOggSound::OgreOggISound::mSource
protected

Sound properties

◆ mSourceRelative

bool OgreOggSound::OgreOggISound::mSourceRelative
protected

◆ mState

SoundState OgreOggSound::OgreOggISound::mState
protected

◆ mStream

bool OgreOggSound::OgreOggISound::mStream
protected

◆ mTemporary

bool OgreOggSound::OgreOggISound::mTemporary
protected

◆ mVelocity

Ogre::Vector3 OgreOggSound::OgreOggISound::mVelocity
protected

The documentation for this class was generated from the following file: