MythTV  0.26-pre
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes | Private Attributes
Decoder Class Reference

#include <decoder.h>

Inheritance diagram for Decoder:
MThread MythObservable avfDecoder CdDecoder

List of all members.

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)
QWaitCondition * cond ()
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)
 Write the given metadata to the filename.
virtual void commitVolatileMetadata (const Metadata *mdata)
 Write the changable metadata, e.g.

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

Detailed Description

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


Constructor & Destructor Documentation

Decoder::~Decoder ( ) [virtual]

Definition at line 32 of file decoder.cpp.

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

Definition at line 27 of file decoder.cpp.


Member Function Documentation

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

Implemented in CdDecoder, and avfDecoder.

Referenced by MusicPlayer::decoderHandlerReady().

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

Implemented in CdDecoder, and avfDecoder.

Referenced by MusicCommon::seek(), and MusicPlayer::seek().

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

Implemented in CdDecoder, and avfDecoder.

Referenced by DecoderHandler::stop().

DecoderFactory* Decoder::factory ( ) const [inline]
QIODevice* Decoder::input ( ) [inline]
void Decoder::setInput ( QIODevice *  i)
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 85 of file mythplugins/mythmusic/mythmusic/decoder.h.

QWaitCondition* Decoder::cond ( ) [inline]
QString Decoder::getFilename ( void  ) const [inline]
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 67 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 102 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 avf decoder (AvfDecoder) implements this, whereas the audio CD decoder (CdDecoder) does not.

Returns:
an instance of MetaIO owned by the caller

Reimplemented in avfDecoder.

Definition at line 136 of file decoder.cpp.

Referenced by commitMetadata(), commitVolatileMetadata(), and readMetadata().

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

Write the given metadata to the filename.

Creates a MetaIO object using Decoder::doCreateTagger and asks the MetaIO object to write the contents of mdata to filename.

mdata the metadata to write to the disk

Reimplemented in CdDecoder.

Definition at line 150 of file decoder.cpp.

Referenced by ImportMusicDialog::addPressed().

void Decoder::commitVolatileMetadata ( const Metadata mdata) [virtual]

Write the changable metadata, e.g.

ratings, playcounts; to the filename if the tag format supports it.

Creates a MetaIO object using Decoder::doCreateTagger and asks the MetaIO object to write changes to a specific subset of metadata to filename.

mdata the metadata to write to the disk

Definition at line 170 of file decoder.cpp.

Referenced by MusicPlayer::updateVolatileMetadata().

QStringList Decoder::all ( ) [static]

Definition at line 217 of file decoder.cpp.

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

Definition at line 230 of file decoder.cpp.

Definition at line 244 of file decoder.cpp.

Referenced by checkFactories().

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

Definition at line 190 of file decoder.cpp.

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

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

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

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

Definition at line 53 of file decoder.cpp.

Referenced by avfDecoder::initialize().


Member Data Documentation

QString Decoder::filename [protected]
QString Decoder::filename_format [static, protected]

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

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

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

Referenced by SetLocationFormatUseTags().

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

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

QIODevice* Decoder::in [private]

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

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

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

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

QMutex Decoder::mtx [private]
QWaitCondition Decoder::cnd [private]

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

Referenced by cond().


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends