Decoder Class Reference

#include <decoder.h>

Inheritance diagram for Decoder:

MythObservable aacDecoder avfDecoder CdDecoder FlacDecoder MadDecoder VorbisDecoder

List of all members.


Detailed Description

Definition at line 52 of file mythplugins/mythmusic/mythmusic/decoder.h.


Public Member Functions

virtual ~Decoder ()
virtual bool initialize ()=0
virtual void seek (double)=0
virtual void stop ()=0
DecoderFactoryfactory () const
QIODevice * input ()
AudioOutputoutput ()
void setInput (QIODevice *)
void setOutput (AudioOutput *)
void setFilename (const QString &newName)
virtual void lock (void)
virtual void unlock (void)
virtual bool tryLock (void)
virtual bool locked (void)
QWaitCondition * cond ()
void setBlockSize (unsigned int sz)
unsigned int blockSize () const
QString getFilename (void) const
virtual MetadatareadMetadata (void)
 Read the metadata from filename directly.
virtual MetadatagetMetadata (void)
 Get the metadata for filename.
virtual MetaIOdoCreateTagger (void)
 Create a MetaIO object for the format.
virtual void commitMetadata (Metadata *mdata)

Static Public Member Functions

static QStringList all ()
static bool supports (const QString &)
static void registerFactory (DecoderFactory *)
static Decodercreate (const QString &, QIODevice *, AudioOutput *, bool=FALSE)
static void SetLocationFormatUseTags (void)

Protected Member Functions

 Decoder (DecoderFactory *, QIODevice *, AudioOutput *)
QMutex * getMutex (void)
void error (const QString &)

Protected Attributes

QString filename

Static Protected Attributes

static QString filename_format
static int ignore_id3 = 0
static QString musiclocation = ""

Private Attributes

DecoderFactoryfctry
QIODevice * in
AudioOutputout
QMutex mtx
QWaitCondition cnd
int blksize

Constructor & Destructor Documentation

Decoder::~Decoder (  )  [virtual]

Definition at line 38 of file decoder.cpp.

Decoder::Decoder ( DecoderFactory d,
QIODevice *  i,
AudioOutput o 
) [protected]

Definition at line 33 of file decoder.cpp.


Member Function Documentation

virtual bool Decoder::initialize (  )  [pure virtual]

virtual void Decoder::seek ( double   )  [pure virtual]

virtual void Decoder::stop (  )  [pure virtual]

DecoderFactory* Decoder::factory (  )  const [inline]

Definition at line 61 of file mythplugins/mythmusic/mythmusic/decoder.h.

Referenced by MusicPlayer::play().

QIODevice* Decoder::input (  )  [inline]

AudioOutput* Decoder::output (  )  [inline]

void Decoder::setInput ( QIODevice *  i  ) 

void Decoder::setOutput ( AudioOutput o  ) 

void Decoder::setFilename ( const QString &  newName  )  [inline]

virtual void Decoder::lock ( void   )  [inline, virtual]

virtual void Decoder::unlock ( void   )  [inline, virtual]

virtual bool Decoder::tryLock ( void   )  [inline, virtual]

Definition at line 71 of file mythplugins/mythmusic/mythmusic/decoder.h.

virtual bool Decoder::locked ( void   )  [inline, virtual]

Definition at line 72 of file mythplugins/mythmusic/mythmusic/decoder.h.

QWaitCondition* Decoder::cond (  )  [inline]

void Decoder::setBlockSize ( unsigned int  sz  )  [inline]

Definition at line 76 of file mythplugins/mythmusic/mythmusic/decoder.h.

Referenced by MusicPlayer::play().

unsigned int Decoder::blockSize (  )  const [inline]

QString Decoder::getFilename ( void   )  const [inline]

Definition at line 78 of file mythplugins/mythmusic/mythmusic/decoder.h.

Referenced by AlbumArt::AlbumArt().

Metadata * Decoder::readMetadata ( void   )  [virtual]

Read the metadata from filename directly.

Creates a MetaIO object using Decoder::doCreateTagger and uses the MetaIO object to read the metadata.

Returns:
an instance of Metadata owned by the caller

Definition at line 74 of file decoder.cpp.

Referenced by FileScanner::AddFileToDB(), getMetadata(), and FileScanner::UpdateFileInDB().

Metadata * Decoder::getMetadata ( void   )  [virtual]

Get the metadata for filename.

First tries to read the metadata from the database. If there is no database entry, it'll call Decoder::readMetadata.

Returns:
an instance of Metadata owned by the caller

Reimplemented in CdDecoder.

Definition at line 108 of file decoder.cpp.

Referenced by ImportMusicDialog::scanDirectory(), and FileScanner::UpdateFileInDB().

MetaIO * Decoder::doCreateTagger ( void   )  [virtual]

Create a MetaIO object for the format.

This method should be overwritten by subclasses to return an instance of the appropriate MetaIO subtype. It is used by Decoder::getMetadata, Decoder::readMetadata and Decoder::commitMetadata.

The default implementation returns a NULL pointer, which essentially means, that if the decoder does not overrider this method or all of the users (see previous paragraph), files that the decoder supports cannot be indexed using metadata in the file.

e.g. the mp3 decoder (MadDecoder) implements this, whereas the audio CD decoder (CdDecoder) does not.

Returns:
an instance of MetaIO owned by the caller

Reimplemented in aacDecoder, avfDecoder, FlacDecoder, MadDecoder, and VorbisDecoder.

Definition at line 142 of file decoder.cpp.

Referenced by commitMetadata(), and readMetadata().

void Decoder::commitMetadata ( Metadata mdata  )  [virtual]

QStringList Decoder::all (  )  [static]

Definition at line 204 of file decoder.cpp.

bool Decoder::supports ( const QString &  source  )  [static]

Definition at line 219 of file decoder.cpp.

void Decoder::registerFactory ( DecoderFactory fact  )  [static]

Definition at line 235 of file decoder.cpp.

Referenced by checkFactories().

Decoder * Decoder::create ( const QString &  source,
QIODevice *  input,
AudioOutput output,
bool  deletable = FALSE 
) [static]

void Decoder::SetLocationFormatUseTags ( void   )  [static]

Definition at line 171 of file decoder.cpp.

Referenced by mythplugin_config(), mythplugin_init(), and preMusic().

QMutex* Decoder::getMutex ( void   )  [inline, protected]

Definition at line 95 of file mythplugins/mythmusic/mythmusic/decoder.h.

Referenced by CdDecoder::setCDSpeed().

void Decoder::error ( const QString &  e  )  [protected]


Member Data Documentation

QString Decoder::filename [protected]

QString Decoder::filename_format [static, protected]

Definition at line 100 of file mythplugins/mythmusic/mythmusic/decoder.h.

int Decoder::ignore_id3 = 0 [static, protected]

QString Decoder::musiclocation = "" [static, protected]

Definition at line 102 of file mythplugins/mythmusic/mythmusic/decoder.h.

Referenced by SetLocationFormatUseTags().

Definition at line 105 of file mythplugins/mythmusic/mythmusic/decoder.h.

Referenced by ~Decoder().

QIODevice* Decoder::in [private]

Definition at line 107 of file mythplugins/mythmusic/mythmusic/decoder.h.

Referenced by setInput(), and ~Decoder().

Definition at line 108 of file mythplugins/mythmusic/mythmusic/decoder.h.

Referenced by setOutput(), and ~Decoder().

QMutex Decoder::mtx [private]

Definition at line 110 of file mythplugins/mythmusic/mythmusic/decoder.h.

QWaitCondition Decoder::cnd [private]

Definition at line 111 of file mythplugins/mythmusic/mythmusic/decoder.h.

int Decoder::blksize [private]

Definition at line 113 of file mythplugins/mythmusic/mythmusic/decoder.h.

Referenced by ~Decoder().


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

Generated on Sat Jul 31 05:18:34 2010 for MythTV by  doxygen 1.5.5