MythTV  master
Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
CdDecoder Class Reference

#include <cddecoder.h>

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

Public Member Functions

 CdDecoder (const QString &file, DecoderFactory *, AudioOutput *)
 
virtual ~CdDecoder ()
 
bool initialize () override
 
void seek (double) override
 
void stop () override
 
MusicMetadatagetMetadata (void)
 
MusicMetadatagetMetadata (int track)
 
int getNumTracks ()
 
int getNumCDAudioTracks ()
 
void setDevice (const QString &dev)
 
void setCDSpeed (int speed)
 
- Public Member Functions inherited from Decoder
virtual ~Decoder ()
 
DecoderFactoryfactory () const
 
AudioOutputoutput ()
 
void setOutput (AudioOutput *)
 
void setURL (const QString &url)
 
virtual void lock (void)
 
virtual void unlock (void)
 
virtual bool tryLock (void)
 
QWaitCondition * cond ()
 
QString getURL (void) const
 
- Public Member Functions inherited from MThread
 MThread (const QString &objectName)
 Standard constructor. More...
 
 MThread (const QString &objectName, QRunnable *runnable)
 Use this constructor if you want the default run() method to run the QRunnable's run() method instead of entering the Qt event loop. More...
 
virtual ~MThread ()
 
void RunProlog (void)
 Sets up a thread, call this if you reimplement run(). More...
 
void RunEpilog (void)
 Cleans up a thread's resources, call this if you reimplement run(). More...
 
QThread * qthread (void)
 Returns the thread, this will always return the same pointer no matter how often you restart the thread. More...
 
void setObjectName (const QString &name)
 
QString objectName (void) const
 
void setPriority (QThread::Priority priority)
 
QThread::Priority priority (void) const
 
bool isFinished (void) const
 
bool isRunning (void) const
 
void setStackSize (uint stackSize)
 
uint stackSize (void) const
 
void exit (int retcode=0)
 Use this to exit from the thread if you are using a Qt event loop. More...
 
void start (QThread::Priority=QThread::InheritPriority)
 Tell MThread to start running the thread in the near future. More...
 
void terminate (void)
 Kill a thread unsafely. More...
 
void quit (void)
 calls exit(0) More...
 
bool wait (unsigned long time=ULONG_MAX)
 Wait for the MThread to exit, with a maximum timeout. More...
 
- 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)
 

Private Member Functions

 Q_DECLARE_TR_FUNCTIONS (CdDecoder)
 
void run () override
 Runs the Qt event loop unless we have a QRunnable, in which case we run the runnable run instead. More...
 
void writeBlock ()
 
void deinit ()
 

Static Private Member Functions

static QMutex & getCdioMutex ()
 

Private Attributes

volatile bool m_inited {false}
 
volatile bool m_user_stop {false}
 
QString m_devicename
 
DecoderEvent::Type m_stat {DecoderEvent::Error}
 
char * m_output_buf {nullptr}
 
std::size_t m_output_at {0}
 
std::size_t m_bks {0}
 
std::size_t m_bksFrames {0}
 
std::size_t m_decodeBytes {0}
 
bool m_finish {false}
 
long m_freq {0}
 
long m_bitrate {0}
 
int m_chan {0}
 
double m_seekTime {-1.0}
 
int m_settracknum {-1}
 
int m_tracknum {0}
 

Additional Inherited Members

- Static Public Member Functions inherited from Decoder
static QStringList all ()
 
static bool supports (const QString &)
 
static void registerFactory (DecoderFactory *)
 
static Decodercreate (const QString &, AudioOutput *, bool=false)
 
- Static Public Member Functions inherited from MThread
static void ThreadSetup (const QString &)
 This is to be called on startup in those few threads that haven't been ported to MThread. More...
 
static void ThreadCleanup (void)
 This is to be called on exit in those few threads that haven't been ported to MThread. More...
 
static void Cleanup (void)
 This will print out all the running threads, call exit(1) on each and then wait up to 5 seconds total for all the threads to exit. More...
 
static void GetAllThreadNames (QStringList &list)
 
static void GetAllRunningThreadNames (QStringList &list)
 
- Static Public Attributes inherited from MThread
static const int kDefaultStartTimeout
 
- Protected Member Functions inherited from Decoder
 Decoder (DecoderFactory *d, AudioOutput *o)
 
QMutex * getMutex (void)
 
void error (const QString &)
 
- Protected Member Functions inherited from MThread
int exec (void)
 Enters the qt event loop. call exit or quit to exit thread. More...
 
- Static Protected Member Functions inherited from MThread
static void setTerminationEnabled (bool enabled=true)
 
static void sleep (unsigned long time)
 
static void msleep (unsigned long time)
 
static void usleep (unsigned long time)
 
- Protected Attributes inherited from Decoder
QString m_url
 
- Protected Attributes inherited from MThread
MThreadInternalm_thread {nullptr}
 
QRunnable * m_runnable {nullptr}
 
bool m_prolog_executed {true}
 
bool m_epilog_executed {true}
 
- Protected Attributes inherited from MythObservable
QMutex * m_lock {nullptr}
 
QSet< QObject * > m_listeners
 

Detailed Description

Definition at line 26 of file cddecoder.h.

Constructor & Destructor Documentation

◆ CdDecoder()

CdDecoder::CdDecoder ( const QString &  file,
DecoderFactory d,
AudioOutput o 
)

Definition at line 94 of file cddecoder.cpp.

◆ ~CdDecoder()

CdDecoder::~CdDecoder ( )
virtual

Definition at line 101 of file cddecoder.cpp.

Member Function Documentation

◆ Q_DECLARE_TR_FUNCTIONS()

CdDecoder::Q_DECLARE_TR_FUNCTIONS ( CdDecoder  )
private

◆ initialize()

bool CdDecoder::initialize ( )
overridevirtual

Implements Decoder.

Definition at line 150 of file cddecoder.cpp.

◆ seek()

void CdDecoder::seek ( double  pos)
overridevirtual

Implements Decoder.

Definition at line 264 of file cddecoder.cpp.

◆ stop()

void CdDecoder::stop ( void  )
overridevirtual

Implements Decoder.

Definition at line 118 of file cddecoder.cpp.

◆ getMetadata() [1/2]

MusicMetadata * CdDecoder::getMetadata ( void  )

Definition at line 538 of file cddecoder.cpp.

Referenced by getMetadata(), and Ripper::ScanFinished().

◆ getMetadata() [2/2]

MusicMetadata * CdDecoder::getMetadata ( int  track)

Definition at line 492 of file cddecoder.cpp.

◆ getNumTracks()

int CdDecoder::getNumTracks ( )

Definition at line 450 of file cddecoder.cpp.

Referenced by Ripper::ScanFinished().

◆ getNumCDAudioTracks()

int CdDecoder::getNumCDAudioTracks ( )

Definition at line 468 of file cddecoder.cpp.

Referenced by getMetadata().

◆ setDevice()

void CdDecoder::setDevice ( const QString &  dev)

Definition at line 107 of file cddecoder.cpp.

Referenced by MusicPlayer::decoderHandlerReady(), and Ripper::scanCD().

◆ setCDSpeed()

void CdDecoder::setCDSpeed ( int  speed)

Definition at line 432 of file cddecoder.cpp.

Referenced by deinit(), and initialize().

◆ run()

void CdDecoder::run ( void  )
overrideprivatevirtual

Runs the Qt event loop unless we have a QRunnable, in which case we run the runnable run instead.

Note
If you override this method you must call RunProlog before you do any work and RunEpilog before you exit the run method.

Reimplemented from MThread.

Definition at line 296 of file cddecoder.cpp.

◆ writeBlock()

void CdDecoder::writeBlock ( )
private

Definition at line 124 of file cddecoder.cpp.

Referenced by run().

◆ deinit()

void CdDecoder::deinit ( )
private

Definition at line 272 of file cddecoder.cpp.

Referenced by run(), and ~CdDecoder().

◆ getCdioMutex()

QMutex & CdDecoder::getCdioMutex ( )
staticprivate

Member Data Documentation

◆ m_inited

volatile bool CdDecoder::m_inited {false}
private

Definition at line 61 of file cddecoder.h.

Referenced by deinit(), initialize(), run(), and ~CdDecoder().

◆ m_user_stop

volatile bool CdDecoder::m_user_stop {false}
private

Definition at line 62 of file cddecoder.h.

Referenced by deinit(), initialize(), run(), and stop().

◆ m_devicename

QString CdDecoder::m_devicename
private

◆ m_stat

DecoderEvent::Type CdDecoder::m_stat {DecoderEvent::Error}
private

Definition at line 78 of file cddecoder.h.

Referenced by deinit(), initialize(), and run().

◆ m_output_buf

char* CdDecoder::m_output_buf {nullptr}
private

Definition at line 79 of file cddecoder.h.

Referenced by deinit(), initialize(), run(), and writeBlock().

◆ m_output_at

std::size_t CdDecoder::m_output_at {0}
private

Definition at line 80 of file cddecoder.h.

Referenced by initialize(), run(), and writeBlock().

◆ m_bks

std::size_t CdDecoder::m_bks {0}
private

Definition at line 82 of file cddecoder.h.

Referenced by initialize(), run(), and writeBlock().

◆ m_bksFrames

std::size_t CdDecoder::m_bksFrames {0}
private

Definition at line 83 of file cddecoder.h.

Referenced by initialize(), and writeBlock().

◆ m_decodeBytes

std::size_t CdDecoder::m_decodeBytes {0}
private

Definition at line 84 of file cddecoder.h.

Referenced by initialize(), and run().

◆ m_finish

bool CdDecoder::m_finish {false}
private

Definition at line 85 of file cddecoder.h.

Referenced by deinit(), initialize(), and run().

◆ m_freq

long CdDecoder::m_freq {0}
private

Definition at line 86 of file cddecoder.h.

Referenced by deinit(), and initialize().

◆ m_bitrate

long CdDecoder::m_bitrate {0}
private

Definition at line 87 of file cddecoder.h.

Referenced by deinit(), and initialize().

◆ m_chan

int CdDecoder::m_chan {0}
private

Definition at line 88 of file cddecoder.h.

Referenced by deinit(), and initialize().

◆ m_seekTime

double CdDecoder::m_seekTime {-1.0}
private

Definition at line 89 of file cddecoder.h.

Referenced by initialize(), run(), seek(), and writeBlock().

◆ m_settracknum

int CdDecoder::m_settracknum {-1}
private

Definition at line 91 of file cddecoder.h.

Referenced by getMetadata().

◆ m_tracknum

int CdDecoder::m_tracknum {0}
private

Definition at line 92 of file cddecoder.h.

Referenced by initialize().


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