-
Notifications
You must be signed in to change notification settings - Fork 0
/
decoder_xmdx.cpp
54 lines (45 loc) · 1012 Bytes
/
decoder_xmdx.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_xmdx.h"
#include "xmdxhelper.h"
DecoderXMDX::DecoderXMDX(const QString &path)
: Decoder()
{
m_helper = new XMDXHelper(path);
}
DecoderXMDX::~DecoderXMDX()
{
delete m_helper;
}
bool DecoderXMDX::initialize()
{
if(!m_helper->initialize())
{
qWarning("DecoderXMDX: initialize failed");
return false;
}
const int rate = m_helper->sampleRate();
const int channels = m_helper->channels();
if(rate == 0 || channels == 0)
{
qWarning("DecoderXMDX: rate or channel invalid");
return false;
}
configure(rate, channels, Qmmp::PCM_S16LE);
qDebug("DecoderXMDX: initialize success");
return true;
}
qint64 DecoderXMDX::totalTime() const
{
return m_helper->totalTime();
}
int DecoderXMDX::bitrate() const
{
return m_helper->bitrate();
}
qint64 DecoderXMDX::read(unsigned char *data, qint64 maxSize)
{
return m_helper->read(data, maxSize);
}
void DecoderXMDX::seek(qint64 time)
{
Q_UNUSED(time);
}