V-Gears 0
Free Final Fantasy VII engine.
AudioManager::Player Class Reference

An audio player. More...

Collaboration diagram for AudioManager::Player:

Public Member Functions

 Player (boost::recursive_mutex *mutex)
 Constructor. More...
 
 ~Player ()
 Destructor. More...
 
void Pause ()
 Pauses the player. More...
 
void Play (const Ogre::String &file)
 Plays an audio file. More...
 
void Resume ()
 Resumes the playback of a paused player. More...
 
void Stop ()
 Stops the audio player. More...
 
void SetLoop (const float loop)
 Sets the loop for the current track. More...
 
void Update ()
 Updates the audio player. More...
 
float GetPosition ()
 Get the playing position of the current track. More...
 

Private Member Functions

ALsizei FillBuffer ()
 Fills the audio buffer. More...
 

Private Attributes

boost::recursive_mutex * update_mutex_
 Mutex to handle concurrent update on the player. More...
 
float loop_
 Loop point for the current track. More...
 
Ogre::String file_
 Name of the file currently being played. More...
 
OggVorbis_File vorbis_file_
 File played or to play. More...
 
vorbis_info * vorbis_info_
 Info about the track. More...
 
int vorbis_section_
 Section of the track. More...
 
bool stream_finished_
 Indicates if the stream is finished. More...
 
char * buffer_
 Audio buffer. More...
 
ALuint source_
 Audio source. More...
 

Detailed Description

An audio player.

Constructor & Destructor Documentation

◆ Player()

AudioManager::Player::Player ( boost::recursive_mutex *  mutex)

Constructor.

Parameters
[in]mutexMutex to handle concurrent updates.

◆ ~Player()

AudioManager::Player::~Player ( )

Destructor.

Member Function Documentation

◆ FillBuffer()

ALsizei AudioManager::Player::FillBuffer ( )
private

Fills the audio buffer.

Returns
Size of the data added to the buffer.

◆ GetPosition()

float AudioManager::Player::GetPosition ( )

Get the playing position of the current track.

Returns
Playing position.
Todo:
Is this in seconds?

◆ Pause()

void AudioManager::Player::Pause ( )

Pauses the player.

◆ Play()

void AudioManager::Player::Play ( const Ogre::String &  file)

Plays an audio file.

Parameters
[in]filePath to the file to play

◆ Resume()

void AudioManager::Player::Resume ( )

Resumes the playback of a paused player.

If no track was paused, an error wilt be printed and nothing will be done.

◆ SetLoop()

void AudioManager::Player::SetLoop ( const float  loop)

Sets the loop for the current track.

Parameters
[in]loopLoop point

◆ Stop()

void AudioManager::Player::Stop ( )

Stops the audio player.

◆ Update()

void AudioManager::Player::Update ( )

Updates the audio player.

Todo:
Understand and document.

Member Data Documentation

◆ buffer_

char* AudioManager::Player::buffer_
private

Audio buffer.

◆ file_

Ogre::String AudioManager::Player::file_
private

Name of the file currently being played.

◆ loop_

float AudioManager::Player::loop_
private

Loop point for the current track.

◆ source_

ALuint AudioManager::Player::source_
private

Audio source.

◆ stream_finished_

bool AudioManager::Player::stream_finished_
private

Indicates if the stream is finished.

◆ update_mutex_

boost::recursive_mutex* AudioManager::Player::update_mutex_
private

Mutex to handle concurrent update on the player.

◆ vorbis_file_

OggVorbis_File AudioManager::Player::vorbis_file_
private

File played or to play.

◆ vorbis_info_

vorbis_info* AudioManager::Player::vorbis_info_
private

Info about the track.

◆ vorbis_section_

int AudioManager::Player::vorbis_section_
private

Section of the track.


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