-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdecoder_adplug.h
53 lines (41 loc) · 1.67 KB
/
decoder_adplug.h
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
/***************************************************************************
* This file is part of the TTK qmmp plugin project
* Copyright (C) 2015 - 2025 Greedysky Studio
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License along
* with this program; If not, see <http://www.gnu.org/licenses/>.
***************************************************************************/
#ifndef DECODER_ADPLUG_H
#define DECODER_ADPLUG_H
#include <qmmp/decoder.h>
class AdPlugHelper;
/*!
* @author Greedysky <[email protected]>
*/
class DecoderAdPlug : public Decoder
{
public:
explicit DecoderAdPlug(const QString &path);
virtual ~DecoderAdPlug();
virtual bool initialize() override final;
virtual qint64 totalTime() const override final;
virtual int bitrate() const override final;
virtual qint64 read(unsigned char *data, qint64 maxSize) override final;
virtual void seek(qint64 time) override final;
private:
qint64 copy(unsigned char *data, qint64 maxSize);
AdPlugHelper *m_helper = nullptr;
unsigned char *m_bufptr = nullptr;
qint64 m_buf_filled = 0;
qint64 m_time = 0;
qint64 m_length = 0;
double m_divisor = 0.0;
};
#endif