arduino-audio-tools
Loading...
Searching...
No Matches
SDDirect< SDT, FileT > Class Template Reference

We access the files directy with an index. The index is determined by a recurseve tree walk thru the directory. Unfortunately the SDTFAT library has it's own API which is incompatible with the SD API. More...

#include <SDDirect.h>

Public Member Functions

 SDDirect (SDT &sd)
void begin (const char *startDir, const char *extension, const char *file_name_pattern)
const char * operator[] (int idx)
 Access file name by index.
long size ()
 Provides the number of files.

Protected Member Functions

const char * fileName (FileT &file)
 Returns the filename w/o path.
const char * fileNamePath (FileT &file)
 Returns the filename including the path.
bool isDirectory (FileT &f)
bool isHidden (FileT &f)
bool isValidAudioFile (FileT &file)
 checks if the file is a valid audio file
void listDir (const char *dirname)
 Writes the index file.
FileT open (const char *name)
FileT openNext (FileT &dir)
void popPath ()
void pushPath (const char *name)
void rewind (FileT &f)

Protected Attributes

int32_t actual_idx
const char * ext = nullptr
const char * file_name_pattern = nullptr
List< String > file_path_stack
String file_path_str
bool found = false
long max_idx = -1
SDT * p_sd = nullptr
size_t requested_idx
String result
const char * start_dir

Detailed Description

template<class SDT, class FileT>
class audio_tools::SDDirect< SDT, FileT >

We access the files directy with an index. The index is determined by a recurseve tree walk thru the directory. Unfortunately the SDTFAT library has it's own API which is incompatible with the SD API.

Constructor & Destructor Documentation

◆ SDDirect()

template<class SDT, class FileT>
SDDirect ( SDT & sd)
inline

Member Function Documentation

◆ begin()

template<class SDT, class FileT>
void begin ( const char * startDir,
const char * extension,
const char * file_name_pattern )
inline

◆ fileName()

template<class SDT, class FileT>
const char * fileName ( FileT & file)
inlineprotected

Returns the filename w/o path.

◆ fileNamePath()

template<class SDT, class FileT>
const char * fileNamePath ( FileT & file)
inlineprotected

Returns the filename including the path.

◆ isDirectory()

template<class SDT, class FileT>
bool isDirectory ( FileT & f)
inlineprotected

◆ isHidden()

template<class SDT, class FileT>
bool isHidden ( FileT & f)
inlineprotected

◆ isValidAudioFile()

template<class SDT, class FileT>
bool isValidAudioFile ( FileT & file)
inlineprotected

checks if the file is a valid audio file

◆ listDir()

template<class SDT, class FileT>
void listDir ( const char * dirname)
inlineprotected

Writes the index file.

◆ open()

template<class SDT, class FileT>
FileT open ( const char * name)
inlineprotected

◆ openNext()

template<class SDT, class FileT>
FileT openNext ( FileT & dir)
inlineprotected

◆ operator[]()

template<class SDT, class FileT>
const char * operator[] ( int idx)
inline

Access file name by index.

◆ popPath()

template<class SDT, class FileT>
void popPath ( )
inlineprotected

◆ pushPath()

template<class SDT, class FileT>
void pushPath ( const char * name)
inlineprotected

◆ rewind()

template<class SDT, class FileT>
void rewind ( FileT & f)
inlineprotected

◆ size()

template<class SDT, class FileT>
long size ( )
inline

Provides the number of files.

Member Data Documentation

◆ actual_idx

template<class SDT, class FileT>
int32_t actual_idx
protected

◆ ext

template<class SDT, class FileT>
const char* ext = nullptr
protected

◆ file_name_pattern

template<class SDT, class FileT>
const char* file_name_pattern = nullptr
protected

◆ file_path_stack

template<class SDT, class FileT>
List<String> file_path_stack
protected

◆ file_path_str

template<class SDT, class FileT>
String file_path_str
protected

◆ found

template<class SDT, class FileT>
bool found = false
protected

◆ max_idx

template<class SDT, class FileT>
long max_idx = -1
protected

◆ p_sd

template<class SDT, class FileT>
SDT* p_sd = nullptr
protected

◆ requested_idx

template<class SDT, class FileT>
size_t requested_idx
protected

◆ result

template<class SDT, class FileT>
String result
protected

◆ start_dir

template<class SDT, class FileT>
const char* start_dir
protected

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