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

Icecast/Shoutcast Audio Stream which splits the data into metadata and audio data. The Audio data is provided via the regular stream functions. The metadata is handled with the help of the MetaDataICY state machine and provided via a callback method. More...

#include <ICYStream.h>

Inheritance diagram for audio_tools::ICYStreamDefault:
audio_tools::AbstractURLStream audio_tools::AudioStream audio_tools::Stream audio_tools::AudioBaseInfoDependent audio_tools::AudioBaseInfoSource audio_tools::Print audio_tools::ICYStream

Public Member Functions

 ICYStreamDefault (Client &clientPar, int readBufferSize=DEFAULT_BUFFER_SIZE)
 
 ICYStreamDefault (const char *network, const char *password, int readBufferSize=DEFAULT_BUFFER_SIZE)
 Default constructor.
 
 ICYStreamDefault (int readBufferSize=DEFAULT_BUFFER_SIZE)
 
virtual int available () override
 provides the available method from the URLStreamDefault More...
 
virtual bool begin (const char *urlStr, const char *acceptMime=nullptr, MethodID action=GET, const char *reqMime="", const char *reqData="") override
 
virtual void end () override
 Ends the processing. More...
 
virtual void flush () override
 not implemented More...
 
virtual HttpRequesthttpRequest () override
 provides access to the HttpRequest More...
 
 operator bool ()
 
virtual int peek () override
 Not Supported! More...
 
virtual int read () override
 
virtual size_t readBytes (uint8_t *buffer, size_t len) override
 reads the audio bytes More...
 
virtual bool setMetadataCallback (void(*fn)(MetaDataType info, const char *str, int len)) override
 Defines the meta data callback function. More...
 
virtual size_t write (const uint8_t *buffer, size_t size) override
 not implemented More...
 
virtual size_t write (uint8_t) override
 not implemented More...
 
- Public Member Functions inherited from audio_tools::AbstractURLStream
int availableForWrite ()
 Writes are not supported. More...
 
virtual bool begin (const char *urlStr, const char *acceptMime=nullptr, MethodID action=GET, const char *reqMime="", const char *reqData="")=0
 
virtual void end ()=0
 
virtual HttpRequesthttpRequest ()=0
 provides access to the HttpRequest More...
 
virtual bool setMetadataCallback (void(*fn)(MetaDataType info, const char *str, int len))
 
- Public Member Functions inherited from audio_tools::AudioStream
 AudioStream (AudioStream const &)=delete
 
virtual AudioBaseInfo audioInfo () override
 
virtual int availableForWrite () override
 
virtual bool begin ()
 
virtual void end ()
 
virtual void flush () override
 
 operator bool ()
 
AudioStreamoperator= (AudioStream const &)=delete
 
virtual size_t readBytes (char *buffer, size_t length)
 
virtual size_t readBytes (uint8_t *buffer, size_t length) STREAM_WRITE_OVERRIDE=0
 
virtual void setAudioInfo (AudioBaseInfo info) override
 
virtual void setNotifyAudioChange (AudioBaseInfoDependent &bi) override
 
virtual StreamtoStreamPointer ()
 
virtual size_t write (const uint8_t *buffer, size_t size) override=0
 
- Public Member Functions inherited from audio_tools::Stream
virtual int available ()
 
virtual int peek ()
 
virtual int read ()
 
virtual size_t readBytes (uint8_t *buffer, size_t len)
 
virtual void setTimeout (size_t t)
 
- Public Member Functions inherited from audio_tools::Print
virtual int availableForWrite ()
 
virtual void flush ()
 
virtual int print (char c, PrintCharFmt spec)
 
virtual int print (const char *msg)
 
virtual int print (int number)
 
virtual int println (const char *msg="")
 
virtual size_t write (const char *buffer, size_t size)
 
virtual size_t write (const char *str)
 
virtual size_t write (const uint8_t *buffer, size_t size)
 
virtual size_t write (uint8_t ch)
 
- 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 Member Functions

void checkUrl ()
 
- Protected Member Functions inherited from audio_tools::AudioStream
virtual int not_supported (int out)
 

Protected Attributes

void(* callback )(MetaDataType info, const char *str, int len) =nullptr
 
MetaDataICY icy
 
URLStreamDefaulturl = nullptr
 
- Protected Attributes inherited from audio_tools::AudioStream
AudioBaseInfo info
 
AudioBaseInfoDependentp_notify =nullptr
 

Detailed Description

Icecast/Shoutcast Audio Stream which splits the data into metadata and audio data. The Audio data is provided via the regular stream functions. The metadata is handled with the help of the MetaDataICY state machine and provided via a callback method.

This is basically just a URLStream with the metadata turned on.

Author
Phil Schatzmann

Member Function Documentation

◆ available()

virtual int audio_tools::ICYStreamDefault::available ( )
inlineoverridevirtual

provides the available method from the URLStreamDefault

Reimplemented from audio_tools::Stream.

Reimplemented in audio_tools::ICYStream.

◆ begin()

virtual bool audio_tools::ICYStreamDefault::begin ( const char *  urlStr,
const char *  acceptMime = nullptr,
MethodID  action = GET,
const char *  reqMime = "",
const char *  reqData = "" 
)
inlineoverridevirtual

◆ end()

virtual void audio_tools::ICYStreamDefault::end ( )
inlineoverridevirtual

Ends the processing.

Implements audio_tools::AbstractURLStream.

◆ flush()

virtual void audio_tools::ICYStreamDefault::flush ( )
inlineoverridevirtual

not implemented

Reimplemented from audio_tools::AudioStream.

Reimplemented in audio_tools::ICYStream.

◆ httpRequest()

virtual HttpRequest & audio_tools::ICYStreamDefault::httpRequest ( )
inlineoverridevirtual

provides access to the HttpRequest

Implements audio_tools::AbstractURLStream.

Reimplemented in audio_tools::ICYStream.

◆ peek()

virtual int audio_tools::ICYStreamDefault::peek ( )
inlineoverridevirtual

Not Supported!

Reimplemented from audio_tools::Stream.

Reimplemented in audio_tools::ICYStream.

◆ read()

virtual int audio_tools::ICYStreamDefault::read ( )
inlineoverridevirtual

Reimplemented from audio_tools::Stream.

◆ readBytes()

virtual size_t audio_tools::ICYStreamDefault::readBytes ( uint8_t *  buffer,
size_t  len 
)
inlineoverridevirtual

reads the audio bytes

Implements audio_tools::AudioStream.

Reimplemented in audio_tools::ICYStream.

◆ setMetadataCallback()

virtual bool audio_tools::ICYStreamDefault::setMetadataCallback ( void(*)(MetaDataType info, const char *str, int len)  fn)
inlineoverridevirtual

Defines the meta data callback function.

Reimplemented from audio_tools::AbstractURLStream.

◆ write() [1/2]

virtual size_t audio_tools::ICYStreamDefault::write ( const uint8_t *  buffer,
size_t  size 
)
inlineoverridevirtual

not implemented

Implements audio_tools::AudioStream.

Reimplemented in audio_tools::ICYStream.

◆ write() [2/2]

virtual size_t audio_tools::ICYStreamDefault::write ( uint8_t  )
inlineoverridevirtual

not implemented

Reimplemented from audio_tools::Print.

Reimplemented in audio_tools::ICYStream.


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