Deluge Firmware 1.3.0
Build date: 2025.07.14
Loading...
Searching...
No Matches
AudioFileManager Class Reference
Collaboration diagram for AudioFileManager:

Classes

struct  StringLessThan

Public Member Functions

void init ()
std::expected< AudioFile *, Error > getAudioFileFromFilename (String &fileName, bool mayReadCard, FilePointer *filePointer, AudioFileType type, bool makeWaveTableWorkAtAllCosts=false)
bool loadCluster (Cluster &cluster, int32_t minNumReasonsAfter=0)
void loadAnyEnqueuedClusters (int32_t maxNum=128, bool mayProcessUserActionsBetween=false)
void removeReasonFromCluster (Cluster &cluster, char const *errorCode, bool deletingSong=false)
void slowRoutine ()
std::expected< void, Error > setupAlternateAudioFilePath (String &newPath, int32_t dirPathLength, String &oldPath)
std::expected< void, Error > setupAlternateAudioFileDir (String &newPath, char const *rootDir, String &songFilenameWithoutExtension)
bool loadingQueueHasAnyLowestPriorityElements ()
Error getUnusedAudioRecordingFilePath (String &filePath, String *tempFilePathForRecording, AudioRecordingFolder folder, uint32_t *getNumber, const char *channelName, String *songName)
void deleteAnyTempRecordedSamplesFromMemory ()
void releaseFile (Sample &sample)
void releaseFile (WaveTable &wavetable)
bool releaseSampleAtFilePath (String &filePath)
void releaseAllUnused ()
 release unused sapmles and wavetables
void thingBeginningLoading (ThingType newThingType)
void thingFinishedLoading ()
void setCardRead ()
void setCardEjected ()
void firstCardRead ()

Public Attributes

deluge::fast_map< String *, Sample *, StringLessThansampleFiles
deluge::fast_map< String *, WaveTable *, StringLessThanwavetableFiles
ClusterPriorityQueue loadingQueue
ClusterclusterBeingLoaded
int32_t minNumReasonsForClusterBeingLoaded
String alternateAudioFileLoadPath
AlternateLoadDirStatus alternateLoadDirStatus = AlternateLoadDirStatus::NONE_SET
ThingType thingTypeBeingLoaded = ThingType::NONE
DIR alternateLoadDir
std::array< int32_t, kNumAudioRecordingFolders > highestUsedAudioRecordingNumber
std::bitset< kNumAudioRecordingFolders > highestUsedAudioRecordingNumberNeedsReChecking

Private Member Functions

void cardReinserted ()
int32_t readBytes (char *buffer, int32_t num, int32_t *byteIndexWithinCluster, Cluster **currentCluster, uint32_t *currentClusterIndex, uint32_t fileSize, Sample *sample)
int32_t loadAiff (Sample *newSample, uint32_t fileSize, Cluster **currentCluster, uint32_t *currentClusterIndex)
int32_t loadWav (Sample *newSample, uint32_t fileSize, Cluster **currentCluster, uint32_t *currentClusterIndex)

Private Attributes

bool cardReadOnce {false}
bool cardEjected
bool cardDisabled = false
uint32_t clusterSizeAtBoot {0}

Member Function Documentation

◆ getUnusedAudioRecordingFilePath()

Error AudioFileManager::getUnusedAudioRecordingFilePath ( String & filePath,
String * tempFilePathForRecording,
AudioRecordingFolder folder,
uint32_t * getNumber,
const char * channelName,
String * songName )

If songname isn't supplied the file is placed in the main recording folder and named as samples/folder/REC###. If song and channel are supplied then it's placed in samples/folder/song/channel_###


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