arduino-audio-tools
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
AudioSourceZephyr Class Reference

AudioSource using Zephyr FS API (NO mounting, only uses mounted FS). Mount using the ZephyrSD class. More...

#include <AudioSourceZephyr.h>

Inheritance diagram for AudioSourceZephyr:
AudioSource

Public Member Functions

 AudioSourceZephyr (const char *mountPoint="/SD", const char *ext=".mp3")
 
 ~AudioSourceZephyr ()
 
bool begin () override
 Reset actual stream and move to root.
 
void end ()
 
virtual int index ()
 Returns the actual index of the stream.
 
int index () const
 
bool isAutoNext () override
 Returns default setting go to the next.
 
StreamnextStream (int offset=1) override
 Returns next audio stream.
 
Streamoperator[] (int idx)
 access with array syntax
 
virtual StreampreviousStream (int offset)
 Returns previous audio stream.
 
StreamselectStream (const char *path) override
 Returns audio stream by path: The index is not changed!
 
StreamselectStream (int index) override
 
virtual void setAutoNext (bool flag)
 
void setFileFilter (const char *filter)
 
virtual StreamsetIndex (int index)
 same as selectStream - I just prefer this name
 
virtual bool setMetadataCallback (void(*fn)(MetaDataType info, const char *str, int len), ID3TypeSelection sel=SELECT_ICY)
 
void setPath (const char *p)
 
virtual void setTimeout (int millisec)
 Sets the timeout of Stream in milliseconds.
 
virtual void setTimeoutAutoNext (int millisec)
 
long size (bool force_rescan=false)
 
virtual int timeoutAutoNext ()
 Provides the timeout which is triggering to move to the next stream.
 
virtual const chartoStr ()
 provides the actual stream (e.g. file) name or url
 
const chartoStr () const
 

Protected Member Functions

void closeFile ()
 
const charget (int idx)
 
bool isMounted () const
 
bool isValidAudioFile (const char *name)
 
StreamopenFile (const char *path)
 
void scanCount (const char *path)
 
const charscanForIndex (const char *path, int target, int &running)
 

Protected Attributes

long count = 0
 
char current_path [256+1] = {}
 
const charextension = ".mp3"
 
const charfile_name_pattern = "*"
 
ZephyrFile file_stream
 
size_t idx_pos = 0
 
bool is_auto_next = true
 
const charmount_point = "/SD"
 
const charstart_path = "/"
 
int timeout_auto_next_value = 500
 

Detailed Description

AudioSource using Zephyr FS API (NO mounting, only uses mounted FS). Mount using the ZephyrSD class.

Note
Supported by all Zephyr platforms with FS support: CONFIG_FILE_SYSTEM=y
Author
Phil Schatzmann

Constructor & Destructor Documentation

◆ AudioSourceZephyr()

AudioSourceZephyr ( const char mountPoint = "/SD",
const char ext = ".mp3" 
)
inline

◆ ~AudioSourceZephyr()

~AudioSourceZephyr ( )
inline

Member Function Documentation

◆ begin()

bool begin ( )
inlineoverridevirtual

Reset actual stream and move to root.

Implements AudioSource.

◆ closeFile()

void closeFile ( )
inlineprotected

◆ end()

void end ( )
inline

◆ get()

const char * get ( int  idx)
inlineprotected

◆ index() [1/2]

virtual int index ( )
inlinevirtualinherited

◆ index() [2/2]

int index ( ) const
inline

◆ isAutoNext()

bool isAutoNext ( )
inlineoverridevirtual

Returns default setting go to the next.

Reimplemented from AudioSource.

◆ isMounted()

bool isMounted ( ) const
inlineprotected

◆ isValidAudioFile()

bool isValidAudioFile ( const char name)
inlineprotected

◆ nextStream()

Stream * nextStream ( int  offset = 1)
inlineoverridevirtual

Returns next audio stream.

Implements AudioSource.

◆ openFile()

Stream * openFile ( const char path)
inlineprotected

◆ operator[]()

Stream * operator[] ( int  idx)
inlineinherited

access with array syntax

◆ previousStream()

virtual Stream * previousStream ( int  offset)
inlinevirtualinherited

Returns previous audio stream.

Reimplemented in AudioSourceFTP< ClientType >, and AudioSourceURL.

◆ scanCount()

void scanCount ( const char path)
inlineprotected

◆ scanForIndex()

const char * scanForIndex ( const char path,
int  target,
int running 
)
inlineprotected

◆ selectStream() [1/2]

Stream * selectStream ( const char path)
inlineoverridevirtual

Returns audio stream by path: The index is not changed!

Implements AudioSource.

◆ selectStream() [2/2]

Stream * selectStream ( int  index)
inlineoverridevirtual

Returns audio stream at the indicated index (the index is zero based, so the first value is 0!)

Reimplemented from AudioSource.

◆ setAutoNext()

virtual void setAutoNext ( bool  flag)
inlinevirtualinherited

Reimplemented in AudioSourceCallback.

◆ setFileFilter()

void setFileFilter ( const char filter)
inline

◆ setIndex()

virtual Stream * setIndex ( int  index)
inlinevirtualinherited

same as selectStream - I just prefer this name

◆ setMetadataCallback()

virtual bool setMetadataCallback ( void(*)(MetaDataType info, const char *str, int len)  fn,
ID3TypeSelection  sel = SELECT_ICY 
)
inlinevirtualinherited

Reimplemented in AudioSourceURL.

◆ setPath()

void setPath ( const char p)
inline

◆ setTimeout()

virtual void setTimeout ( int  millisec)
inlinevirtualinherited

Sets the timeout of Stream in milliseconds.

Reimplemented in AudioSourceURL.

◆ setTimeoutAutoNext()

virtual void setTimeoutAutoNext ( int  millisec)
inlinevirtualinherited

Sets the timeout which is triggering to move to the next stream. - the default value is 500 ms

◆ size()

long size ( bool  force_rescan = false)
inline

◆ timeoutAutoNext()

virtual int timeoutAutoNext ( )
inlinevirtualinherited

Provides the timeout which is triggering to move to the next stream.

◆ toStr() [1/2]

virtual const char * toStr ( )
inlinevirtualinherited

◆ toStr() [2/2]

const char * toStr ( ) const
inline

Member Data Documentation

◆ count

long count = 0
protected

◆ current_path

char current_path[256+1] = {}
protected

◆ extension

const char* extension = ".mp3"
protected

◆ file_name_pattern

const char* file_name_pattern = "*"
protected

◆ file_stream

ZephyrFile file_stream
protected

◆ idx_pos

size_t idx_pos = 0
protected

◆ is_auto_next

bool is_auto_next = true
protectedinherited

◆ mount_point

const char* mount_point = "/SD"
protected

◆ start_path

const char* start_path = "/"
protected

◆ timeout_auto_next_value

int timeout_auto_next_value = 500
protectedinherited

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