arduino-audio-tools
Public Member Functions | Protected Attributes | List of all members
AudioSourceCallback Class Reference

Callback Audio Data Source which is used by the Audio Players. More...

#include <AudioSource.h>

Inheritance diagram for AudioSourceCallback:
AudioSource

Public Member Functions

 AudioSourceCallback (Stream *(*nextStreamCallback)(int offset), void(*onStartCallback)()=nullptr)
 
virtual void begin () override
 Reset actual stream and move to root.
 
virtual const char * getPath ()
 
virtual bool isAutoNext () override
 Returns default setting go to the next.
 
virtual StreamnextStream (int offset) override
 Returns next (with positive index) or previous stream (with negative index)
 
virtual StreampreviousStream (int offset)
 Returns previous audio stream.
 
virtual StreamselectStream (const char *path) override
 Returns audio stream by path.
 
virtual StreamselectStream (int index) override
 Returns selected audio stream.
 
virtual void setAutoNext (bool a)
 
void setCallbackNextStream (Stream *(*callback)(int offset))
 
void setCallbackOnStart (void(*callback)())
 
void setCallbackSelectStream (Stream *(*callback)(int idx))
 
virtual StreamsetIndex (int index)
 same as selectStream - I just prefer this name
 
virtual bool setMetadataCallback (void(*fn)(MetaDataType info, const char *str, int len), ID3TypeSelection sel=SELECT_ICY)
 
virtual void setTimeout (int millisec)
 Sets the timeout of Stream in milliseconds.
 
virtual void setTimeoutAutoNext (int millisec)
 Sets the timeout which is triggering to move to the next stream. - the default value is 500 ms.
 
virtual int timeoutAutoNext ()
 Provides the timeout which is triggering to move to the next stream.
 

Protected Attributes

bool auto_next = true
 
Stream *(* indexStreamCallback )(int index) = nullptr
 
Stream *(* nextStreamCallback )(int offset) = nullptr
 
void(* onStartCallback )() = nullptr
 
const char * path =nullptr
 
int timeout_auto_next_value = 500
 

Detailed Description

Callback Audio Data Source which is used by the Audio Players.

Author
Phil Schatzmann

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