arduino-audio-tools
Loading...
Searching...
No Matches
Public Member Functions | List of all members
audio_tools::StreamCopy Class Reference

We provide the typeless StreamCopy as a subclass of StreamCopyT. More...

#include <AudioCopy.h>

Inheritance diagram for audio_tools::StreamCopy:
audio_tools::StreamCopyT< uint8_t >

Public Member Functions

 StreamCopy (int buffer_size=DEFAULT_BUFFER_SIZE)
 
 StreamCopy (Print &to, AudioStream &from, int buffer_size=DEFAULT_BUFFER_SIZE)
 
 StreamCopy (Print &to, Stream &from, int buffer_size=DEFAULT_BUFFER_SIZE)
 
int available ()
 
size_t copy ()
 Copies all bytes from the input to the output.
 
template<typename T >
size_t copy (BaseConverter< T > &converter)
 copies a buffer length of data and applies the converter
 
- Public Member Functions inherited from audio_tools::StreamCopyT< uint8_t >
 StreamCopyT (int buffer_size=DEFAULT_BUFFER_SIZE)
 
 StreamCopyT (Print &to, AudioStream &from, int buffer_size=DEFAULT_BUFFER_SIZE)
 
 StreamCopyT (Print &to, Stream &from, int buffer_size=DEFAULT_BUFFER_SIZE)
 
 StreamCopyT (StreamCopyT const &)=delete
 
int available ()
 available bytes in the data source
 
void begin ()
 
void begin (Print &to, AudioStream &from)
 
void begin (Print &to, Stream &from)
 
int bufferSize ()
 Provides the buffer size.
 
size_t copy ()
 
size_t copyAll (int retryCount=5, int retryWaitMs=200)
 copies all data - returns true if we copied anything
 
size_t copyN (size_t pages)
 Copies pages * buffersize samples.
 
void end ()
 
StreamgetFrom ()
 
PrintgetTo ()
 
bool isCheckAvailableForWrite ()
 Is Available for Write check activated ?
 
const char * mime ()
 Provides the actual mime type, that was determined from the first available data.
 
StreamCopyToperator= (StreamCopyT const &)=delete
 
void resize (int len)
 resizes the copy buffer
 
void setAvailableCallback (int(*callback)(Stream *stream))
 Defines a callback that provides the available bytes at the source.
 
void setCallbackOnWrite (void(*onWrite)(void *obj, void *buffer, size_t len), void *obj)
 Defines a callback that is notified with the wirtten data.
 
void setCheckAvailableForWrite (bool flag)
 Activates the check that we copy only if available for write returns a value.
 
void setDelayOnNoData (int delayMs)
 Defines the dealy that is used if no data is available.
 
void setMimeCallback (void(*callback)(const char *))
 Define the callback that will notify about mime changes.
 
void setRetry (int retry)
 Defines the max number of retries.
 

Additional Inherited Members

- Protected Member Functions inherited from audio_tools::StreamCopyT< uint8_t >
void notifyMime (void *data, size_t len)
 Update the mime type.
 
size_t write (size_t len, size_t &delayCount)
 
- Protected Attributes inherited from audio_tools::StreamCopyT< uint8_t >
const char * actual_mime
 
int(* availableCallback )(Stream *stream)
 
Vector< uint8_t > buffer
 
int buffer_size
 
bool check_available_for_write
 
int delay_on_no_data
 
AudioStreamfrom
 
bool is_first
 
void(* notifyMimeCallback )(const char *mime)
 
void(* onWrite )(void *obj, void *buffer, size_t len)
 
void * onWriteObj
 
int retryLimit
 
Printto
 

Detailed Description

We provide the typeless StreamCopy as a subclass of StreamCopyT.

Author
Phil Schatzmann

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