pianod2
multisource multiuser scriptable networked music player
Classes | Public Member Functions | Public Attributes | Private Types | Private Attributes | List of all members
ToneGenerator::Player Class Reference

#include <tonegen.h>

Inheritance diagram for ToneGenerator::Player:
Inheritance graph
[legend]
Collaboration diagram for ToneGenerator::Player:
Collaboration graph
[legend]

Classes

struct  audio_sample
 

Public Member Functions

 Player (const AudioSettings &audio, const PianodSong *song)
 
void createTone (int volume)
 
virtual void setVolume (float volume) override
 Adjust volume in decibels. More...
 
State currentState (void) const override
 
virtual float trackDuration (void) const override
 Length of track in seconds, or a negative number if unknown. More...
 
virtual float playPoint (void) const override
 Seconds from start, or a negative value if unknown. More...
 
virtual RESPONSE_CODE playerThread (void) override
 
- Public Member Functions inherited from Media::ThreadedPlayer
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 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...
 

Public Attributes

const AudioSettings audio
 
const Songsong
 
const TEST_SONGmedia
 
volatile int repetitions = 0
 
volatile int current_rep = 0
 
int seconds_into_rep = 0
 
std::unique_ptr< AUDIO_SAMPLEtone
 
float duration = 0
 
long samples = 0
 

Private Types

using channel_sample = int16_t
 
typedef struct ToneGenerator::Player::audio_sample AUDIO_SAMPLE
 

Private Attributes

Audio::Outputoutput = nullptr
 

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::PlayergetPlayer (const AudioSettings &settings, const std::string &media_url, float initial_gain)
 Get the a media player currently compiled in the code. More...
 
- Protected Member Functions inherited from Media::ThreadedPlayer
bool checkForPauseOrQuit (void)
 

Member Typedef Documentation

◆ AUDIO_SAMPLE

◆ channel_sample

using ToneGenerator::Player::channel_sample = int16_t
private

Constructor & Destructor Documentation

◆ Player()

ToneGenerator::Player::Player ( const AudioSettings audio,
const PianodSong song 
)

Member Function Documentation

◆ createTone()

void ToneGenerator::Player::createTone ( int  volume)

◆ currentState()

State ToneGenerator::Player::currentState ( void  ) const
overridevirtual

Implements Media::Player.

◆ playerThread()

RESPONSE_CODE ToneGenerator::Player::playerThread ( void  )
overridevirtual

Implements Media::ThreadedPlayer.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ playPoint()

virtual float ToneGenerator::Player::playPoint ( void  ) const
overridevirtual

Seconds from start, or a negative value if unknown.

Implements Media::Player.

Here is the call graph for this function:

◆ setVolume()

virtual void ToneGenerator::Player::setVolume ( float  volume)
overridevirtual

Adjust volume in decibels.

Implements Media::Player.

◆ trackDuration()

virtual float ToneGenerator::Player::trackDuration ( void  ) const
overridevirtual

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

Implements Media::Player.

Member Data Documentation

◆ audio

const AudioSettings ToneGenerator::Player::audio

◆ current_rep

volatile int ToneGenerator::Player::current_rep = 0

◆ duration

float ToneGenerator::Player::duration = 0

◆ media

const TEST_SONG* ToneGenerator::Player::media

◆ output

Audio::Output* ToneGenerator::Player::output = nullptr
private

◆ repetitions

volatile int ToneGenerator::Player::repetitions = 0

◆ samples

long ToneGenerator::Player::samples = 0

◆ seconds_into_rep

int ToneGenerator::Player::seconds_into_rep = 0

◆ song

const Song* ToneGenerator::Player::song

◆ tone

std::unique_ptr<AUDIO_SAMPLE> ToneGenerator::Player::tone

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