-
Notifications
You must be signed in to change notification settings - Fork 0
/
decoder_tfmx.cpp
54 lines (45 loc) · 1012 Bytes
/
decoder_tfmx.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#include "decoder_tfmx.h"
#include "tfmxhelper.h"
DecoderTFMX::DecoderTFMX(const QString &path)
: Decoder()
{
m_helper = new TFMXHelper(path);
}
DecoderTFMX::~DecoderTFMX()
{
delete m_helper;
}
bool DecoderTFMX::initialize()
{
if(!m_helper->initialize())
{
qWarning("DecoderTFMX: initialize failed");
return false;
}
const int rate = m_helper->sampleRate();
const int channels = m_helper->channels();
if(rate == 0 || channels == 0)
{
qWarning("DecoderTFMX: rate or channel invalid");
return false;
}
configure(rate, channels, Qmmp::PCM_S16LE);
qDebug("DecoderTFMX: initialize success");
return true;
}
qint64 DecoderTFMX::totalTime() const
{
return m_helper->totalTime();
}
int DecoderTFMX::bitrate() const
{
return m_helper->bitrate();
}
qint64 DecoderTFMX::read(unsigned char *data, qint64 maxSize)
{
return m_helper->read(data, maxSize);
}
void DecoderTFMX::seek(qint64 time)
{
Q_UNUSED(time);
}