icecast_internalThread Class Reference

A thread that downloads and processes an Icecast stream list. More...

#include <icecast_internalthread.h>

List of all members.

Public Types

typedef QList
< streamDirectoryEntry_stream * > 
streamEntryList

Signals

void streamlist_ready (icecast_internalThread::streamEntryList list)

Public Member Functions

 icecast_internalThread ()
virtual ~icecast_internalThread ()

Protected Member Functions

virtual void run ()

Private Member Functions

void readStreamEntry (QXmlStreamReader &reader)

Private Attributes

streamEntryList streamList


Detailed Description

A thread that downloads and processes an Icecast stream list.

This class provides downloading of the "yellow page" file from icecast.org which provides a list of all available Icecast streams.

For each stream it creates a streamDirectoryEntry_stream objects on the heap. After finishing, it emits the signal streamlist_ready with a list of pointers to these objects. It is up to you to make sure that these objects on the head will get deleted!

Definition at line 38 of file icecast_internalthread.h.


Member Typedef Documentation

Defines a type for a list of pointers to streamDirectoryEntry_stream objects. This type is declared as meta type through Q_DECLARE_METATYPE.

Note:
Additionally, you have to register this data type to Qt's meta object system by calling qRegisterMetaType<icecast_internalThread::streamEntryList>(); before you can use it in queued signal-slot-connections.

Definition at line 49 of file icecast_internalthread.h.


Constructor & Destructor Documentation

icecast_internalThread::icecast_internalThread (  ) 

The constructor.

Definition at line 26 of file icecast_internalthread.cpp.

icecast_internalThread::~icecast_internalThread (  )  [virtual]

The destructor.

Note:
Different from QThread, it is save to execute the desctructor on any time, also when the thread is running. However, this may take some seconds...

Definition at line 30 of file icecast_internalthread.cpp.


Member Function Documentation

void icecast_internalThread::readStreamEntry ( QXmlStreamReader &  reader  )  [private]

Helper function that expects that the actual tocken is <entry>. It reads the entry, constructs the corresponding object on the heap and adds a pointer to it at streamList.

Parameters:
reader A reference to the QXmlStreamReader object that you're using for processing.

Definition at line 58 of file icecast_internalthread.cpp.

References streamDirectoryEntry_stream::aac, streamDirectoryEntry_stream::aac_plus, streamDirectoryEntry_stream::bitrate, streamDirectoryEntry_stream::currentlyPlaying, streamDirectoryEntry_stream::mp3, streamDirectoryEntry_stream::nsv, streamDirectoryEntry_stream::ogg, streamDirectoryEntry::setName(), streamDirectoryEntry::setValue(), streamList, streamDirectoryEntry_stream::streamType, and streamDirectoryEntry_stream::unknown.

Referenced by run().

Here is the call graph for this function:

Here is the caller graph for this function:

void icecast_internalThread::run (  )  [protected, virtual]

Internal implementation of the thread.

Definition at line 35 of file icecast_internalthread.cpp.

References readStreamEntry(), streamList, and streamlist_ready().

Here is the call graph for this function:

void icecast_internalThread::streamlist_ready ( icecast_internalThread::streamEntryList  list  )  [signal]

This signal is emitted after the thread has prepared the data structure.

Note:
This signal is emitted from within the thread. So, when you connect it, this will be a connection between thread, which is a queued connection. Because of this, you have to register the data type icecast_internalThread::streamEntryList to Qt's meta type system before the connection. See the respective documentation of the data type for details.
Parameters:
list A list with pointers the the objects on the heap. It is up to you to make sure that these objects on the head will get deleted!

Referenced by run().

Here is the caller graph for this function:


Member Data Documentation

Internal list of pointers to the objects on the heap.

Definition at line 80 of file icecast_internalthread.h.

Referenced by readStreamEntry(), and run().


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

doxygen