arduino-audio-tools
Loading...
Searching...
No Matches
Public Member Functions | Protected Attributes | List of all members
audio_tools::AudioSourceCallback Class Reference

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

#include <AudioSource.h>

Inheritance diagram for audio_tools::AudioSourceCallback:
audio_tools::AudioSource

Public Member Functions

 AudioSourceCallback (Stream *(*nextStreamCallback)(), void(*onStartCallback)()=nullptr)
 
virtual void begin () override
 Reset actual stream and move to root. More...
 
virtual const char * getPath ()
 
virtual bool isAutoNext () override
 Returns default setting go to the next. More...
 
virtual StreamnextStream (int offset) override
 Returns next (with positive index) or previous stream (with negative index) More...
 
virtual StreamselectStream (const char *path) override
 Returns audio stream by path. More...
 
virtual StreamselectStream (int index) override
 Returns selected audio stream. More...
 
virtual void setAutoNext (bool a)
 
void setCallbackNextStream (Stream *(*callback)())
 
void setCallbackOnStart (void(*callback)())
 
void setCallbackSelectStream (Stream *(*callback)(int idx))
 
- Public Member Functions inherited from audio_tools::AudioSource
virtual void begin ()=0
 Reset actual stream and move to root. More...
 
virtual bool isAutoNext ()
 Returns default setting go to the next. More...
 
virtual StreamnextStream (int offset)=0
 Returns next audio stream. More...
 
virtual StreampreviousStream (int offset)
 Returns previous audio stream. More...
 
virtual StreamselectStream (const char *path)=0
 Returns audio stream by path. More...
 
virtual StreamselectStream (int index)
 Returns audio stream at the indicated index (the index is zero based, so the first value is 0!) More...
 
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. More...
 
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 )() = nullptr
 
void(* onStartCallback )() = nullptr
 
const char * path =nullptr
 
- Protected Attributes inherited from audio_tools::AudioSource
int timeout_auto_next_value = 500
 

Detailed Description

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

Author
Phil Schatzmann

Member Function Documentation

◆ begin()

virtual void audio_tools::AudioSourceCallback::begin ( )
inlineoverridevirtual

Reset actual stream and move to root.

Implements audio_tools::AudioSource.

◆ isAutoNext()

virtual bool audio_tools::AudioSourceCallback::isAutoNext ( )
inlineoverridevirtual

Returns default setting go to the next.

Reimplemented from audio_tools::AudioSource.

◆ nextStream()

virtual Stream * audio_tools::AudioSourceCallback::nextStream ( int  offset)
inlineoverridevirtual

Returns next (with positive index) or previous stream (with negative index)

Implements audio_tools::AudioSource.

◆ selectStream() [1/2]

virtual Stream * audio_tools::AudioSourceCallback::selectStream ( const char *  path)
inlineoverridevirtual

Returns audio stream by path.

Implements audio_tools::AudioSource.

◆ selectStream() [2/2]

virtual Stream * audio_tools::AudioSourceCallback::selectStream ( int  index)
inlineoverridevirtual

Returns selected audio stream.

Reimplemented from audio_tools::AudioSource.


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