arduino-audio-tools
All Classes Namespaces Files Functions Variables Typedefs Enumerations Friends Modules Pages
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
AudioSourceURL Class Reference

Audio Source which provides the data via the network from an URL. More...

#include <AudioSourceURL.h>

Inheritance diagram for AudioSourceURL:
AudioSource AudioSourceDynamicURL

Public Member Functions

template<typename T , size_t N>
 AudioSourceURL (AbstractURLStream &urlStream, T(&urlArray)[N], const char *mime, int startPos=0)
 
virtual void begin () override
 Setup Wifi URL.
 
int index ()
 Returns the actual index of the stream.
 
virtual bool isAutoNext ()
 Returns default setting go to the next.
 
StreamnextStream (int offset) override
 Opens the next url from the array.
 
Streamoperator[] (int idx)
 access with array syntax
 
StreampreviousStream (int offset) override
 Opens the Previous url from the array.
 
StreamselectStream (const char *path) override
 Opens the selected url.
 
StreamselectStream (int idx) override
 Opens the selected url from the array.
 
virtual StreamsetIndex (int index)
 same as selectStream - I just prefer this name
 
bool setMetadataCallback (void(*fn)(MetaDataType info, const char *str, int len), ID3TypeSelection sel=SELECT_ICY)
 
void setTimeout (int millisec)
 Sets the timeout of the URL Stream in milliseconds.
 
virtual void setTimeoutAutoNext (int millisec)
 
virtual int timeoutAutoNext ()
 Provides the timeout which is triggering to move to the next stream.
 
const char * toStr ()
 provides the actual file name or url
 

Protected Member Functions

 AudioSourceURL ()=default
 allow use with empty constructor in subclasses
 
virtual int size ()
 
virtual const char * value (int pos)
 

Protected Attributes

AbstractURLStreamactual_stream = nullptr
 
int max = 0
 
const char * mime = nullptr
 
int pos = 0
 
bool started = false
 
int timeout_auto_next_value = 500
 
const char ** urlArray = nullptr
 

Detailed Description

Audio Source which provides the data via the network from an URL.

Author
Phil Schatzmann

Member Function Documentation

◆ begin()

virtual void begin ( )
inlineoverridevirtual

Setup Wifi URL.

Implements AudioSource.

◆ index()

int index ( )
inlinevirtual

Returns the actual index of the stream.

Reimplemented from AudioSource.

◆ isAutoNext()

virtual bool isAutoNext ( )
inlinevirtual

Returns default setting go to the next.

Reimplemented from AudioSource.

◆ nextStream()

Stream * nextStream ( int  offset)
inlineoverridevirtual

Opens the next url from the array.

Implements AudioSource.

◆ previousStream()

Stream * previousStream ( int  offset)
inlineoverridevirtual

Opens the Previous url from the array.

Reimplemented from AudioSource.

◆ selectStream() [1/2]

Stream * selectStream ( const char *  path)
inlineoverridevirtual

Opens the selected url.

Implements AudioSource.

◆ selectStream() [2/2]

Stream * selectStream ( int  idx)
inlineoverridevirtual

Opens the selected url from the array.

Reimplemented from AudioSource.

◆ setMetadataCallback()

bool setMetadataCallback ( void(*)(MetaDataType info, const char *str, int len)  fn,
ID3TypeSelection  sel = SELECT_ICY 
)
inlinevirtual

Reimplemented from AudioSource.

◆ setTimeout()

void setTimeout ( int  millisec)
inlinevirtual

Sets the timeout of the URL Stream in milliseconds.

Reimplemented from AudioSource.

◆ setTimeoutAutoNext()

virtual void setTimeoutAutoNext ( int  millisec)
inlinevirtualinherited

Sets the timeout which is triggering to move to the next stream. - the default value is 500 ms

◆ toStr()

const char * toStr ( )
inlinevirtual

provides the actual file name or url

Reimplemented from AudioSource.


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