|
pianod2
multisource multiuser scriptable networked music player
|
Base class for audio players that are spawned to a new thread. More...
#include <mediaplayer.h>


Public Member Functions | |
| virtual void | pausing (void) |
| Invoked when pausing. More... | |
| virtual void | resuming (void) |
| Invoked when when resuming. More... | |
| ThreadedPlayer (void) | |
| virtual | ~ThreadedPlayer (void) |
Public Member Functions inherited from Media::Player | |
| virtual | ~Player (void) |
| virtual void | setVolume (float volume)=0 |
| Adjust volume in decibels. More... | |
| virtual float | trackDuration (void) const =0 |
| Length of track in seconds, or a negative number if unknown. More... | |
| virtual float | playPoint (void) const =0 |
| Seconds from start, or a negative value if unknown. More... | |
| virtual float | playRemaining (void) const |
| Seconds left in playback, or a negative number if unknown. More... | |
| virtual State | currentState (void) const =0 |
| 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... | |
Protected Member Functions | |
| bool | checkForPauseOrQuit (void) |
| virtual RESPONSE_CODE | playerThread (void)=0 |
Private Member Functions | |
| void | setThreadState (bool pause, bool quit) |
| virtual void | pause (void) override |
| Implementations. More... | |
| virtual void | abort () override |
| Don't play the rest of the song. More... | |
| virtual void | cue (void) override |
| Starts thread in paused mode. More... | |
| virtual void | play (void) override |
| Calls resume() to starting playback. More... | |
| virtual RESPONSE_CODE | completionStatus (void) override |
| Get the player completion status, when it is done. More... | |
Private Attributes | |
| volatile bool | do_quit = false |
| protected by pauseMutex More... | |
| volatile bool | do_pause = true |
| protected by pauseMutex More... | |
| std::mutex | pause_mutex |
| std::condition_variable | pause_changed |
| std::thread | player_thread |
| std::future< RESPONSE_CODE > | player_response |
Additional Inherited Members | |
Public Types inherited from Media::Player | |
| enum | State { DoesNotExist , Initializing , Cueing , Playing , Done } |
Static Public Member Functions inherited from Media::Player | |
| static Media::Player * | getPlayer (const AudioSettings &settings, const std::string &media_url, float initial_gain) |
| Get the a media player currently compiled in the code. More... | |
Base class for audio players that are spawned to a new thread.
| Media::ThreadedPlayer::ThreadedPlayer | ( | void | ) |
|
virtual |
|
overrideprivatevirtual |
Don't play the rest of the song.
Implements Media::Player.

|
protected |


|
overrideprivatevirtual |
Get the player completion status, when it is done.
| If | the player thread threw an exception, the promise/ future holds it and get() rethrows it when asked for it. |
Implements Media::Player.
|
overrideprivatevirtual |
Starts thread in paused mode.
Start the player thread.
Starts in a paused state.
Implements Media::Player.

|
overrideprivatevirtual |
Implementations.
Pause playback. If already paused, do nothing.
Implements Media::Player.


|
virtual |
Invoked when pausing.
Called when the playback thread is pausing.
Reimplemented in Audio::LavPlayer.

|
overrideprivatevirtual |
Calls resume() to starting playback.
Implements Media::Player.

|
protectedpure virtual |
Implemented in ToneGenerator::Player, and Audio::LavPlayer.

|
virtual |
Invoked when when resuming.
Called when the playback thread is resuming playback.
Reimplemented in Audio::LavPlayer.

|
private |


|
private |
protected by pauseMutex
|
private |
protected by pauseMutex
|
private |
|
private |
|
private |
|
private |