Skip to content

Commit 86b28ad

Browse files
committed
AudioSourceIdx*: add setCreateIndex(bool)
1 parent 8e551a4 commit 86b28ad

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
@@ -126,6 +126,11 @@ class AudioSourceIdxSD : public AudioSource {
126126
return idx[pos];
127127
}
128128

129+
/// Defines whether the index should be rebuild on begin
130+
void setCreateIndex(bool rebuild) {
131+
setup_index = rebuild;
132+
}
133+
129134
protected:
130135
#if defined(USE_SD_NO_NS)
131136
SDIndex<SDClass, File> idx{SD};

src/AudioTools/Disk/AudioSourceIdxSDFAT.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,11 @@ class AudioSourceIdxSDFAT : public AudioSource {
150150
return idx[pos];
151151
}
152152

153+
/// Defines whether the index should be rebuild on begin
154+
void setCreateIndex(bool rebuild) {
155+
setup_index = rebuild;
156+
}
157+
153158
protected:
154159
SdSpiConfig *p_cfg = nullptr;
155160
AudioFs sd;

src/AudioTools/Disk/AudioSourceIdxSDMMC.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,11 @@ class AudioSourceIdxSDMMC : public AudioSource {
110110
return idx[pos];
111111
}
112112

113+
/// Defines whether the index should be rebuild on begin
114+
void setCreateIndex(bool rebuild) {
115+
setup_index = rebuild;
116+
}
117+
113118
protected:
114119
SDIndex<fs::SDMMCFS,fs::File> idx{SD_MMC};
115120
File file;

0 commit comments

Comments
 (0)