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

Audio Source which provides the data via the network from an URL. The URLs are stored in an Vector of dynamically allocated strings. More...

#include <AudioSourceURL.h>

Inheritance diagram for AudioSourceDynamicURL:
AudioSourceURL AudioSource

Public Member Functions

 AudioSourceDynamicURL (AbstractURLStream &urlStream, const char *mime=nullptr, int startPos=0)
 
template<typename T , size_t N>
 AudioSourceDynamicURL (AbstractURLStream &urlStream, T(&urlArray)[N], const char *mime, int startPos=0)
 
void addURL (const char *url)
 add a new url: a copy of the string will be stored on the heap
 
virtual bool begin () override
 Setup Wifi URL.
 
void clear ()
 
void end ()
 
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 and adds it to the list.
 
StreamselectStream (int idx) override
 Opens the selected url from the array.
 
virtual void setAutoNext (bool flag)
 
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)
 
int size () override
 
virtual int timeoutAutoNext ()
 Provides the timeout which is triggering to move to the next stream.
 
const chartoStr ()
 provides the actual stream (e.g. file) name or url
 

Protected Member Functions

const charvalue (int pos) override
 

Protected Attributes

AbstractURLStreamactual_stream = nullptr
 
bool is_auto_next = true
 
int max = 0
 
const charmime = nullptr
 
int pos = 0
 
bool started = false
 
int timeout_auto_next_value = 500
 
Vector< Strurl_vector
 
const char ** urlArray = nullptr
 

Detailed Description

Audio Source which provides the data via the network from an URL. The URLs are stored in an Vector of dynamically allocated strings.

Author
Phil Schatzmann

Constructor & Destructor Documentation

◆ AudioSourceDynamicURL() [1/2]

template<typename T , size_t N>
AudioSourceDynamicURL ( AbstractURLStream urlStream,
T(&)  urlArray[N],
const char mime,
int  startPos = 0 
)
inline

◆ AudioSourceDynamicURL() [2/2]

AudioSourceDynamicURL ( AbstractURLStream urlStream,
const char mime = nullptr,
int  startPos = 0 
)
inline

Member Function Documentation

◆ addURL()

void addURL ( const char url)
inline

add a new url: a copy of the string will be stored on the heap

◆ begin()

virtual bool begin ( )
inlineoverridevirtualinherited

Setup Wifi URL.

Implements AudioSource.

◆ clear()

void clear ( )
inline

◆ end()

void end ( )
inlineinherited

◆ index()

int index ( )
inlinevirtualinherited

Returns the actual index of the stream.

Reimplemented from AudioSource.

◆ isAutoNext()

virtual bool isAutoNext ( )
inlinevirtualinherited

Returns default setting go to the next.

Reimplemented from AudioSource.

◆ nextStream()

Stream * nextStream ( int  offset)
inlineoverridevirtualinherited

Opens the next url from the array.

Implements AudioSource.

◆ operator[]()

Stream * operator[] ( int  idx)
inlineinherited

access with array syntax

◆ previousStream()

Stream * previousStream ( int  offset)
inlineoverridevirtualinherited

Opens the Previous url from the array.

Reimplemented from AudioSource.

◆ selectStream() [1/2]

Stream * selectStream ( const char path)
inlineoverridevirtual

Opens the selected url and adds it to the list.

Implements AudioSource.

◆ selectStream() [2/2]

Stream * selectStream ( int  idx)
inlineoverridevirtualinherited

Opens the selected url from the array.

Reimplemented from AudioSource.

◆ setAutoNext()

virtual void setAutoNext ( bool  flag)
inlinevirtualinherited

Reimplemented in AudioSourceCallback.

◆ setIndex()

virtual Stream * setIndex ( int  index)
inlinevirtualinherited

same as selectStream - I just prefer this name

◆ setMetadataCallback()

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

Reimplemented from AudioSource.

◆ setTimeout()

void setTimeout ( int  millisec)
inlinevirtualinherited

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

◆ size()

int size ( )
inlineoverridevirtual

Reimplemented from AudioSourceURL.

◆ timeoutAutoNext()

virtual int timeoutAutoNext ( )
inlinevirtualinherited

Provides the timeout which is triggering to move to the next stream.

◆ toStr()

const char * toStr ( )
inlinevirtualinherited

provides the actual stream (e.g. file) name or url

Reimplemented from AudioSource.

◆ value()

const char * value ( int  pos)
inlineoverrideprotectedvirtual

Reimplemented from AudioSourceURL.

Member Data Documentation

◆ actual_stream

AbstractURLStream* actual_stream = nullptr
protectedinherited

◆ is_auto_next

bool is_auto_next = true
protectedinherited

◆ max

int max = 0
protectedinherited

◆ mime

const char* mime = nullptr
protectedinherited

◆ pos

int pos = 0
protectedinherited

◆ started

bool started = false
protectedinherited

◆ timeout_auto_next_value

int timeout_auto_next_value = 500
protectedinherited

◆ url_vector

Vector<Str> url_vector
protected

◆ urlArray

const char** urlArray = nullptr
protectedinherited

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