arduino-audio-tools
|
KA-Radio Protocol: We can use the KA-Radio protocol to control the audio player provided by the audiotools. Supported commands: play, instant, volume, volume+, volume-, pause, resume, stop, start, next, prev, mute, infos, version. Example: volume=50&play=128&infos See https://github.com/karawin/Ka-Radio32/blob/master/Interface.md. More...
#include <KARadioProtocol.h>
Classes | |
struct | Action |
Public Member Functions | |
KARadioProtocol () | |
Empty constructor: call setPlayer to define the player. | |
KARadioProtocol (AudioPlayer &player) | |
Default constructor. | |
void | addCommand (const char *cmd, bool(*cb)(AudioPlayer &player, Str &cmd, Str &par, Print &out, KARadioProtocol *self)) |
Add a new command. | |
int | index () |
Provides the actual index. | |
bool | processCommand (const char *input, Print &result) override |
bool | processCommand (Str &name, Str &arg, Print &result) |
Processes a single command. | |
bool | processCommand (Stream &input, Print &result) override |
Proceess commands passed by Stream (e.g. Serial) | |
void | setMaxInputBufferSize (int size) |
Defines the input buffer size used by the readLine function (default 256) | |
void | setPlayer (AudioPlayer &player) override |
Defines the player. | |
const char * | title () |
Provides the actual title. | |
Protected Member Functions | |
int | getEndPos (StrView &line, int start) |
int | readLine (Stream &in, char *str, int max) |
Reads a line delimited by ' ' from the stream. | |
const char * | stationName () |
Protected Attributes | |
Vector< Action > | actions |
int | max_input_buffer_size = 256 |
AudioPlayer * | p_player = nullptr |
Str | title_str = "n/a" |
int | volume = 0 |
KA-Radio Protocol: We can use the KA-Radio protocol to control the audio player provided by the audiotools. Supported commands: play, instant, volume, volume+, volume-, pause, resume, stop, start, next, prev, mute, infos, version. Example: volume=50&play=128&infos See https://github.com/karawin/Ka-Radio32/blob/master/Interface.md.
|
inlineoverridevirtual |
processes the commands and returns the result output via the Print object
Implements AudioPlayerProtocol.
Proceess commands passed by Stream (e.g. Serial)
Reimplemented from AudioPlayerProtocol.
|
inlineoverridevirtual |
Defines the player.
Reimplemented from AudioPlayerProtocol.