LeechCraft  0.6.70-15082-g543737046d
Modular cross-platform feature rich live environment.
Media::IRadioStation Class Referenceabstract

Describes a single radio station. More...

#include "iradiostation.h"

Public Member Functions

virtual ~IRadioStation ()
 
virtual QObject * GetQObject ()=0
 Returns this object as a QObject. More...
 
virtual void RequestNewStream ()=0
 Request a new stream if this is a multistream radio. More...
 
virtual QString GetRadioName () const =0
 Returns the human-readable name of this radio station. More...
 

Protected Member Functions

virtual void gotNewStream (const QUrl &url, const AudioInfo &info)=0
 Emitted when there is a new audio stream available. More...
 
virtual void gotPlaylist (const QString &filename, const QString &format)=0
 Emitted when a playlist for this radio is fetched. More...
 
virtual void gotAudioInfos (const QList< AudioInfo > &infos)=0
 Emitted when just a set of audio infos is available. More...
 
virtual void gotError (const QString &error)=0
 Emitted when there is an error. More...
 

Detailed Description

Describes a single radio station.

Radio stations can be either single-stream or multistream. Single-stream stations have only one continuous stream of music like an Icecast/Shoutcast broadcasting. Multistream radio stations announce tracks one by one, like Last.FM radio. The difference is that it makes sense to skip a track in multistream radios, while there is nothing to skip in single-stream ones.

Multistream radio stations will typically emit gotNewStream() signals from time to time and as a response to RequestNewStream(), while single-stream radio stations will emit gotPlaylist() once.

This class has some signals (gotNewStream(), gotPlaylist() and gotError()), and one can use the GetQObject() method to get an object of this class as a QObject and connect to those signals.

Ownership of this class is either passed to the caller or remains belonging to the returning plugin, this class never deletes itself.

See also
IRadioStationProvider
IModifiableRadioStation

Definition at line 43 of file iradiostation.h.

Constructor & Destructor Documentation

◆ ~IRadioStation()

virtual Media::IRadioStation::~IRadioStation ( )
inlinevirtual

Definition at line 46 of file iradiostation.h.

Member Function Documentation

◆ GetQObject()

virtual QObject* Media::IRadioStation::GetQObject ( )
pure virtual

Returns this object as a QObject.

This function can be used to connect to the signals of this class.

Returns
This object as a QObject.

◆ GetRadioName()

virtual QString Media::IRadioStation::GetRadioName ( ) const
pure virtual

Returns the human-readable name of this radio station.

Returns
The human-readable name of this radio station.

◆ gotAudioInfos()

virtual void Media::IRadioStation::gotAudioInfos ( const QList< AudioInfo > &  infos)
protectedpure virtual

Emitted when just a set of audio infos is available.

This signal can be used by radio stations that get audio streams in a form different of a playlist file.

The audio infos in the infos list must contain the URL field.

Parameters
[out]infosThe infos corresponding to this radio station.

◆ gotError()

virtual void Media::IRadioStation::gotError ( const QString &  error)
protectedpure virtual

Emitted when there is an error.

Parameters
[out]errorThe human-readable error text.

◆ gotNewStream()

virtual void Media::IRadioStation::gotNewStream ( const QUrl &  url,
const AudioInfo info 
)
protectedpure virtual

Emitted when there is a new audio stream available.

Parameters
[out]urlThe URL of the stream.
[out]infoThe track metadata.

◆ gotPlaylist()

virtual void Media::IRadioStation::gotPlaylist ( const QString &  filename,
const QString &  format 
)
protectedpure virtual

Emitted when a playlist for this radio is fetched.

Ownership of the playlist is passed to the owner of this radio station, and it is responsible for deleting the playlist file after it is not needed.

Playlist format is passed in the format parameter, and it can be one of:

  • m3u8
  • m3u
  • pls
  • xspf
Parameters
[out]filenameThe local path to the playlist.
[out]formatThe format of the playlist.

◆ RequestNewStream()

virtual void Media::IRadioStation::RequestNewStream ( )
pure virtual

Request a new stream if this is a multistream radio.

Otherwise, this function does nothing.


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