Class AudioAnalyzerPlayerUnit

Inheritance Relationships

Derived Type

Class Documentation

class AudioAnalyzerPlayerUnit

Audio Analyzer Player Unit.

This class will be used to load audio from a disk file and interact with it using the most basic player options (play/stop/pause)

Subclassed by AudioAnalyzerPlayerUnitFile

Public Functions

inline AudioAnalyzerPlayerUnit()

Constructor

inline AudioAnalyzerPlayerUnit(AudioAnalyzerPlayer *parentPlayer)

Constructor

Parameters:

parentPlayer – Pointer to the parent class

inline virtual ~AudioAnalyzerPlayerUnit()

Destructor

AudioAnalyzerPlayerUnit(AudioAnalyzerPlayerUnit const &x) = delete

Disable copy constructor

Parameters:

x – —

void operator=(AudioAnalyzerPlayerUnit const &x) = delete

Disable copy assignment

Parameters:

x – —

virtual bool loadAudio(uint32 periodSizeInFrames, uint32 periodSizeInMilliseconds, uint32 periods) = 0

Initializes the player device

Parameters:
  • periodSizeInFrames – Device audio buffer size in frames (power of 2), 0 to use default value

  • periodSizeInMilliseconds – Device audio buffer size in milliseconds, 0 to use default value

  • periods – Device audio buffer size multiplier

Returns:

Audio initilization execution result

virtual void unloadAudio() = 0

Closes audio player device

virtual void play(int maxLoops, float startTime) = 0

Starts audio playback

Parameters:
  • maxLoops – Number of loops

  • startTime – Starting position (seconds)

virtual void stop() = 0

Stops audio playback

virtual void pause(bool forcePause = true) = 0

Pauses audio playback if the device is in playing state UnPauses audio playback if the device has been paused previously

Parameters:

forcePause – Set the pause to this state

virtual bool isPlaying() const = 0

Returns if the device is currently playing audio

Returns:

Device is playing

virtual bool isPaused() const = 0

Returns if the device is currently paused

Returns:

Device is paused

virtual float getPlaybackProgress(float &bufferPosTime) = 0

Returns the playback progress and buffer postion time

Parameters:

bufferPosTime[out] Buffer position (same as below value)

Returns:

float Progress in seconds

virtual float getPlaybackProgress() = 0

Returns the playback progress

Returns:

float Progress in seconds

virtual void setPlaybackProgress(float time) = 0

Sets the playback progress

Parameters:

time – New playback position in seconds

virtual float getPlaybackVolume() = 0

Returns the playback volume

Returns:

volume in range 0.0-1.0

virtual void setPlaybackVolume(float volume) = 0

Sets the playback volume

Parameters:

volume – New volume in range 0.0-1.0

virtual float getTotalDuration() const = 0

Returns the total audio duration

Returns:

Duration in seconds

virtual void setAudioBufferSize(float seconds) = 0

Sets a new buffer audio size

Parameters:

seconds – Buffer size in seconds

inline const int getRemainingLoops() const

Get remaining loops

Returns:

remainingLoops

Protected Attributes

AudioAnalyzerPlayer *_parentPlayer

Parent player class pointer

int _remainingLoops

Current Loop

float _startTime

Start time for loops