arduino-audio-tools
Loading...
Searching...
No Matches
Public Member Functions | Protected Attributes | List of all members
audio_tools::CsvStream< T > Class Template Reference

Stream Wrapper which can be used to print the values as readable ASCII to the screen to be analyzed in the Serial Plotter The frames are separated by a new line. The channels in one frame are separated by a ,. More...

#include <AudioPrint.h>

Inheritance diagram for audio_tools::CsvStream< T >:
audio_tools::AudioPrint Print audio_tools::AudioBaseInfoDependent audio_tools::AudioBaseInfoSource

Public Member Functions

 CsvStream (int buffer_size=DEFAULT_BUFFER_SIZE, bool active=true)
 
 CsvStream (Print &out, int channels=2, int buffer_size=DEFAULT_BUFFER_SIZE, bool active=true)
 Constructor.
 
int availableForWrite ()
 
void begin ()
 Starts the processing with 2 channels.
 
void begin (AudioBaseInfo info)
 Starts the processing with the number of channels defined in AudioBaseInfo.
 
void begin (int channels, Print &out=Serial)
 Starts the processing with the defined number of channels.
 
AudioBaseInfo defaultConfig ()
 Provides the default configuration.
 
void end ()
 Sets the CsvStream as inactive.
 
virtual void setAudioInfo (AudioBaseInfo info)
 defines the number of channels More...
 
virtual size_t write (const uint8_t *data, size_t len)
 Writes the data - formatted as CSV - to the output stream. More...
 
- Public Member Functions inherited from audio_tools::AudioPrint
virtual AudioBaseInfo audioInfo () override
 
virtual int availableForWrite ()
 
virtual bool doRelease ()
 If true we need to release the related memory. More...
 
void flush ()
 
virtual void setAudioInfo (AudioBaseInfo info) override
 
virtual void setNotifyAudioChange (AudioBaseInfoDependent &bi) override
 
virtual size_t write (const uint8_t *buffer, size_t size) override=0
 
virtual size_t write (uint8_t ch) override
 
- Public Member Functions inherited from Print
virtual int availableForWrite ()
 
void clearWriteError ()
 
virtual void flush ()
 
int getWriteError ()
 
size_t print (char)
 
size_t print (const __FlashStringHelper *)
 
size_t print (const char[])
 
size_t print (const Printable &)
 
size_t print (const String &)
 
size_t print (double, int=2)
 
size_t print (int, int=DEC)
 
size_t print (long long, int=DEC)
 
size_t print (long, int=DEC)
 
size_t print (unsigned char, int=DEC)
 
size_t print (unsigned int, int=DEC)
 
size_t print (unsigned long long, int=DEC)
 
size_t print (unsigned long, int=DEC)
 
size_t println (char)
 
size_t println (const __FlashStringHelper *)
 
size_t println (const char[])
 
size_t println (const Printable &)
 
size_t println (const String &s)
 
size_t println (double, int=2)
 
size_t println (int, int=DEC)
 
size_t println (long long, int=DEC)
 
size_t println (long, int=DEC)
 
size_t println (unsigned char, int=DEC)
 
size_t println (unsigned int, int=DEC)
 
size_t println (unsigned long long, int=DEC)
 
size_t println (unsigned long, int=DEC)
 
size_t println (void)
 
size_t write (const char *buffer, size_t size)
 
size_t write (const char *str)
 
virtual size_t write (const uint8_t *buffer, size_t size)
 
virtual size_t write (uint8_t)=0
 
- Public Member Functions inherited from audio_tools::AudioBaseInfoDependent
virtual AudioBaseInfo audioInfo ()=0
 
virtual void setAudioInfo (AudioBaseInfo info)=0
 
virtual bool validate (AudioBaseInfo &info)
 
virtual void setNotifyAudioChange (AudioBaseInfoDependent &bi)=0
 

Protected Attributes

bool active = false
 
int channels = 2
 
T * data_ptr
 
Printout_ptr = &Serial
 
- Protected Attributes inherited from audio_tools::AudioPrint
AudioBaseInfo cfg
 
AudioBaseInfoDependentp_notify =nullptr
 
uint8_t tmp [MAX_SINGLE_CHARS]
 
int tmpPos =0
 

Additional Inherited Members

- Protected Member Functions inherited from Print
void setWriteError (int err=1)
 

Detailed Description

template<typename T>
class audio_tools::CsvStream< T >

Stream Wrapper which can be used to print the values as readable ASCII to the screen to be analyzed in the Serial Plotter The frames are separated by a new line. The channels in one frame are separated by a ,.

Template Parameters
T
Author
Phil Schatzmann

Member Function Documentation

◆ availableForWrite()

template<typename T >
int audio_tools::CsvStream< T >::availableForWrite ( )
inlinevirtual

Reimplemented from audio_tools::AudioPrint.

◆ setAudioInfo()

template<typename T >
virtual void audio_tools::CsvStream< T >::setAudioInfo ( AudioBaseInfo  info)
inlinevirtual

defines the number of channels

Reimplemented from audio_tools::AudioPrint.

◆ write()

template<typename T >
virtual size_t audio_tools::CsvStream< T >::write ( const uint8_t *  data,
size_t  len 
)
inlinevirtual

Writes the data - formatted as CSV - to the output stream.

Implements audio_tools::AudioPrint.


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