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