Sayonara Player
Public Types | Signals | Public Member Functions | List of all members
StreamWriter Class Reference

The StreamWriter class. This class is the interface between StreamDataSender and StreamServer. It watches the client socket and spreads data to its client. More...

#include <StreamWriter.h>

Inheritance diagram for StreamWriter:
RawSoundReceiverInterface

Public Types

enum  Type : uint8_t {
  Undefined,
  Standard,
  Invalid,
  Streaming
}
 

Signals

void sig_new_connection (const QString &ip)
 
void sig_disconnected (StreamWriter *sw)
 

Public Member Functions

 StreamWriter (QTcpSocket *socket, const QString &ip, const MetaData &md)
 StreamWriter. More...
 
QString get_ip () const
 get client ip address More...
 
void change_track (const MetaData &md)
 send new icy data to clients, and send new metadata to remote controls. More...
 
bool send_playlist ()
 Send a m3u playlist (see StreamDataSender) More...
 
bool send_favicon ()
 Send the http favicon (see StreamDataSender) More...
 
bool send_metadata ()
 Send track information (see StreamDataSender) More...
 
bool send_bg ()
 Send website background (see StreamDataSender) More...
 
bool send_html5 ()
 send a html5 website (see StreamDataSender) More...
 
bool send_header (bool reject)
 send a appropriate header based on the type of request (see StreamDataSender) More...
 
StreamHttpParser::HttpAnswer parse_message ()
 
void disconnect ()
 disconnect a client socket
 
void dismiss ()
 stop sending sound over the client socket
 
void new_audio_data (const Byte *data, uint64_t size) override
 new audio data has arrived and has to be forwarded to the socket More...
 

Detailed Description

The StreamWriter class. This class is the interface between StreamDataSender and StreamServer. It watches the client socket and spreads data to its client.

Constructor & Destructor Documentation

◆ StreamWriter()

StreamWriter::StreamWriter ( QTcpSocket *  socket,
const QString &  ip,
const MetaData md 
)

StreamWriter.

Parameters
socket
ip
md

Member Function Documentation

◆ change_track()

void StreamWriter::change_track ( const MetaData md)

send new icy data to clients, and send new metadata to remote controls.

Parameters
mdTrack structure

◆ get_ip()

QString StreamWriter::get_ip ( ) const

get client ip address

Returns

◆ new_audio_data()

void StreamWriter::new_audio_data ( const Byte *  data,
uint64_t  size 
)
overridevirtual

new audio data has arrived and has to be forwarded to the socket

Parameters
data
size

Implements RawSoundReceiverInterface.

◆ send_bg()

bool StreamWriter::send_bg ( )

Send website background (see StreamDataSender)

Returns

◆ send_favicon()

bool StreamWriter::send_favicon ( )

Send the http favicon (see StreamDataSender)

Returns

◆ send_header()

bool StreamWriter::send_header ( bool  reject)

send a appropriate header based on the type of request (see StreamDataSender)

Parameters
rejectif true, a reject header is sent.
Returns

◆ send_html5()

bool StreamWriter::send_html5 ( )

send a html5 website (see StreamDataSender)

Returns

◆ send_metadata()

bool StreamWriter::send_metadata ( )

Send track information (see StreamDataSender)

Returns

◆ send_playlist()

bool StreamWriter::send_playlist ( )

Send a m3u playlist (see StreamDataSender)

Returns