A simple class which implements a automatic looping file. The file needs to be of the class File from FS.h. The number of loops can be defined by calling setLoopCount(). You can also optinally limit the total looping file size by calling setSize();.
More...
#include <FileLoop.h>
|
| FileLoop (File file, int count=-1, int rewindPos=0) |
|
int | available () override |
|
virtual int | availableForWrite () override |
|
bool | begin () |
|
void | end () |
|
File & | file () |
| Returns the file.
|
|
virtual void | flush () override |
|
bool | isLoopActive () |
|
| operator bool () |
|
size_t | readBytes (uint8_t *data, size_t len) override |
|
void | setCallback (void(*cb)(FileLoopT &loop)) |
| You can be notified about a rewind.
|
|
void | setFile (File file) |
| defines the file that is used for looping
|
|
void | setLoopCount (int count) |
|
void | setSize (size_t len) |
| optionally defines the requested playing size in bytes
|
|
void | setStartPos (int pos) |
| defines the start position after the rewind. E.g. for wav files this should be 44
|
|
size_t | size () |
| Returns the (requested) file size.
|
|
size_t | write (const uint8_t *data, size_t len) |
|
virtual size_t | write (uint8_t ch) override |
|
|
int | _timeout = 10 |
|
void(* | callback )(FileLoopT &loop) |
|
File | current_file |
|
int | loop_count |
|
int | size_open |
|
int | start_pos |
|
RingBuffer< uint8_t > | tmp_in {0} |
|
RingBuffer< uint8_t > | tmp_out {0} |
|
int | total_size |
|
A simple class which implements a automatic looping file. The file needs to be of the class File from FS.h. The number of loops can be defined by calling setLoopCount(). You can also optinally limit the total looping file size by calling setSize();.
- Author
- Phil Schatzmann
- Copyright
- GPLv3
◆ isLoopActive()
- Returns
- true as long as we are looping
◆ setLoopCount()
void setLoopCount |
( |
int |
count | ) |
|
|
inlineinherited |
count values: 0) do not loop, 1) loop once, n) loop n times, -1) loop endless
The documentation for this class was generated from the following file: