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:
Engine::RawSoundReceiverInterface

Public Types

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

Signals

void sigNewConnection (const QString &ip)
 
void sigDisconnected (StreamWriter *sw)
 

Public Member Functions

 StreamWriter (QTcpSocket *socket, const QString &ip, const MetaData &md)
 StreamWriter. More...
 
QString ip () const
 get client ip address More...
 
void changeTrack (const MetaData &md)
 send new icy data to clients, and send new metadata to remote controls. More...
 
bool sendPlaylist ()
 Send a m3u playlist (see StreamDataSender) More...
 
bool sendFavicon ()
 Send the http favicon (see StreamDataSender) More...
 
bool sendMetadata ()
 Send track information (see StreamDataSender) More...
 
bool sendBackground ()
 Send website background (see StreamDataSender) More...
 
bool sendHtml5 ()
 send a html5 website (see StreamDataSender) More...
 
bool sendHeader (bool reject)
 send a appropriate header based on the type of request (see StreamDataSender) More...
 
StreamHttpParser::HttpAnswer parseMessage ()
 
void disconnect ()
 disconnect a client socket
 
void dismiss ()
 stop sending sound over the client socket
 
void writeAudioData (const QByteArray &data) 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

◆ changeTrack()

void StreamWriter::changeTrack ( const MetaData md)

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

Parameters
mdTrack structure

◆ ip()

QString StreamWriter::ip ( ) const

get client ip address

Returns

◆ sendBackground()

bool StreamWriter::sendBackground ( )

Send website background (see StreamDataSender)

Returns

◆ sendFavicon()

bool StreamWriter::sendFavicon ( )

Send the http favicon (see StreamDataSender)

Returns

◆ sendHeader()

bool StreamWriter::sendHeader ( bool  reject)

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

Parameters
rejectif true, a reject header is sent.
Returns

◆ sendHtml5()

bool StreamWriter::sendHtml5 ( )

send a html5 website (see StreamDataSender)

Returns

◆ sendMetadata()

bool StreamWriter::sendMetadata ( )

Send track information (see StreamDataSender)

Returns

◆ sendPlaylist()

bool StreamWriter::sendPlaylist ( )

Send a m3u playlist (see StreamDataSender)

Returns

◆ writeAudioData()

void StreamWriter::writeAudioData ( const QByteArray &  data)
overridevirtual

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

Parameters
data
size

Implements Engine::RawSoundReceiverInterface.