MythTV  0.26-pre
Public Types | Signals | Public Member Functions | Static Public Member Functions | Private Slots | Private Member Functions | Private Attributes
ShoutCastIODevice Class Reference

#include <shoutcast.h>

Inheritance diagram for ShoutCastIODevice:
MusicIODevice

List of all members.

Public Types

enum  State {
  NOT_CONNECTED, RESOLVING, CONNECTING, CANT_RESOLVE,
  CANT_CONNECT, CONNECTED, WRITING_HEADER, READING_HEADER,
  PLAYING, STREAMING, STREAMING_META, STOPPED
}

Signals

void meta (const QString &metadata)
void changedState (ShoutCastIODevice::State newstate)

Public Member Functions

 ShoutCastIODevice (void)
 ~ShoutCastIODevice (void)
void connectToUrl (const QUrl &url)
void close (void)
bool flush (void)
qint64 size (void) const
qint64 pos (void) const
qint64 bytesAvailable (void) const
bool isSequential (void) const
qint64 readData (char *data, qint64 sz)
qint64 writeData (const char *data, qint64 sz)
bool getResponse (ShoutCastResponse &response)

Static Public Member Functions

static const char * stateString (const State &s)

Private Slots

void socketHostFound (void)
void socketConnected (void)
void socketConnectionClosed (void)
void socketReadyRead (void)
void socketBytesWritten (qint64)
void socketError (QAbstractSocket::SocketError error)

Private Member Functions

void switchToState (const State &s)
bool parseHeader (void)
bool parseMeta (void)

Private Attributes

ShoutCastResponsem_response
int m_redirects
QTcpSocket * m_socket
QByteArray m_scratchpad
qint64 m_scratchpad_pos
QUrl m_url
qint64 m_bytesTillNextMeta
State m_state
QString m_last_metadata
qint64 m_bytesDownloaded
bool m_response_gotten
bool m_started

Detailed Description

Definition at line 33 of file shoutcast.h.


Member Enumeration Documentation

Enumerator:
NOT_CONNECTED 
RESOLVING 
CONNECTING 
CANT_RESOLVE 
CANT_CONNECT 
CONNECTED 
WRITING_HEADER 
READING_HEADER 
PLAYING 
STREAMING 
STREAMING_META 
STOPPED 

Definition at line 38 of file shoutcast.h.


Constructor & Destructor Documentation

Definition at line 342 of file shoutcast.cpp.

Definition at line 362 of file shoutcast.cpp.


Member Function Documentation

const char * ShoutCastIODevice::stateString ( const State s) [static]

Definition at line 37 of file shoutcast.cpp.

Referenced by readData(), and DecoderIOFactoryShoutCast::shoutcastChangedState().

void ShoutCastIODevice::connectToUrl ( const QUrl &  url)

Definition at line 371 of file shoutcast.cpp.

Referenced by socketReadyRead(), and DecoderIOFactoryShoutCast::start().

Reimplemented from MusicIODevice.

Definition at line 380 of file shoutcast.cpp.

Referenced by DecoderIOFactoryShoutCast::closeIODevice().

Reimplemented from MusicIODevice.

Definition at line 385 of file shoutcast.cpp.

qint64 ShoutCastIODevice::size ( void  ) const

Reimplemented from MusicIODevice.

Definition at line 390 of file shoutcast.cpp.

qint64 ShoutCastIODevice::pos ( void  ) const [inline]

Reimplemented from MusicIODevice.

Definition at line 63 of file shoutcast.h.

Reimplemented from MusicIODevice.

Definition at line 452 of file shoutcast.cpp.

Referenced by DecoderIOFactoryShoutCast::periodicallyCheckBuffered().

Reimplemented from MusicIODevice.

Definition at line 65 of file shoutcast.h.

qint64 ShoutCastIODevice::readData ( char *  data,
qint64  sz 
)

Reimplemented from MusicIODevice.

Definition at line 395 of file shoutcast.cpp.

qint64 ShoutCastIODevice::writeData ( const char *  data,
qint64  sz 
)

Reimplemented from MusicIODevice.

Definition at line 447 of file shoutcast.cpp.

void ShoutCastIODevice::meta ( const QString &  metadata) [signal]

Referenced by parseMeta().

Referenced by switchToState().

Definition at line 457 of file shoutcast.cpp.

Referenced by ShoutCastIODevice().

Definition at line 463 of file shoutcast.cpp.

Referenced by ShoutCastIODevice().

Definition at line 491 of file shoutcast.cpp.

Referenced by ShoutCastIODevice().

Definition at line 497 of file shoutcast.cpp.

Referenced by readData(), and ShoutCastIODevice().

void ShoutCastIODevice::socketBytesWritten ( qint64  ) [private, slot]

Definition at line 553 of file shoutcast.cpp.

Referenced by socketConnected().

void ShoutCastIODevice::socketError ( QAbstractSocket::SocketError  error) [private, slot]

Definition at line 569 of file shoutcast.cpp.

Referenced by ShoutCastIODevice().

void ShoutCastIODevice::switchToState ( const State s) [private]

Definition at line 626 of file shoutcast.cpp.

Referenced by socketReadyRead().

Definition at line 667 of file shoutcast.cpp.

Referenced by readData().


Member Data Documentation

Definition at line 91 of file shoutcast.h.

Referenced by socketReadyRead().

QTcpSocket* ShoutCastIODevice::m_socket [private]
QByteArray ShoutCastIODevice::m_scratchpad [private]

Definition at line 95 of file shoutcast.h.

Referenced by socketBytesWritten(), and socketConnected().

Definition at line 96 of file shoutcast.h.

Referenced by socketBytesWritten(), and socketConnected().

QUrl ShoutCastIODevice::m_url [private]

Definition at line 99 of file shoutcast.h.

Referenced by connectToUrl(), socketConnected(), and socketReadyRead().

Definition at line 100 of file shoutcast.h.

Referenced by readData(), socketConnected(), socketReadyRead(), and switchToState().

Definition at line 101 of file shoutcast.h.

Referenced by readData(), socketReadyRead(), and switchToState().

Definition at line 102 of file shoutcast.h.

Referenced by parseMeta().

Definition at line 103 of file shoutcast.h.

Referenced by socketConnected(), and socketReadyRead().

Definition at line 104 of file shoutcast.h.

Referenced by getResponse(), socketConnected(), and socketReadyRead().

Definition at line 105 of file shoutcast.h.

Referenced by socketConnected(), and socketReadyRead().


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends