Skip to content

Commit 03c51fb

Browse files
committed
AudioSourceIdx name(int pos)
1 parent 026b85b commit 03c51fb

File tree

3 files changed

+15
-0
lines changed

3 files changed

+15
-0
lines changed

src/AudioTools/Disk/AudioSourceIdxSD.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,11 @@ class AudioSourceIdxSD : public AudioSource {
116116
return idx.indexOf(filename);
117117
}
118118

119+
/// Provides the filen name for the indicated index
120+
const char* name(int pos) {
121+
return idx[pos];
122+
}
123+
119124
protected:
120125
#if defined(USE_SD_NO_NS)
121126
SDIndex<SDClass, File> idx{SD};

src/AudioTools/Disk/AudioSourceIdxSDFAT.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,11 @@ class AudioSourceIdxSDFAT : public AudioSource {
146146
return idx.indexOf(filename);
147147
}
148148

149+
/// Provides the filen name for the indicated index
150+
const char* name(int pos) {
151+
return idx[pos];
152+
}
153+
149154
protected:
150155
SdSpiConfig *p_cfg = nullptr;
151156
AudioFs sd;

src/AudioTools/Disk/AudioSourceIdxSDMMC.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,11 @@ class AudioSourceIdxSDMMC : public AudioSource {
104104
return idx.indexOf(filename);
105105
}
106106

107+
/// Provides the filen name for the indicated index
108+
const char* name(int pos) {
109+
return idx[pos];
110+
}
111+
107112
protected:
108113
SDIndex<fs::SDMMCFS,fs::File> idx{SD_MMC};
109114
File file;

0 commit comments

Comments
 (0)