pianod2
multisource multiuser scriptable networked music player
Instance Methods | Private Attributes | List of all members
Audio::AVFoundationPlayer Class Reference

Base class for OS X's AVFoundation audio player. More...

Inheritance diagram for Audio::AVFoundationPlayer:
Inheritance graph
[legend]
Collaboration diagram for Audio::AVFoundationPlayer:
Collaboration graph
[legend]

Instance Methods

(virtual void) - pause
 Pause playback. If already paused, do nothing. More...
 
(virtual void) - abort
 Don't play the rest of the song. More...
 
(virtual void) - cue
 Starts thread in paused mode. More...
 
(virtual void) - play
 Start playback or resume playback if paused. If already playing, continue. More...
 
(virtual void) - setVolume
 Adjust volume in decibels. More...
 
(virtual State- currentState
 
(virtual float) - trackDuration
 Length of track in seconds, or a negative number if unknown. More...
 
(virtual float) - playPoint
 Seconds from start, or a negative value if unknown. More...
 
(virtual RESPONSE_CODE- completionStatus
 
() - AVFoundationPlayer
 Play a media file or URL using ffmpeg. More...
 
(virtual) - ~AVFoundationPlayer
 
- Instance Methods inherited from Media::Player
virtual ~Player (void)
 
virtual float playRemaining (void) const
 Seconds left in playback, or a negative number if unknown. More...
 
bool ready (void) const
 Indicate if player has finished initializing. More...
 
bool playbackComplete (void) const
 Indicate if playback is complete and ready for cleanup. More...
 
virtual time_t getPauseTimeout (void)
 When paused, get the time at which the song will expire. More...
 

Private Attributes

std::mutex avplayer_mutex
 
AVPlayer * audio_player = nil
 
volatile Media::Player::State state = Initializing
 
PlayerHelpermonitor = nullptr
 
float audio_gain
 

Additional Inherited Members

- Public Types inherited from Media::Player
enum  State {
  DoesNotExist , Initializing , Cueing , Playing ,
  Done
}
 
- Class Methods inherited from Media::Player
static Media::PlayergetPlayer (const AudioSettings &settings, const std::string &media_url, float initial_gain)
 Get the a media player currently compiled in the code. More...
 

Detailed Description

Base class for OS X's AVFoundation audio player.

Constructor & Destructor Documentation

◆ AVFoundationPlayer

- AVFoundationPlayer: (const std::string &)  media_url
(float)  initial_audio_gain = 0 

Play a media file or URL using ffmpeg.

Parameters
media_urlThe filename or URL of the media.
initial_audio_gainGain to apply when playing file, in decibels. If ReplayGain is encountered during playback, that is preferred over this value.
Here is the call graph for this function:

◆ ~AVFoundationPlayer

- AVFoundationPlayer: (void) 
Here is the call graph for this function:

Method Documentation

◆ abort

- (virtual void) AVFoundationPlayer: (void) 

Don't play the rest of the song.

Implements Media::Player.

◆ completionStatus

- (virtual RESPONSE_CODE) AVFoundationPlayer: (void) 

Implements Media::Player.

◆ cue

- (virtual void) AVFoundationPlayer: (void) 

Starts thread in paused mode.

Implements Media::Player.

◆ currentState

- (virtual State) AVFoundationPlayer: (void)  const

Implements Media::Player.

◆ pause

- (virtual void) AVFoundationPlayer: (void) 

Pause playback. If already paused, do nothing.

Implements Media::Player.

◆ play

- (virtual void) AVFoundationPlayer: (void) 

Start playback or resume playback if paused. If already playing, continue.

Implements Media::Player.

◆ playPoint

- (virtual float) AVFoundationPlayer: (void)  const

Seconds from start, or a negative value if unknown.

Implements Media::Player.

◆ setVolume

- (void) AVFoundationPlayer: (float)  volume

Adjust volume in decibels.

Implements Media::Player.

Here is the caller graph for this function:

◆ trackDuration

- (virtual float) AVFoundationPlayer: (void)  const

Length of track in seconds, or a negative number if unknown.

Implements Media::Player.

Member Data Documentation

◆ audio_gain

- (float) AVFoundationPlayer:
private

◆ audio_player

- (AVPlayer*) AVFoundationPlayer: = nil
private

◆ avplayer_mutex

- (mutex) Audio:
private

◆ monitor

- (PlayerHelper*) AVFoundationPlayer: = nullptr
private

◆ state

- (volatile) Player: = Initializing
mutableprivate

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