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

AudioSource using the standard C++ api. More...

#include <AudioSourceSTD.h>

Inheritance diagram for AudioSourceSTD:
AudioSource

Public Member Functions

 AudioSourceSTD (const char *startFilePath="/", const char *ext=".mp3")
 Default constructor.
 
virtual void begin () override
 Reset actual stream and move to root.
 
void end ()
 
int index ()
 Provides the current index position.
 
virtual bool isAutoNext ()
 Returns default setting go to the next.
 
virtual StreamnextStream (int offset=1) override
 Returns next audio stream.
 
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 audio stream at the indicated index (the index is zero based, so the first value is 0!)
 
void setFileFilter (const char *filter)
 
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 setPath (const char *p)
 Allows to "correct" the start path if not defined in the constructor.
 
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.
 
long size ()
 Provides the number of files (The max index is size()-1): WARNING this is very slow if you have a lot of files in many subdirectories.
 
virtual int timeoutAutoNext ()
 Provides the timeout which is triggering to move to the next stream.
 
const char * toStr ()
 provides the actual file name
 

Protected Member Functions

const char * get (int idx)
 
bool isValidAudioFile (fs::directory_entry file)
 checks if the file is a valid audio file
 

Protected Attributes

fs::directory_entry entry
 
const char * exension = ""
 
File file
 
const char * file_name
 
const char * file_name_pattern = "*"
 
size_t idx_pos = 0
 
const char * start_path = nullptr
 
int timeout_auto_next_value = 500
 

Detailed Description

AudioSource using the standard C++ api.

Author
Phil Schatzmann

Member Function Documentation

◆ setFileFilter()

void setFileFilter ( const char *  filter)
inline

Defines the regex filter criteria for selecting files. E.g. ".*Bob Dylan.*"


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