cocos2d-x  3.0rc1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
FmodAudioPlayer Class Reference

#include <FmodAudioPlayer.h>

Inheritance diagram for FmodAudioPlayer:
AudioPlayer

Public Member Functions

 FmodAudioPlayer ()
virtual ~FmodAudioPlayer ()
local ~FmodAudioPlayer ()
virtual void close ()
virtual void preloadBackgroundMusic (const char *pszFilePath)
 Preload background music. More...
 
var preloadBackgroundMusic ( var pszFilePath)
 Preload background music. More...
 
local preloadBackgroundMusic ( local pszFilePath)
 Preload background music. More...
 
virtual void playBackgroundMusic (const char *pszFilePath, bool bLoop)
 Play background music. More...
 
local playBackgroundMusic ( local pszFilePath, local bLoop)
 Play background music. More...
 
virtual void stopBackgroundMusic (bool bReleaseData)
 Stop playing background music. More...
 
virtual void pauseBackgroundMusic ()
 Pause playing background music. More...
 
virtual void resumeBackgroundMusic ()
 Resume playing background music. More...
 
var resumeBackgroundMusic ()
 Resume playing background music. More...
 
local resumeBackgroundMusic ()
 Resume playing background music. More...
 
virtual void rewindBackgroundMusic ()
 Rewind playing background music. More...
 
var rewindBackgroundMusic ()
 Rewind playing background music. More...
 
local rewindBackgroundMusic ()
 Rewind playing background music. More...
 
virtual bool willPlayBackgroundMusic ()
virtual bool isBackgroundMusicPlaying ()
 Whether the background music is playing. More...
 
var isBackgroundMusicPlaying ()
 Whether the background music is playing. More...
 
local isBackgroundMusicPlaying ()
 Whether the background music is playing. More...
 
virtual float getBackgroundMusicVolume ()
 The volume of the background music max value is 1.0,the min value is 0.0. More...
 
virtual void setBackgroundMusicVolume (float volume)
 set the volume of background music More...
 
local setBackgroundMusicVolume ( local volume)
 set the volume of background music More...
 
virtual float getEffectsVolume ()
 The volume of the effects max value is 1.0,the min value is 0.0. More...
 
virtual void setEffectsVolume (float volume)
 set the volume of sound effecs More...
 
virtual unsigned int playEffect (const char *pszFilePath, bool bLoop, float pitch, float pan, float gain)
 Play sound effect. More...
 
var playEffect ( var pszFilePath, var bLoop, var pitch, var pan, var gain)
 Play sound effect. More...
 
local playEffect ( local pszFilePath, local bLoop, local pitch, local pan, local gain)
 Play sound effect. More...
 
virtual void stopEffect (unsigned int nSoundId)
 Stop playing sound effect. More...
 
var stopEffect ( var nSoundId)
 Stop playing sound effect. More...
 
local stopEffect ( local nSoundId)
 Stop playing sound effect. More...
 
virtual void preloadEffect (const char *pszFilePath)
 preload a compressed audio file More...
 
var preloadEffect ( var pszFilePath)
 preload a compressed audio file More...
 
local preloadEffect ( local pszFilePath)
 preload a compressed audio file More...
 
virtual void unloadEffect (const char *pszFilePath)
 unload the preloaded effect from internal buffer More...
 
var unloadEffect ( var pszFilePath)
 unload the preloaded effect from internal buffer More...
 
local unloadEffect ( local pszFilePath)
 unload the preloaded effect from internal buffer More...
 
virtual void pauseEffect (unsigned int uSoundId)
 pause an effect identified by sound id More...
 
local pauseEffect ( local uSoundId)
 pause an effect identified by sound id More...
 
virtual void pauseAllEffects ()
 pause all playing effects More...
 
virtual void resumeEffect (unsigned int uSoundId)
 resume an effect identified by sound id More...
 
local resumeEffect ( local uSoundId)
 resume an effect identified by sound id More...
 
virtual void resumeAllEffects ()
 resume a effect identified by sound id More...
 
var resumeAllEffects ()
 resume a effect identified by sound id More...
 
local resumeAllEffects ()
 resume a effect identified by sound id More...
 
virtual void stopAllEffects ()
 stop all playing effects More...
 

Static Public Member Functions

static FmodAudioPlayersharedPlayer ()
local sharedPlayer ()

Constructor & Destructor Documentation

var FmodAudioPlayer ( )
local FmodAudioPlayer ( )
virtual ~FmodAudioPlayer ( )
virtual
var ~FmodAudioPlayer ( )
virtual
local ~FmodAudioPlayer ( )
virtual

Member Function Documentation

virtual void close ( )
virtual

Implements AudioPlayer.

var close ( )
virtual

Implements AudioPlayer.

local close ( )
virtual

Implements AudioPlayer.

virtual float
getBackgroundMusicVolume
( )
virtual

The volume of the background music max value is 1.0,the min value is 0.0.

Implements AudioPlayer.

var getBackgroundMusicVolume ( )
virtual

The volume of the background music max value is 1.0,the min value is 0.0.

Implements AudioPlayer.

local getBackgroundMusicVolume ( )
virtual

The volume of the background music max value is 1.0,the min value is 0.0.

Implements AudioPlayer.

virtual float getEffectsVolume ( )
virtual

The volume of the effects max value is 1.0,the min value is 0.0.

Implements AudioPlayer.

var getEffectsVolume ( )
virtual

The volume of the effects max value is 1.0,the min value is 0.0.

Implements AudioPlayer.

local getEffectsVolume ( )
virtual

The volume of the effects max value is 1.0,the min value is 0.0.

Implements AudioPlayer.

virtual bool
isBackgroundMusicPlaying
( )
virtual

Whether the background music is playing.

Returns
If is playing return true,or return false

Implements AudioPlayer.

var isBackgroundMusicPlaying ( )
virtual

Whether the background music is playing.

Returns
If is playing return true,or return false

Implements AudioPlayer.

local isBackgroundMusicPlaying ( )
virtual

Whether the background music is playing.

Returns
If is playing return true,or return false

Implements AudioPlayer.

virtual void pauseAllEffects ( )
virtual

pause all playing effects

Implements AudioPlayer.

var pauseAllEffects ( )
virtual

pause all playing effects

Implements AudioPlayer.

local pauseAllEffects ( )
virtual

pause all playing effects

Implements AudioPlayer.

virtual void pauseBackgroundMusic ( )
virtual

Pause playing background music.

Implements AudioPlayer.

var pauseBackgroundMusic ( )
virtual

Pause playing background music.

Implements AudioPlayer.

local pauseBackgroundMusic ( )
virtual

Pause playing background music.

Implements AudioPlayer.

virtual void pauseEffect ( unsigned int  uSoundId)
virtual

pause an effect identified by sound id

Parameters
[in]uSoundIdsound id

Implements AudioPlayer.

var pauseEffect ( var  uSoundId)
virtual

pause an effect identified by sound id

Parameters
[in]uSoundIdsound id

Implements AudioPlayer.

local pauseEffect ( local  uSoundId)
virtual

pause an effect identified by sound id

Parameters
[in]uSoundIdsound id

Implements AudioPlayer.

virtual void playBackgroundMusic ( const char *  pszFilePath,
bool  bLoop 
)
virtual

Play background music.

Parameters
pszFilePathThe path of the background music file,or the FileName of T_SoundResInfo
bLoopWhether the background music loop or not

Implements AudioPlayer.

var playBackgroundMusic ( var  pszFilePath,
var  bLoop 
)
virtual

Play background music.

Parameters
pszFilePathThe path of the background music file,or the FileName of T_SoundResInfo
bLoopWhether the background music loop or not

Implements AudioPlayer.

local playBackgroundMusic ( local  pszFilePath,
local  bLoop 
)
virtual

Play background music.

Parameters
pszFilePathThe path of the background music file,or the FileName of T_SoundResInfo
bLoopWhether the background music loop or not

Implements AudioPlayer.

virtual unsigned int playEffect ( const char *  pszFilePath,
bool  bLoop,
float  pitch,
float  pan,
float  gain 
)
virtual

Play sound effect.

Parameters
pszFilePathThe path of the effect file,or the FileName of T_SoundResInfo Whether to loop the effect playing, default value is false

Implements AudioPlayer.

var playEffect ( var  pszFilePath,
var  bLoop,
var  pitch,
var  pan,
var  gain 
)
virtual

Play sound effect.

Parameters
pszFilePathThe path of the effect file,or the FileName of T_SoundResInfo Whether to loop the effect playing, default value is false

Implements AudioPlayer.

local playEffect ( local  pszFilePath,
local  bLoop,
local  pitch,
local  pan,
local  gain 
)
virtual

Play sound effect.

Parameters
pszFilePathThe path of the effect file,or the FileName of T_SoundResInfo Whether to loop the effect playing, default value is false

Implements AudioPlayer.

virtual void preloadBackgroundMusic ( const char *  pszFilePath)
virtual

Preload background music.

Parameters
pszFilePathThe path of the background music file,or the FileName of T_SoundResInfo

Implements AudioPlayer.

var preloadBackgroundMusic ( var  pszFilePath)
virtual

Preload background music.

Parameters
pszFilePathThe path of the background music file,or the FileName of T_SoundResInfo

Implements AudioPlayer.

local preloadBackgroundMusic ( local  pszFilePath)
virtual

Preload background music.

Parameters
pszFilePathThe path of the background music file,or the FileName of T_SoundResInfo

Implements AudioPlayer.

virtual void preloadEffect ( const char *  pszFilePath)
virtual

preload a compressed audio file

the compressed audio will be decode to wave, then write into an internal buffer in SimpleaudioEngine

Implements AudioPlayer.

var preloadEffect ( var  pszFilePath)
virtual

preload a compressed audio file

the compressed audio will be decode to wave, then write into an internal buffer in SimpleaudioEngine

Implements AudioPlayer.

local preloadEffect ( local  pszFilePath)
virtual

preload a compressed audio file

the compressed audio will be decode to wave, then write into an internal buffer in SimpleaudioEngine

Implements AudioPlayer.

virtual void resumeAllEffects ( )
virtual

resume a effect identified by sound id

Implements AudioPlayer.

var resumeAllEffects ( )
virtual

resume a effect identified by sound id

Implements AudioPlayer.

local resumeAllEffects ( )
virtual

resume a effect identified by sound id

Implements AudioPlayer.

virtual void resumeBackgroundMusic ( )
virtual

Resume playing background music.

Implements AudioPlayer.

var resumeBackgroundMusic ( )
virtual

Resume playing background music.

Implements AudioPlayer.

local resumeBackgroundMusic ( )
virtual

Resume playing background music.

Implements AudioPlayer.

virtual void resumeEffect ( unsigned int  uSoundId)
virtual

resume an effect identified by sound id

Parameters
[in]uSoundIdsound id

Implements AudioPlayer.

var resumeEffect ( var  uSoundId)
virtual

resume an effect identified by sound id

Parameters
[in]uSoundIdsound id

Implements AudioPlayer.

local resumeEffect ( local  uSoundId)
virtual

resume an effect identified by sound id

Parameters
[in]uSoundIdsound id

Implements AudioPlayer.

virtual void rewindBackgroundMusic ( )
virtual

Rewind playing background music.

Implements AudioPlayer.

var rewindBackgroundMusic ( )
virtual

Rewind playing background music.

Implements AudioPlayer.

local rewindBackgroundMusic ( )
virtual

Rewind playing background music.

Implements AudioPlayer.

virtual void
setBackgroundMusicVolume
( float  volume)
virtual

set the volume of background music

Parameters
volumemust be in 0.0~1.0

Implements AudioPlayer.

var setBackgroundMusicVolume ( var  volume)
virtual

set the volume of background music

Parameters
volumemust be in 0.0~1.0

Implements AudioPlayer.

local setBackgroundMusicVolume ( local  volume)
virtual

set the volume of background music

Parameters
volumemust be in 0.0~1.0

Implements AudioPlayer.

virtual void setEffectsVolume ( float  volume)
virtual

set the volume of sound effecs

Parameters
volumemust be in 0.0~1.0

Implements AudioPlayer.

var setEffectsVolume ( var  volume)
virtual

set the volume of sound effecs

Parameters
volumemust be in 0.0~1.0

Implements AudioPlayer.

local setEffectsVolume ( local  volume)
virtual

set the volume of sound effecs

Parameters
volumemust be in 0.0~1.0

Implements AudioPlayer.

static FmodAudioPlayer*
sharedPlayer
( )
static
var sharedPlayer ( )
static
local sharedPlayer ( )
static
virtual void stopAllEffects ( )
virtual

stop all playing effects

Implements AudioPlayer.

var stopAllEffects ( )
virtual

stop all playing effects

Implements AudioPlayer.

local stopAllEffects ( )
virtual

stop all playing effects

Implements AudioPlayer.

virtual void stopBackgroundMusic ( bool  bReleaseData)
virtual

Stop playing background music.

Parameters
bReleaseDataIf release the background music data or not.As default value is false

Implements AudioPlayer.

var stopBackgroundMusic ( var  bReleaseData)
virtual

Stop playing background music.

Parameters
bReleaseDataIf release the background music data or not.As default value is false

Implements AudioPlayer.

local stopBackgroundMusic ( local  bReleaseData)
virtual

Stop playing background music.

Parameters
bReleaseDataIf release the background music data or not.As default value is false

Implements AudioPlayer.

virtual void stopEffect ( unsigned int  nSoundId)
virtual

Stop playing sound effect.

Parameters
nSoundIdThe return value of function playEffect

Implements AudioPlayer.

var stopEffect ( var  nSoundId)
virtual

Stop playing sound effect.

Parameters
nSoundIdThe return value of function playEffect

Implements AudioPlayer.

local stopEffect ( local  nSoundId)
virtual

Stop playing sound effect.

Parameters
nSoundIdThe return value of function playEffect

Implements AudioPlayer.

virtual void unloadEffect ( const char *  pszFilePath)
virtual

unload the preloaded effect from internal buffer

Parameters
[in]pszFilePathThe path of the effect file,or the FileName of T_SoundResInfo

Implements AudioPlayer.

var unloadEffect ( var  pszFilePath)
virtual

unload the preloaded effect from internal buffer

Parameters
[in]pszFilePathThe path of the effect file,or the FileName of T_SoundResInfo

Implements AudioPlayer.

local unloadEffect ( local  pszFilePath)
virtual

unload the preloaded effect from internal buffer

Parameters
[in]pszFilePathThe path of the effect file,or the FileName of T_SoundResInfo

Implements AudioPlayer.

virtual bool
willPlayBackgroundMusic
( )
virtual

Implements AudioPlayer.

var willPlayBackgroundMusic ( )
virtual

Implements AudioPlayer.

local willPlayBackgroundMusic ( )
virtual

Implements AudioPlayer.


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