OgreOggSound  1.26
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)
 
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)
 
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)
 
void setMinVolume (float minGain)
 
void setConeAngles (float insideAngle=360.f, float outsideAngle=360.f)
 
void setOuterConeVolume (float gain=0.f)
 
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 *l)
 
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 Matrix4_getParentNodeFullTransform (void) const
 
virtual void _notifyAttached (Node *parent, bool isTagPoint=false)
 
virtual void _notifyCreator (MovableObjectFactory *fact)
 
virtual void _notifyCurrentCamera (Camera *cam)
 
virtual void _notifyManager (SceneManager *man)
 
virtual void _notifyMoved (void)
 
virtual void _releaseManualHardwareResources ()
 
virtual void _restoreManualHardwareResources ()
 
void addQueryFlags (uint32 flags)
 
void addVisibilityFlags (uint32 flags)
 
virtual AnimableValuePtr createAnimableValue (const String &valueName)
 
void detachFromParent (void)
 
const StringVectorgetAnimableValueNames (void) const
 
bool getCastShadows (void) const
 
const AxisAlignedBoxgetDarkCapBounds (const Light &light, Real dirLightExtrusionDist) const
 
EdgeDatagetEdgeList (void)
 
const AxisAlignedBoxgetLightCapBounds (void) const
 
uint32 getLightMask () const
 
ListenergetListener (void) const
 
const StringgetName (void) const
 
NodegetParentNode (void) const
 
SceneNodegetParentSceneNode (void) const
 
Real getPointExtrusionDistance (const Light *l) const
 
uint32 getQueryFlags (void) const
 
bool getReceivesShadows ()
 
Real getRenderingDistance (void) const
 
Real getRenderingMinPixelSize () const
 
uint8 getRenderQueueGroup (void) const
 
ShadowRenderableListIterator getShadowVolumeRenderableIterator (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
 
uint32 getVisibilityFlags (void) const
 
bool getVisible (void) const
 
virtual const AxisAlignedBoxgetWorldBoundingBox (bool derive=false) const
 
virtual const SpheregetWorldBoundingSphere (bool derive=false) const
 
bool hasEdgeList (void)
 
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 ()
 
- Public Member Functions inherited from Ogre::AnimableObject
 AnimableObject ()
 
virtual ~AnimableObject ()
 
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)
 
virtual void _updateRenderQueue (Ogre::RenderQueue *queue, Ogre::Camera *camera, const Ogre::Camera *lodCamera)
 
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::SceneManagermScnMan
 
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 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::MovableObject
typedef vector< ShadowRenderable * >::type ShadowRenderableList
 
typedef VectorIterator< ShadowRenderableListShadowRenderableListIterator
 
- Public Types inherited from Ogre::ShadowCaster
typedef vector< ShadowRenderable * >::type ShadowRenderableList
 
typedef VectorIterator< ShadowRenderableListShadowRenderableListIterator
 
- Static Public Member Functions inherited from Ogre::MovableObject
static void clearShadowRenderableList (ShadowRenderableList &shadowRenderables)
 
static void extrudeVertices (const HardwareVertexBufferSharedPtr &vertexBuffer, size_t originalVertexCount, const Vector4 &lightPos, Real extrudeDist)
 
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

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 create this sound
virtual OgreOggSound::OgreOggISound::~OgreOggISound ( )
protectedvirtual

Superclass destructor.

Member Function Documentation

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
bufferReference to an object to store loopOffset in bytes
bufferReference to an object to store buffer format
void OgreOggSound::OgreOggISound::_initSource ( )
protected

Inits source object

Remarks
Initialises all the source objects states ready for playback.
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.
virtual void OgreOggSound::OgreOggISound::_notifyAttached ( Ogre::Node node)
protectedvirtual

Notifys object its been attached to a node

Remarks
Overridden from MovableObject.
virtual void OgreOggSound::OgreOggISound::_openImpl ( Ogre::DataStreamPtr fileStream)
protectedpure virtual
virtual void OgreOggSound::OgreOggISound::_openImpl ( const Ogre::String fName,
sharedAudioBuffer buffer = 0 
)
protectedvirtual

Open implementation.

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

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

References _notifyAttached(), _notifyMoved(), _updateRenderQueue(), OGRE_VERSION_MAJOR, and visitRenderables().

virtual void OgreOggSound::OgreOggISound::_pauseImpl ( )
protectedpure virtual
virtual void OgreOggSound::OgreOggISound::_playImpl ( )
protectedpure virtual
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::OgreOggStreamSound, OgreOggSound::OgreOggStreamWavSound, OgreOggSound::OgreOggStaticSound, and OgreOggSound::OgreOggStaticWavSound.

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::OgreOggStreamSound, OgreOggSound::OgreOggStreamWavSound, OgreOggSound::OgreOggStaticSound, and OgreOggSound::OgreOggStaticWavSound.

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
virtual void OgreOggSound::OgreOggISound::_release ( )
protectedpure virtual

Release implemenation

Remarks
Cleans up buffers and prepares sound for destruction.

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

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.
virtual void OgreOggSound::OgreOggISound::_stopImpl ( )
protectedpure virtual
virtual void OgreOggSound::OgreOggISound::_updateAudioBuffers ( )
protectedpure virtual
void OgreOggSound::OgreOggISound::_updateFade ( float  fTime = 0.f)
protected

Updates a fade

Remarks
Updates a fade action.
virtual void OgreOggSound::OgreOggISound::_updateRenderQueue ( Ogre::RenderQueue queue)
protectedvirtual

Updates RenderQueue

Remarks
Overridden from MovableObject.

Implements Ogre::MovableObject.

virtual void OgreOggSound::OgreOggISound::_updateRenderQueue ( Ogre::RenderQueue queue,
Ogre::Camera camera,
const Ogre::Camera lodCamera 
)
protectedvirtual

do nothing but need for derived from MovableObject

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 the true on success.
Parameters
secondsCue point in seconds
void OgreOggSound::OgreOggISound::clearCuePoints ( )

Clears entire list of cue points

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.
float OgreOggSound::OgreOggISound::getAudioLength ( ) const

Gets the length of the audio file in seconds

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

References getBoundingBox(), getBoundingRadius(), and getMovableType().

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

Gets bounding box

Remarks
Overridden from MovableObject.

Implements Ogre::MovableObject.

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

Gets bounding radius

Remarks
Overridden from MovableObject.

Implements Ogre::MovableObject.

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

Gets a previously set cue point by index

Parameters
indexposition in cue point list to get
const Ogre::Vector3& OgreOggSound::OgreOggISound::getDirection ( ) const

Gets the sounds direction

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

Gets the sounds file name

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

References Ogre::BLANKSTRING.

float OgreOggSound::OgreOggISound::getLoopOffset ( )

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

References OgreOggSound::FC_NONE.

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

Gets sounds maximum distance

Remarks
Returns -1 on error
virtual const Ogre::String& OgreOggSound::OgreOggISound::getMovableType ( void  ) const
virtual

Gets movable type string

Remarks
Overridden from MovableObject.

Implements Ogre::MovableObject.

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

Gets the sounds name

unsigned int OgreOggSound::OgreOggISound::getNumCuePoints ( )

Returns number of cue points

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

Gets sounds pitch

Remarks
Returns -1 on error
virtual float OgreOggSound::OgreOggISound::getPlayPosition ( ) const
virtual

Gets the position of the playback cursor in seconds

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

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

Gets sounds position

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

Gets the sounds priority

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

Gets sounds reference distance

Remarks
Returns -1 on error
const float OgreOggSound::OgreOggISound::getRolloffFactor ( ) const

Gets sounds rolloff factor

Remarks
Returns -1 on error
Ogre::SceneManager* OgreOggSound::OgreOggISound::getSceneManager ( ) const

Gets the SceneManager pointer registered at creation.

Remarks
This will only be set if the sound was created through the plugin method createMovableobject().
ALuint OgreOggSound::OgreOggISound::getSource ( ) const

Gets the sounds source

SoundState OgreOggSound::OgreOggISound::getState ( ) const

Gets the current state the sound is in

float OgreOggSound::OgreOggISound::getVolume ( ) const

Gets sounds volume

Remarks
Gets the current gain value.
bool OgreOggSound::OgreOggISound::isFading ( ) const

Returns fade status.

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

Returns pause status.

Remarks
Checks for a valid source before checking the state value

References OgreOggSound::SS_PAUSED.

bool OgreOggSound::OgreOggISound::isPlaying ( ) const

Returns play status.

Remarks
Checks for a valid source before checking the state value

References OgreOggSound::SS_PLAYING.

bool OgreOggSound::OgreOggISound::isRelativeToListener ( ) const

Returns position status.

Remarks
Returns whether position is local to listener or in world-space
bool OgreOggSound::OgreOggISound::isStopped ( ) const

Returns stop status.

Remarks
Checks for a valid source before checking the state value

References OgreOggSound::SS_STOPPED.

bool OgreOggSound::OgreOggISound::isTemporary ( ) const

Returns whether this sound is temporary

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

Sets looping status.

Remarks
Parameters
loopBoolean: true == loop

References loop().

Referenced by loop().

void OgreOggSound::OgreOggISound::markTemporary ( )

Marks sound as temporary

Remarks
Auto-destroys itself after finishing playing.
void OgreOggSound::OgreOggISound::pause ( bool  immediate = false)

Pauses sound.

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

Plays sound.

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

Removes a cue point

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
outsideAngleangle over which the volume is at minimum
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
void OgreOggSound::OgreOggISound::setDirection ( float  dirx,
float  diry,
float  dirz 
)

Sets sounds direction.

Parameters
dirxx coord
diryy coord
dirzz coord
void OgreOggSound::OgreOggISound::setDirection ( const Ogre::Vector3 dir)

Sets sounds direction.

Parameters
dir3D vector direction
void OgreOggSound::OgreOggISound::setGiveUpSourceOnStop ( bool  giveup = false)

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
giveuptrue = release source immediately

References setPosition().

void OgreOggSound::OgreOggISound::setListener ( SoundListener l)

Sets a listener object to be notified of events.

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

References name, and OGRE_VERSION_MAJOR.

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

Sets the start point of a loopable section of audio.

Remarks
(NOTE:- Streamed sounds ONLY) 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. 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.
Parameters
startTimePosition in seconds to offset the loop point.

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

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.
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)
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)
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)
void OgreOggSound::OgreOggISound::setPitch ( float  pitch)

Sets sounds pitch

Remarks
This affects the playback speed of the sound
Parameters
pitchPitch (>0).
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::OgreOggStreamSound, and OgreOggSound::OgreOggStreamWavSound.

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

Sets sounds position.

Parameters
posxx position
posyy position
poszz position
void OgreOggSound::OgreOggISound::setPosition ( const Ogre::Vector3 pos)

Sets sounds position.

Parameters
pos3D vector position
void OgreOggSound::OgreOggISound::setPriority ( Ogre::uint8  priority)

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
priority(0..255)
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 reduce by half.
Parameters
referenceDistancedistance (>0).
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.
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).
virtual void OgreOggSound::OgreOggISound::setSource ( ALuint &  src)
pure virtual

Sets the source object for playback.

Remarks
Abstract function

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

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

Sets sounds velocity.

Parameters
velxx velocity
velyy velocity
velzz velocity
void OgreOggSound::OgreOggISound::setVelocity ( const Ogre::Vector3 vel)

Sets sounds velocity.

Parameters
vel3D vector velocity
void OgreOggSound::OgreOggISound::setVolume ( float  gain)

Sets sounds volume

Remarks
Sets sounds current gain value (0..1).
Parameters
gainvolume scalar.
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)
void OgreOggSound::OgreOggISound::stop ( bool  immediate = false)

Stops sound.

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

Updates sund

Remarks
Updates sounds position, buffers and state
Parameters
fTimeElapsed frametime.
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

friend class OgreOggSoundManager
friend

Member Data Documentation

unsigned long OgreOggSound::OgreOggISound::mAudioEnd
protected
unsigned long OgreOggSound::OgreOggISound::mAudioOffset
protected
Ogre::DataStreamPtr OgreOggSound::OgreOggISound::mAudioStream
protected
Ogre::uint8 OgreOggSound::OgreOggISound::mAwaitingDestruction
protected
BufferListPtr OgreOggSound::OgreOggISound::mBuffers
protected
size_t OgreOggSound::OgreOggISound::mBufferSize
protected
std::deque<float> OgreOggSound::OgreOggISound::mCuePoints
protected
Ogre::Vector3 OgreOggSound::OgreOggISound::mDirection
protected
bool OgreOggSound::OgreOggISound::mDisable3D
protected
bool OgreOggSound::OgreOggISound::mFade
protected
FadeControl OgreOggSound::OgreOggISound::mFadeEndAction
protected
float OgreOggSound::OgreOggISound::mFadeEndVol
protected
float OgreOggSound::OgreOggISound::mFadeInitVol
protected
float OgreOggSound::OgreOggISound::mFadeTime
protected
float OgreOggSound::OgreOggISound::mFadeTimer
protected

Variables used to fade sound

ALenum OgreOggSound::OgreOggISound::mFormat
protected
float OgreOggSound::OgreOggISound::mGain
protected
bool OgreOggSound::OgreOggISound::mGiveUpSource
protected
bool OgreOggSound::OgreOggISound::mInitialised
protected
float OgreOggSound::OgreOggISound::mInnerConeAngle
protected
bool OgreOggSound::OgreOggISound::mLoop
protected
float OgreOggSound::OgreOggISound::mLoopOffset
protected
float OgreOggSound::OgreOggISound::mLoopStart
protected
float OgreOggSound::OgreOggISound::mMaxDistance
protected
float OgreOggSound::OgreOggISound::mMaxGain
protected
float OgreOggSound::OgreOggISound::mMinGain
protected
Ogre::String OgreOggSound::OgreOggISound::mName
protected
ov_callbacks OgreOggSound::OgreOggISound::mOggCallbacks
protected
float OgreOggSound::OgreOggISound::mOuterConeAngle
protected
float OgreOggSound::OgreOggISound::mOuterConeGain
protected
float OgreOggSound::OgreOggISound::mPitch
protected
ALfloat OgreOggSound::OgreOggISound::mPlayPos
protected
bool OgreOggSound::OgreOggISound::mPlayPosChanged
protected
float OgreOggSound::OgreOggISound::mPlayTime
protected
Ogre::Vector3 OgreOggSound::OgreOggISound::mPosition
protected
Ogre::uint8 OgreOggSound::OgreOggISound::mPriority
protected
float OgreOggSound::OgreOggISound::mReferenceDistance
protected
float OgreOggSound::OgreOggISound::mRolloffFactor
protected
Ogre::SceneManager* OgreOggSound::OgreOggISound::mScnMan
protected
bool OgreOggSound::OgreOggISound::mSeekable
protected
SoundListener* OgreOggSound::OgreOggISound::mSoundListener
protected
ALuint OgreOggSound::OgreOggISound::mSource
protected

Sound properties

bool OgreOggSound::OgreOggISound::mSourceRelative
protected
SoundState OgreOggSound::OgreOggISound::mState
protected
bool OgreOggSound::OgreOggISound::mStream
protected
bool OgreOggSound::OgreOggISound::mTemporary
protected
Ogre::Vector3 OgreOggSound::OgreOggISound::mVelocity
protected

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