The Decoder class provides the base interface class of audio decoders.
More...
#include <decoder.h>
List of all members.
Public Member Functions |
| Decoder (QIODevice *input=0) |
virtual | ~Decoder () |
virtual bool | initialize ()=0 |
virtual qint64 | totalTime ()=0 |
virtual void | seek (qint64 time)=0 |
virtual qint64 | read (unsigned char *data, qint64 maxSize)=0 |
virtual int | bitrate ()=0 |
virtual void | next () |
virtual const QString | nextURL () const |
AudioParameters | audioParameters () const |
QMap< Qmmp::ReplayGainKey, double > | replayGainInfo () const |
void | setReplayGainInfo (const QMap< Qmmp::ReplayGainKey, double > &rg) |
QIODevice * | input () |
void | addMetaData (const QMap< Qmmp::MetaData, QString > &metaData) |
bool | hasMetaData () const |
QMap< Qmmp::MetaData, QString > | takeMetaData () |
Static Public Member Functions |
static DecoderFactory * | findByPath (const QString &path, bool useContent=false) |
static DecoderFactory * | findByMime (const QString &mime) |
static DecoderFactory * | findByContent (QIODevice *input) |
static DecoderFactory * | findByProtocol (const QString &p) |
static QList< DecoderFactory * > | factories () |
static QList< DecoderFactory * > | enabledFactories () |
static QString | file (DecoderFactory *factory) |
static QStringList | protocols () |
static void | setEnabled (DecoderFactory *factory, bool enable=true) |
static bool | isEnabled (DecoderFactory *factory) |
Protected Member Functions |
void | configure (quint32 srate, const ChannelMap &map, Qmmp::AudioFormat f=Qmmp::PCM_S16LE) |
void | configure (quint32 srate, int channels, Qmmp::AudioFormat f=Qmmp::PCM_S16LE) |
Detailed Description
The Decoder class provides the base interface class of audio decoders.
- Author:
- Brad Hughes <bhughes@trolltech.com>
-
Ilya Kotov <forkotov@hotmail.ru>
Constructor & Destructor Documentation
Object contsructor.
- Parameters:
-
input | QIODevice-based input source. |
Member Function Documentation
Informs decoder about new received metadata. Call of this function is required for all non-local streams/files
- Parameters:
-
Returns detected audio parameters.
virtual int bitrate |
( |
| ) |
[pure virtual] |
Returns current bitrate (in kbps). Subclass should reimplement this function.
void configure |
( |
quint32 |
srate, |
|
|
const ChannelMap & |
map, |
|
|
Qmmp::AudioFormat |
f = Qmmp::PCM_S16LE |
|
) |
| [protected] |
Use this function inside initialize() reimplementation to tell other plugins about audio parameters.
- Parameters:
-
srate | Sample rate. |
map | Map of channels. |
f | Audio format. |
void configure |
( |
quint32 |
srate, |
|
|
int |
channels, |
|
|
Qmmp::AudioFormat |
f = Qmmp::PCM_S16LE |
|
) |
| [protected] |
Use this function inside initialize() reimplementation to tell other plugins about audio parameters.
- Parameters:
-
srate | Sample rate. |
channels | Number of channels (internal channel sequence). |
f | Audio format. |
Returns a list of enabled decoder factories.
Returns a list of decoder factories.
Returns plugin file path.
- Parameters:
-
Returns DecoderFactory pointer which supports data provided by input or 0 if data is unsupported.
Returns DecoderFactory pointer which supports mime type mime or 0 if mime type mime is unsupported
static DecoderFactory* findByPath |
( |
const QString & |
path, |
|
|
bool |
useContent = false |
|
) |
| [static] |
Returns DecoderFactory pointer which supports file path or 0 if file path is unsupported
- Parameters:
-
path | Full local file path. |
useContent | Content-based file type determination (true - enabled, false - disabled) |
Returns DecoderFactory pointer which supports protocol p or 0 if url is not supported.
bool hasMetaData |
( |
| ) |
const |
Returns true when new metadata has received, otherwise returns false.
virtual bool initialize |
( |
| ) |
[pure virtual] |
Prepares decoder for usage. Subclass should reimplement this function.
Returns QIODevice-based input source assigned for this decoder.
Returns true if input plugin is enabled, otherwise returns false
- Parameters:
-
virtual void next |
( |
| ) |
[virtual] |
Tells decoder that it should play next track. By default this function does nothing. Reimplemet it if your decoder can play next track without stop/start cycle. This may be useful for multitrack formats like cue or cda.
virtual const QString nextURL |
( |
| ) |
const [virtual] |
Returns url which decoder can play without stop/start cycle. By default this function does nothing. Reimplemet it if your decoder can play next track without stop/start cycle.
static QStringList protocols |
( |
| ) |
[static] |
Returns a list of supported protocols (including meta-protocols). This fuction ignores disabled decoders.
virtual qint64 read |
( |
unsigned char * |
data, |
|
|
qint64 |
maxSize |
|
) |
| [pure virtual] |
Reads up to maxSize bytes of decoded audio to data Returns the number of bytes read, or -1 if an error occurred. Subclass should reimplement this function.
Returns ReplayGain information.
virtual void seek |
( |
qint64 |
time | ) |
[pure virtual] |
Requests a seek to the time time indicated, specified in milliseconds. Subclass should reimplement this function.
static void setEnabled |
( |
DecoderFactory * |
factory, |
|
|
bool |
enable = true |
|
) |
| [static] |
Sets whether the input plugin is enabled.
- Parameters:
-
factory | Decoder plugin factory. |
enable | Plugin enable state (true - enable, false - disable) |
Sets ReplayGain information. Use this function before playback.
- Parameters:
-
Takes metadata out of decoder and returns it. Attention: hasMetaData() should return true before use of this fuction.
virtual qint64 totalTime |
( |
| ) |
[pure virtual] |
Returns the total time in milliseconds. Subclass should reimplement this function.
The documentation for this class was generated from the following file:
- /usr/src/RPM/BUILD/qmmp-0.11-svn/src/qmmp/decoder.h