PixelLightAPI  .
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes
PLSound::SNMSound Class Reference

Scene node modifier which is able to playback a sound. More...

#include <SNMSound.h>

Inheritance diagram for PLSound::SNMSound:
Inheritance graph
[legend]

List of all members.

Public Types

enum  EFlags { Stream = 1<<2, No3D = 1<<3, NoLoop = 1<<4, NoStartPlayback = 1<<5 }
 Scene node modifier flags (SceneNodeModifier flags extension) More...

Public Member Functions

PLSOUND_API float GetVolume () const
PLSOUND_API void SetVolume (float fValue)
PLSOUND_API float GetPitch () const
PLSOUND_API void SetPitch (float fValue)
PLSOUND_API float GetReferenceDistance () const
PLSOUND_API void SetReferenceDistance (float fValue)
PLSOUND_API float GetMaxDistance () const
PLSOUND_API void SetMaxDistance (float fValue)
PLSOUND_API float GetRolloffFactor () const
PLSOUND_API void SetRolloffFactor (float fValue)
virtual PLSOUND_API void SetFlags (PLCore::uint32 nValue) override
PLSOUND_API SNMSound (PLScene::SceneNode &cSceneNode)
 Constructor.
virtual PLSOUND_API ~SNMSound ()
 Destructor.
PLSOUND_API SourceGetSoundSource () const
 Returns the sound source.

Protected Member Functions

virtual PLSOUND_API void OnActivate (bool bActivate) override
 Called when the scene node modifier has been activated or deactivated.

Protected Attributes

PLCore::String m_sSound
float m_fVolume
float m_fPitch
float m_fReferenceDistance
float m_fMaxDistance
float m_fRolloffFactor

Detailed Description

Scene node modifier which is able to playback a sound.

Note:
  • For sources with 3D spatialization, do only use one channel buffers because not each sound backend may be capable to use 3D spatialization for buffers with multiple channels

Member Enumeration Documentation

Scene node modifier flags (SceneNodeModifier flags extension)

Enumerator:
Stream 

Stream the file (recommended for large files!)

No3D 

No 3D sound

NoLoop 

Do not loop the sound playback

NoStartPlayback 

Do not start sound playback after scene node initialization

Reimplemented from PLScene::SceneNodeModifier.


Constructor & Destructor Documentation

PLSOUND_API PLSound::SNMSound::SNMSound ( PLScene::SceneNode cSceneNode)

Constructor.

Parameters:
[in]cSceneNodeOwner scene node
virtual PLSOUND_API PLSound::SNMSound::~SNMSound ( ) [virtual]

Destructor.


Member Function Documentation

PLSOUND_API float PLSound::SNMSound::GetVolume ( ) const
PLSOUND_API void PLSound::SNMSound::SetVolume ( float  fValue)
PLSOUND_API float PLSound::SNMSound::GetPitch ( ) const
PLSOUND_API void PLSound::SNMSound::SetPitch ( float  fValue)
PLSOUND_API float PLSound::SNMSound::GetReferenceDistance ( ) const
PLSOUND_API void PLSound::SNMSound::SetReferenceDistance ( float  fValue)
PLSOUND_API float PLSound::SNMSound::GetMaxDistance ( ) const
PLSOUND_API void PLSound::SNMSound::SetMaxDistance ( float  fValue)
PLSOUND_API float PLSound::SNMSound::GetRolloffFactor ( ) const
PLSOUND_API void PLSound::SNMSound::SetRolloffFactor ( float  fValue)
virtual PLSOUND_API void PLSound::SNMSound::SetFlags ( PLCore::uint32  nValue) [override, virtual]

Reimplemented from PLScene::SceneNodeModifier.

PLSOUND_API Source* PLSound::SNMSound::GetSoundSource ( ) const

Returns the sound source.

Returns:
The sound source, can be a null pointer
virtual PLSOUND_API void PLSound::SNMSound::OnActivate ( bool  bActivate) [override, protected, virtual]

Called when the scene node modifier has been activated or deactivated.

Parameters:
[in]bActivate'true' if the scene node modifier is now active, else 'false'
Note:
  • The scene node "Inactive"-flag as well as the "Frozen"-flag are taken into account
  • 'bActivate' will be 'true' if the scene node modifier AND the owner scene node AND it's parent scene container (recursive!) are active
  • 'bActivate' will be 'false' if the scene node modifier OR the owner scene node OR it's parent scene container (recursive!) is inactive
  • The default implementation is empty

Reimplemented from PLScene::SceneNodeModifier.


Member Data Documentation

Name of the sound which should be played (full path, supported file formats are API dependent)

float PLSound::SNMSound::m_fVolume [protected]

Volume (value from 0.0-1.0 -> 0.0 = silence, 1.0 = full volume)

float PLSound::SNMSound::m_fPitch [protected]

Pitch multiplier (pitch<1.0=slower/pitch=1.0=normal/pitch>1.0=faster)

Used to increase or decrease the range of a source by decreasing or increasing the attenuation, respectively

Defines a distance beyond which the source will not be further attenuated by distance

This will scale the distance attenuation over the applicable range


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


PixelLight PixelLight 0.9.11-R1
Copyright (C) 2002-2012 by The PixelLight Team
Last modified Thu Feb 23 2012 14:09:42
The content of this PixelLight document is published under the
Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported