6#define MAX_FILE_LEN 256
19template <
class SDT,
class FileT>
27 this->
ext = extension;
38 LOGW(
"Creating index file");
40 LOGI(
"Indexing completed");
50 this->
ext = extension;
61 LOGE(
"idx %d is negative", idx);
83 LOGE(
"Index file is empty");
89 while (
idxfile.available() > 0 && !found) {
93 char *c_str = (
char *)
result.c_str();
100 LOGD(
"%d -> %s", count, c_str);
111 return found ?
result.c_str() :
nullptr;
117 LOGE(
"filename is null");
122 if (
idxfile.available() == 0) {
123 LOGE(
"Index file is empty");
131 while (
idxfile.available() > 0) {
135 char *c_str = (
char *)
result.c_str();
142 LOGD(
"Comparing %d: '%s' with '%s'", count, c_str,
filename);
172 while (
idxfile.available() > 0) {
175 char *c_str = (
char *)
result.c_str();
193 const char *
ext =
nullptr;
227 LOGD(
"name: %s", name.c_str());
233 LOGD(
"Adding file to index: %s",
fn);
260 LOGD(
"No next file");
264 return dir.openNextFile();
269 LOGD(
"pushPath: %s", name);
270 LOGD(
"pushPath: %s", name);
279 LOGD(
"popPath: %s", str.c_str());
285 const char *file_name =
fileName(file);
286 if (file.isDirectory()) {
287 LOGD(
"-> isValidAudioFile: '%s': %d", file_name,
false);
293 LOGD(
"-> isValidAudioFile: '%s': %d", file_name,
result);
339 return file.name() + pos;
345#if defined(USE_SDFAT) || ESP_IDF_VERSION_MAJOR >= 4
379 LOGE(
"FileT open error: %s", name);
383 return p_sd->open(name,
"r");
#define LOGW(...)
Definition AudioLoggerIDF.h:29
#define TRACED()
Definition AudioLoggerIDF.h:31
#define LOGI(...)
Definition AudioLoggerIDF.h:28
#define LOGD(...)
Definition AudioLoggerIDF.h:27
#define LOGE(...)
Definition AudioLoggerIDF.h:30
#define MAX_FILE_LEN
Definition LegacyAudioSourceSDFAT.h:18
#define FILE_WRITE
Definition VFSFile.h:18