MythTV  master
Public Types | Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
DecoderHandler Class Reference

Class for starting stream decoding. More...

#include <decoderhandler.h>

Inheritance diagram for DecoderHandler:
Inheritance graph
[legend]
Collaboration diagram for DecoderHandler:
Collaboration graph
[legend]

Public Types

enum  State { ACTIVE, LOADING, STOPPED }
 

Public Member Functions

 DecoderHandler (void)=default
 
virtual ~DecoderHandler (void)
 
DecodergetDecoder (void)
 
void start (MusicMetadata *mdata)
 
void stop (void)
 
void customEvent (QEvent *e) override
 
bool done (void)
 
bool next (void)
 
void error (const QString &e)
 
MusicMetadatagetMetadata ()
 
QUrl & getUrl ()
 
void setUrl (const QUrl &url)
 
- Public Member Functions inherited from MythObservable
 MythObservable ()
 
virtual ~MythObservable ()
 
void addListener (QObject *listener)
 Add a listener to the observable. More...
 
void removeListener (QObject *listener)
 Remove a listener to the observable. More...
 
void dispatch (const MythEvent &event)
 Dispatch an event to all listeners. More...
 
bool hasListeners (void)
 

Protected Member Functions

void doOperationStart (const QString &name)
 
void doOperationStop (void)
 
void doConnectDecoder (const QUrl &url, const QString &format)
 
void doFailed (const QUrl &url, const QString &message)
 
void doStart (bool result)
 

Private Member Functions

void createPlaylist (const QUrl &url)
 
void createPlaylistForSingleFile (const QUrl &url)
 
void createPlaylistFromFile (const QUrl &url)
 
void createPlaylistFromRemoteUrl (const QUrl &url)
 

Private Attributes

int m_state {STOPPED}
 
int m_playlist_pos {0}
 
PlayListFile m_playlist
 
Decoderm_decoder {nullptr}
 
MusicMetadata m_meta
 
QUrl m_url
 
bool m_op {false}
 
uint m_redirects {0}
 

Static Private Attributes

static const uint MaxRedirects = 3
 

Additional Inherited Members

- Protected Attributes inherited from MythObservable
QMutex * m_lock {nullptr}
 
QSet< QObject * > m_listeners
 

Detailed Description

Class for starting stream decoding.

This class handles starting the Decoder for the MusicPlayer via DecoderIOFactorys.

It operates on a playlist, either created with a single file, by loading a .pls or downloading it, and for each entry creates an appropriate Decoder.

Definition at line 70 of file decoderhandler.h.

Member Enumeration Documentation

◆ State

Enumerator
ACTIVE 
LOADING 
STOPPED 

Definition at line 75 of file decoderhandler.h.

Constructor & Destructor Documentation

◆ DecoderHandler()

DecoderHandler::DecoderHandler ( void  )
default

◆ ~DecoderHandler()

DecoderHandler::~DecoderHandler ( void  )
virtual

Definition at line 70 of file decoderhandler.cpp.

Member Function Documentation

◆ getDecoder()

Decoder* DecoderHandler::getDecoder ( void  )
inline

Definition at line 85 of file decoderhandler.h.

Referenced by MusicPlayer::getDecoder().

◆ start()

void DecoderHandler::start ( MusicMetadata mdata)

Definition at line 75 of file decoderhandler.cpp.

Referenced by MusicPlayer::play().

◆ stop()

void DecoderHandler::stop ( void  )

Definition at line 176 of file decoderhandler.cpp.

Referenced by MusicPlayer::stopDecoder(), and ~DecoderHandler().

◆ customEvent()

void DecoderHandler::customEvent ( QEvent *  e)
override

Definition at line 206 of file decoderhandler.cpp.

◆ done()

bool DecoderHandler::done ( void  )

Definition at line 124 of file decoderhandler.cpp.

Referenced by next().

◆ next()

bool DecoderHandler::next ( void  )

Definition at line 138 of file decoderhandler.cpp.

Referenced by doStart(), and MusicPlayer::nextAuto().

◆ error()

void DecoderHandler::error ( const QString &  e)

Definition at line 117 of file decoderhandler.cpp.

◆ getMetadata()

MusicMetadata& DecoderHandler::getMetadata ( void  )
inline

◆ getUrl()

QUrl& DecoderHandler::getUrl ( )
inline

Definition at line 97 of file decoderhandler.h.

◆ setUrl()

void DecoderHandler::setUrl ( const QUrl &  url)
inline

Definition at line 98 of file decoderhandler.h.

◆ doOperationStart()

void DecoderHandler::doOperationStart ( const QString &  name)
protected

Definition at line 358 of file decoderhandler.cpp.

Referenced by createPlaylistFromRemoteUrl().

◆ doOperationStop()

void DecoderHandler::doOperationStop ( void  )
protected

Definition at line 365 of file decoderhandler.cpp.

Referenced by createPlaylistFromRemoteUrl(), customEvent(), doStart(), and stop().

◆ doConnectDecoder()

void DecoderHandler::doConnectDecoder ( const QUrl &  url,
const QString &  format 
)
protected

Definition at line 327 of file decoderhandler.cpp.

Referenced by next().

◆ doFailed()

void DecoderHandler::doFailed ( const QUrl &  url,
const QString &  message 
)
protected

Definition at line 350 of file decoderhandler.cpp.

Referenced by customEvent(), doConnectDecoder(), and doStart().

◆ doStart()

void DecoderHandler::doStart ( bool  result)
protected

Definition at line 92 of file decoderhandler.cpp.

Referenced by createPlaylistForSingleFile(), and createPlaylistFromFile().

◆ createPlaylist()

void DecoderHandler::createPlaylist ( const QUrl &  url)
private

Definition at line 254 of file decoderhandler.cpp.

Referenced by start().

◆ createPlaylistForSingleFile()

void DecoderHandler::createPlaylistForSingleFile ( const QUrl &  url)
private

Definition at line 274 of file decoderhandler.cpp.

Referenced by createPlaylist().

◆ createPlaylistFromFile()

void DecoderHandler::createPlaylistFromFile ( const QUrl &  url)
private

Definition at line 288 of file decoderhandler.cpp.

Referenced by createPlaylist(), and customEvent().

◆ createPlaylistFromRemoteUrl()

void DecoderHandler::createPlaylistFromRemoteUrl ( const QUrl &  url)
private

Definition at line 297 of file decoderhandler.cpp.

Referenced by createPlaylist().

Member Data Documentation

◆ m_state

int DecoderHandler::m_state {STOPPED}
private

◆ m_playlist_pos

int DecoderHandler::m_playlist_pos {0}
private

Definition at line 114 of file decoderhandler.h.

Referenced by done(), next(), and start().

◆ m_playlist

PlayListFile DecoderHandler::m_playlist
private

◆ m_decoder

Decoder* DecoderHandler::m_decoder {nullptr}
private

Definition at line 116 of file decoderhandler.h.

Referenced by doConnectDecoder(), getDecoder(), and stop().

◆ m_meta

MusicMetadata DecoderHandler::m_meta
private

Definition at line 117 of file decoderhandler.h.

Referenced by doStart(), getMetadata(), next(), and start().

◆ m_url

QUrl DecoderHandler::m_url
private

Definition at line 118 of file decoderhandler.h.

Referenced by doStart(), getUrl(), next(), setUrl(), and start().

◆ m_op

bool DecoderHandler::m_op {false}
private

Definition at line 119 of file decoderhandler.h.

Referenced by doOperationStart(), and doOperationStop().

◆ m_redirects

uint DecoderHandler::m_redirects {0}
private

Definition at line 120 of file decoderhandler.h.

Referenced by start().

◆ MaxRedirects

const uint DecoderHandler::MaxRedirects = 3
staticprivate

Definition at line 122 of file decoderhandler.h.


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