#include <decoder.h>
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 (char *data, qint64 maxSize)=0 |
| virtual int | bitrate ()=0 |
| virtual void | next () |
| virtual const QString | nextURL () |
| AudioParameters | audioParameters () const |
| QMap< Qmmp::ReplayGainKey, double > | replayGainInfo () const |
| void | setReplayGainInfo (const QMap< Qmmp::ReplayGainKey, double > &rg) |
| QIODevice * | input () |
Static Public Member Functions | |
| static DecoderFactory * | findByPath (const QString &path) |
| static DecoderFactory * | findByMime (const QString &mime) |
| static DecoderFactory * | findByContent (QIODevice *input) |
| static DecoderFactory * | findByProtocol (const QString &p) |
| static QList< DecoderFactory * > * | factories () |
| static QStringList | files () |
| static void | setEnabled (DecoderFactory *factory, bool enable=true) |
| static bool | isEnabled (DecoderFactory *factory) |
Protected Member Functions | |
| void | configure (quint32 srate=44100, int chan=2, Qmmp::AudioFormat f=Qmmp::PCM_S16LE) |
| Decoder::Decoder | ( | QIODevice * | input = 0 |
) |
Object contsructor.
| input | QIODevice-based input source. |
| virtual Decoder::~Decoder | ( | ) | [virtual] |
Destructor.
| AudioParameters Decoder::audioParameters | ( | ) | const |
Returns detected audio parameters.
| virtual int Decoder::bitrate | ( | ) | [pure virtual] |
Returns current bitrate (in kbps). Subclass should reimplement this function.
| void Decoder::configure | ( | quint32 | srate = 44100, |
|
| int | chan = 2, |
|||
| Qmmp::AudioFormat | f = Qmmp::PCM_S16LE | |||
| ) | [protected] |
Use this function inside initialize() reimplementation to tell other plugins about audio parameters.
| srate | Sample rate. | |
| chan | Number of channels. | |
| f | Audio format. |
| static QList<DecoderFactory*>* Decoder::factories | ( | ) | [static] |
Returns a list of decoder factories.
| static QStringList Decoder::files | ( | ) | [static] |
Returns a list of input plugin file names.
| static DecoderFactory* Decoder::findByContent | ( | QIODevice * | input | ) | [static] |
Returns DecoderFactory pointer which supports data provided by QIODevice input or 0 if data is unsupported.
| static DecoderFactory* Decoder::findByMime | ( | const QString & | mime | ) | [static] |
Returns DecoderFactory pointer which supports mime type mime or 0 if mime type mime is unsupported
| static DecoderFactory* Decoder::findByPath | ( | const QString & | path | ) | [static] |
Returns DecoderFactory pointer which supports file path or 0 if file path is unsupported
| static DecoderFactory* Decoder::findByProtocol | ( | const QString & | p | ) | [static] |
Returns DecoderFactory pointer which supports protocol p or 0 if url is not supported.
| virtual bool Decoder::initialize | ( | ) | [pure virtual] |
Prepares decoder for usage. Subclass should reimplement this function.
| QIODevice* Decoder::input | ( | ) |
Returns QIODevice-based input source assigned for this decoder.
| static bool Decoder::isEnabled | ( | DecoderFactory * | factory | ) | [static] |
Returns true if input plugin is enabled, otherwise returns false
| factory | Decoder plugin factory. |
| virtual void Decoder::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 Decoder::nextURL | ( | ) | [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.
| virtual qint64 Decoder::read | ( | 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. In most cases subclass should reimplement this function.
| QMap<Qmmp::ReplayGainKey, double> Decoder::replayGainInfo | ( | ) | const |
Returns ReplayGain information.
| virtual void Decoder::seek | ( | qint64 | time | ) | [pure virtual] |
Requests a seek to the time time indicated, specified in milliseconds.
| static void Decoder::setEnabled | ( | DecoderFactory * | factory, | |
| bool | enable = true | |||
| ) | [static] |
Sets whether the input plugin is enabled.
| factory | Decoder plugin factory. | |
| enable | Plugin enable state (true - enable, false - disable) |
| void Decoder::setReplayGainInfo | ( | const QMap< Qmmp::ReplayGainKey, double > & | rg | ) |
Sets ReplayGain information. Use this function before playback.
| virtual qint64 Decoder::totalTime | ( | ) | [pure virtual] |
Returns the total time in milliseconds. Subclass should reimplement this function.
1.5.9