The Decoder class provides the base interface class of audio decoders.
More...
#include <decoder.h>
The Decoder class provides the base interface class of audio decoders.
- Author
- Brad Hughes bhugh.nosp@m.es@t.nosp@m.rollt.nosp@m.ech..nosp@m.com
-
Ilya Kotov forko.nosp@m.tov0.nosp@m.2@ya..nosp@m.ru
Definition at line 38 of file decoder.h.
Decoder::Decoder |
( |
QIODevice * |
input = nullptr | ) |
|
|
explicit |
Object contsructor.
- Parameters
-
input | QIODevice-based input source. |
virtual Decoder::~Decoder |
( |
| ) |
|
|
virtualdefault |
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 Decoder::bitrate |
( |
| ) |
const |
|
pure virtual |
Returns current bitrate (in kbps). Subclass should reimplement this function.
Use this function inside initialize() reimplementation to tell other plugins about audio parameters.
- Parameters
-
srate | Sample rate. |
map | Map of channels. |
f | Audio format. |
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. |
Use this function inside initialize() reimplementation to tell other plugins about audio parameters.
- Parameters
-
static QStringList Decoder::contentTypes |
( |
| ) |
|
|
static |
Returns a list of enabled decoder factories.
Returns DecoderFactory pointer which supports data provided by input or 0 if data is unsupported.
Returns a list of DecoderFactory pointers which support extension of the required file
- Parameters
-
path | Full file path or url with correct extension. |
static DecoderFactory* Decoder::findByFilePath |
( |
const QString & |
path, |
|
|
bool |
useContent = false |
|
) |
| |
|
static |
Returns DecoderFactory pointer which supports mime type mime or nullptr if mime type mime is unsupported
Returns DecoderFactory pointer which supports protocol p or nullptr if protocol is not supported.
bool Decoder::hasMetaData |
( |
| ) |
const |
Returns true when new metadata has received, otherwise returns false.
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 void Decoder::loadPlugins |
( |
| ) |
|
|
staticprivate |
static QStringList Decoder::nameFilters |
( |
| ) |
|
|
static |
Returns a list of file name filters, i.e. "*.mp3 *.mpg".
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 |
( |
| ) |
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 Decoder::protocols |
( |
| ) |
|
|
static |
Returns a list of supported protocols (including meta-protocols). This fuction ignores disabled decoders.
virtual qint64 Decoder::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.
virtual void Decoder::seek |
( |
qint64 |
time | ) |
|
|
pure virtual |
Requests a seek to the time time indicated, specified in milliseconds. Subclass should reimplement this function.
static void Decoder::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) |
Referenced by MusicPluginItem::setEnabled().
Updates all extra track properties.
- Parameters
-
properties | New track properties. |
Sets extra track property.
- Parameters
-
key | Property key. |
value | Property value. |
Sets ReplayGain information. Use this function before playback.
- Parameters
-
Takes metadata out of decoder and returns it. Attention: hasMetaData() should return true before using of this fuction.
virtual qint64 Decoder::totalTime |
( |
| ) |
const |
|
pure virtual |
Returns the total time in milliseconds. Subclass should reimplement this function.
QStringList Decoder::m_disabledNames |
|
staticprivate |
bool Decoder::m_hasMetaData = false |
|
private |
QIODevice* Decoder::m_input = nullptr |
|
private |
The documentation for this class was generated from the following file: