|
arduino-audio-tools
|
ESP32 AudioSource for AudioPlayer using an SD card as data source. An index file is used to speed up the access to the audio files by index. This class is based on the Arduino SD implementation For UTF8 Support change SdFatConfig.h define USE_UTF8_LONG_NAMES 1. More...
#include <AudioSourceIdxSDFAT.h>
Public Member Functions | |
| AudioSourceIdxSDFAT (AudioFs fs, const char *startFilePath="/", const char *ext="", bool setupIndex=true) | |
| Constructor for providing an open FS. | |
| AudioSourceIdxSDFAT (const char *startFilePath, const char *ext, SdSpiConfig &config, bool setupIndex=true) | |
| Costructor with SdSpiConfig. | |
| AudioSourceIdxSDFAT (const char *startFilePath="/", const char *ext=".mp3", int chipSelect=PIN_CS, int speedMHz=10, bool setupIndex=true) | |
| Default constructor. | |
| virtual | ~AudioSourceIdxSDFAT () |
| virtual bool | begin () override |
| Reset actual stream and move to root. | |
| void | end () |
| int | index () |
| Provides the current index position. | |
| int | indexOf (const char *filename) |
| Provides the index of the file with the given name. | |
| virtual bool | isAutoNext () |
| Returns default setting go to the next. | |
| const char * | name (int pos) |
| Provides the file name for the indicated index. | |
| virtual Stream * | nextStream (int offset=1) override |
| Returns next audio stream. | |
| Stream * | operator[] (int idx) |
| access with array syntax | |
| virtual Stream * | previousStream (int offset) |
| Returns previous audio stream. | |
| virtual Stream * | selectStream (const char *path) override |
| Returns audio stream by path: The index is not changed! | |
| virtual Stream * | selectStream (int index) override |
| virtual void | setAutoNext (bool flag) |
| void | setCreateIndex (bool rebuild) |
| Defines whether the index should be rebuild on begin. | |
| void | setFileFilter (const char *filter) |
| virtual Stream * | setIndex (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) |
| long | size () |
| Provides the number of files (The max index is size()-1) | |
| 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 * | getFileName (AudioFile &file) |
Protected Attributes | |
| int | cs |
| const char * | exension = nullptr |
| AudioFile | file |
| char | file_name [MAX_FILE_LEN] |
| const char * | file_name_pattern = "*" |
| SDIndex< AudioFs, AudioFile > | idx {sd} |
| size_t | idx_pos = 0 |
| bool | is_auto_next = true |
| bool | is_close_sd = true |
| bool | is_sd_setup = false |
| bool | owns_cfg = false |
| SdSpiConfig * | p_cfg = nullptr |
| AudioFs | sd |
| bool | setup_index = true |
| const char * | start_path = nullptr |
| int | timeout_auto_next_value = 500 |
ESP32 AudioSource for AudioPlayer using an SD card as data source. An index file is used to speed up the access to the audio files by index. This class is based on the Arduino SD implementation For UTF8 Support change SdFatConfig.h define USE_UTF8_LONG_NAMES 1.
| <SdFat32,File32>,<SdFs,FsFile>,<SdExFat,ExFile>,<SdFat,File> |
|
inline |
Default constructor.
|
inline |
Costructor with SdSpiConfig.
|
inline |
Constructor for providing an open FS.
|
inlinevirtual |
Reset actual stream and move to root.
Implements AudioSource.
Provides the current index position.
Reimplemented from AudioSource.
Returns default setting go to the next.
Reimplemented from AudioSource.
Returns next audio stream.
Implements AudioSource.
Returns previous audio stream.
Reimplemented in AudioSourceFTP< ClientType >, and AudioSourceURL.
Returns audio stream by path: The index is not changed!
Implements AudioSource.
Returns audio stream at the indicated index (the index is zero based, so the first value is 0!)
Reimplemented from AudioSource.
Reimplemented in AudioSourceCallback.
Defines the regex filter criteria for selecting files. E.g. ".*Bob Dylan.*"
same as selectStream - I just prefer this name
|
inlinevirtualinherited |
Reimplemented in AudioSourceURL.
Allows to "correct" the start path if not defined in the constructor.
Sets the timeout of Stream in milliseconds.
Reimplemented in AudioSourceURL, and AudioSourceSDFAT< AudioFs, AudioFile >.
Sets the timeout which is triggering to move to the next stream. - the default value is 500 ms
Provides the number of files (The max index is size()-1)
Provides the timeout which is triggering to move to the next stream.
provides the actual file name
Reimplemented from AudioSource.
|
protected |
|
protected |
|
protectedinherited |