OgreOggSound  1.26
OgreOggSound::OgreOggStaticWavSound Class Reference

A single static buffer sound (WAV) More...

#include <OgreOggStaticWavSound.h>

Inheritance diagram for OgreOggSound::OgreOggStaticWavSound:

Public Member Functions

void loop (bool loop)
 
void setSource (ALuint &src)
 
bool isMono ()
 
virtual const Ogre::StringgetFileName (void) const
 
- Public Member Functions inherited from OgreOggSound::OgreOggISound
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 ()
 
void startFade (bool dir, float fadeTime, FadeControl actionOnCompletion=OgreOggSound::FC_NONE)
 
bool isTemporary () const
 
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
 
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

 OgreOggStaticWavSound (const Ogre::String &name, Ogre::SceneManager *scnMgr)
 
 ~OgreOggStaticWavSound ()
 
void release ()
 
void _openImpl (Ogre::DataStreamPtr &fileStream)
 
void _openImpl (const Ogre::String &fName, sharedAudioBuffer *buffer)
 
void _stopImpl ()
 
void _pauseImpl ()
 
void _playImpl ()
 
void _updateAudioBuffers ()
 
void _prebuffer ()
 
bool _queryBufferInfo ()
 
void _release ()
 
- Protected Member Functions inherited from OgreOggSound::OgreOggISound
 OgreOggISound (const Ogre::String &name, Ogre::SceneManager *scnMgr)
 
virtual ~OgreOggISound ()
 
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)
 

Protected Attributes

std::vector< char > mBufferData
 
Ogre::String mAudioName
 
ALint mPreviousOffset
 
WavFormatData mFormatData
 
- Protected Attributes inherited from OgreOggSound::OgreOggISound
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 static buffer sound (WAV)

Handles playing a sound from memory.

Constructor & Destructor Documentation

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

Constructor

OgreOggSound::OgreOggStaticWavSound::~OgreOggStaticWavSound ( )
protected

Destructor

Member Function Documentation

void OgreOggSound::OgreOggStaticWavSound::_openImpl ( Ogre::DataStreamPtr fileStream)
protectedvirtual

Opens audio file.

Remarks
Opens a specified file and checks validity. Reads first chunks of audio data into buffers.
Parameters
filepath string

Implements OgreOggSound::OgreOggISound.

void OgreOggSound::OgreOggStaticWavSound::_openImpl ( const Ogre::String fName,
sharedAudioBuffer buffer 
)
protectedvirtual

Opens audio file.

Remarks
Uses a shared buffer.
Parameters
buffershared buffer reference

Reimplemented from OgreOggSound::OgreOggISound.

void OgreOggSound::OgreOggStaticWavSound::_pauseImpl ( )
protectedvirtual

Pauses sound.

Remarks
Pauses playback on the source.

Implements OgreOggSound::OgreOggISound.

void OgreOggSound::OgreOggStaticWavSound::_playImpl ( )
protectedvirtual

Plays the sound.

Remarks
Begins playback of all buffers queued on the source. If a source hasn't been setup yet it is requested and initialised within this call.

Implements OgreOggSound::OgreOggISound.

void OgreOggSound::OgreOggStaticWavSound::_prebuffer ( )
protectedvirtual

Prefills buffer with audio data.

Remarks
Loads audio data onto the source ready for playback.

Implements OgreOggSound::OgreOggISound.

bool OgreOggSound::OgreOggStaticWavSound::_queryBufferInfo ( )
protectedvirtual

Calculates buffer size and format.

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

Implements OgreOggSound::OgreOggISound.

void OgreOggSound::OgreOggStaticWavSound::_release ( )
protectedvirtual

Releases buffers and OpenAL objects.

Remarks
Cleans up this sounds OpenAL objects, including buffers and file pointers ready for destruction.

Implements OgreOggSound::OgreOggISound.

void OgreOggSound::OgreOggStaticWavSound::_stopImpl ( )
protectedvirtual

Stops playing sound.

Remarks
Stops playing audio immediately. If specified to do so its source will be released also.

Implements OgreOggSound::OgreOggISound.

void OgreOggSound::OgreOggStaticWavSound::_updateAudioBuffers ( )
protectedvirtual

Updates the data buffers with sound information.

Remarks
This function refills processed buffers with audio data from the stream, it automatically handles looping if set.

Implements OgreOggSound::OgreOggISound.

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

Gets the sounds file name

Reimplemented from OgreOggSound::OgreOggISound.

References name, and OGRE_VERSION_MAJOR.

bool OgreOggSound::OgreOggStaticWavSound::isMono ( )
virtual

Returns whether sound is mono

Implements OgreOggSound::OgreOggISound.

void OgreOggSound::OgreOggStaticWavSound::loop ( bool  loop)

Sets the loop status.

Remarks
Immediately sets the loop status if a source is associated
Parameters
looptrue=loop
void OgreOggSound::OgreOggStaticWavSound::release ( )
protected

Releases buffers.

Remarks
Cleans up and releases OpenAL buffer objects.
void OgreOggSound::OgreOggStaticWavSound::setSource ( ALuint &  src)
virtual

Sets the source to use for playback.

Remarks
Sets the source object this sound will use to queue buffers onto for playback. Also handles refilling buffers and queuing up.
Parameters
srcSource id.

Implements OgreOggSound::OgreOggISound.

Friends And Related Function Documentation

friend class OgreOggSoundManager
friend

Member Data Documentation

Ogre::String OgreOggSound::OgreOggStaticWavSound::mAudioName
protected
std::vector<char> OgreOggSound::OgreOggStaticWavSound::mBufferData
protected
WavFormatData OgreOggSound::OgreOggStaticWavSound::mFormatData
protected
ALint OgreOggSound::OgreOggStaticWavSound::mPreviousOffset
protected

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