cocos2d-x  3.4
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
AudioPlayer Class Reference

#include <AudioPlayer.h>

Public Member Functions

 AudioPlayer ()
 ~AudioPlayer ()
bool init (SLEngineItf engineEngine, SLObjectItf outputMixObject, const std::string &fileFullPath, float volume, bool loop)
 AudioPlayer ()
 ~AudioPlayer ()
bool setTime (float time)
float getTime ()
bool setLoop (bool loop)
 AudioPlayer ()
 AudioPlayer (const AudioPlayer &)
 ~AudioPlayer ()
bool setTime (float time)
float getTime ()
bool setLoop (bool loop)

Public Attributes

bool _playOver
bool _loop
SLPlayItf _fdPlayerPlay

Protected Member Functions

void rotateBufferThread (int offsetFrame)
bool play2d (AudioCache *cache)
void rotateBufferThread (int offsetFrame)
bool play2d (AudioCache *cache)

Protected Attributes

AudioCache_audioCache
float _volume
std::function< void(int, const
std::string &)> 
_finishCallbak
bool _ready
ALuint _alSource
float _currTime
bool _streamingSource
ALuint _bufferIds [3]
std::thread _rotateBufferThread
std::condition_variable _sleepCondition
std::mutex _sleepMutex
bool _exitThread
bool _timeDirty

Friends

class AudioEngineImpl

Constructor & Destructor Documentation

AudioPlayer ( const AudioPlayer )

Member Function Documentation

float getTime ( )
inline
float getTime ( )
inline
bool init ( SLEngineItf  engineEngine,
SLObjectItf  outputMixObject,
const std::string &  fileFullPath,
float  volume,
bool  loop 
)
bool play2d ( AudioCache cache)
protected
bool play2d ( AudioCache cache)
protected
void rotateBufferThread ( int  offsetFrame)
protected
void rotateBufferThread ( int  offsetFrame)
protected
bool setLoop ( bool  loop)
bool setLoop ( bool  loop)
bool setTime ( float  time)
bool setTime ( float  time)

Friends And Related Function Documentation

Member Data Documentation

ALuint _alSource
protected
AudioCache * _audioCache
protected
ALuint _bufferIds
protected
float _currTime
protected
bool _exitThread
protected
SLPlayItf _fdPlayerPlay
std::function< void(int, const
std::string &)> _finishCallbak
protected
bool _loop
bool _playOver
bool _ready
protected
std::thread _rotateBufferThread
protected
std::condition_variable
_sleepCondition
protected
std::mutex _sleepMutex
protected
bool _streamingSource
protected
bool _timeDirty
protected
float _volume
protected

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