SID Player
All Classes Functions Pages
Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | List of all members
audio_tools::SIDPlayer Class Reference

SID player which is based on the AudioPlayer from the AudioTools project and the SidPlayer provided by Gunnar Larsen. The SID emulation is based on cSID light by Hermit (Mihaly Horvath), (Year 2017). More...

#include <SIDPlayer.h>

Inheritance diagram for audio_tools::SIDPlayer:

Public Member Functions

 SIDPlayer (AudioSource &source, AudioOutput &output, SizeSource &sizeSource)
 
 SIDPlayer (AudioSource &source, AudioStream &output, SizeSource &sizeSource)
 
bool begin (int index=0, bool isActive=true)
 (Re)Starts the playing of the music (from the beginning)
 
void end ()
 Ends the processing.
 
void setAudioInfo (AudioInfo info) override
 Updates the audio info in the related objects.
 
AudioInfo audioInfo () override
 
void play ()
 starts / resumes the playing of a matching song
 
void stop ()
 halts the playing
 
bool previous (int offset=1)
 moves to previous file
 
bool next (int offset=1)
 
bool nextTune (int offset=1)
 moves to next tune
 
bool setIndex (int idx)
 moves to selected file
 
bool setPath (const char *path)
 moves to selected file
 
Stream * getStream ()
 Provides the actual stream (=e.g.file)
 
bool isActive ()
 determines if the player is active
 
 operator bool ()
 determines if the player is active
 
void setActive (bool isActive)
 The same like start() / stop()
 
void setVolume (float volume)
 sets the volume - values need to be between 0.0 and 1.0
 
float volume ()
 Determines the actual volume.
 
void setSilenceOnInactive (bool active)
 
bool isSilenceOnInactive ()
 Checks if silence_on_inactive has been activated (default false)
 
void setTimeout (size_t timeout)
 
void copy ()
 Call this method in the loop.
 

Protected Types

enum  proces_state_enum { Initial , Playing }
 

Protected Member Functions

Print * getOutput ()
 
void loadSID ()
 
void setIsPlayingTimeout ()
 calculates when the song expires
 
bool isPlayingTimedOut ()
 checks if the song has expired
 
void moveNextOnEnd ()
 
void setSIDAsInput ()
 Make sure that we copy the data from the sid stream to the output.
 

Protected Attributes

AudioPlayer player
 
SIDStream sid
 
Print * p_out
 
AudioInfoSupport * p_info
 
AudioInfo info
 
Vector< uint8_t > sid_data {0}
 
SizeSourcep_size_source = nullptr
 
proces_state_enum state = Initial
 
size_t timeout_sec = 0
 
size_t playing_timout_ms = 0
 

Detailed Description

SID player which is based on the AudioPlayer from the AudioTools project and the SidPlayer provided by Gunnar Larsen. The SID emulation is based on cSID light by Hermit (Mihaly Horvath), (Year 2017).

Author
Phil Schatzmann

Member Function Documentation

◆ next()

bool audio_tools::SIDPlayer::next ( int  offset = 1)
inline

moves to next file or nth next file when indicating an offset. Negative values are supported to move back.

◆ setSilenceOnInactive()

void audio_tools::SIDPlayer::setSilenceOnInactive ( bool  active)
inline

If set to true the player writes 0 values instead of no data if the player is inactive

◆ setTimeout()

void audio_tools::SIDPlayer::setTimeout ( size_t  timeout)
inline

automatically move to next song after the timeout (in seconds) has expired;


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