summaryrefslogtreecommitdiffstats
path: root/src/qalabstractaudiodecoder.h
blob: 7a539fdf0248f5d34202df3dcda6add726177445 (plain)
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 QtOpenAL project
 * Copyright (c) 2011 Laszlo Papp <lpapp@kde.org>
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library 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
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
 */

#ifndef QALABSTRACTAUDIODECODER_H
#define QALABSTRACTAUDIODECODER_H

#include "q_openal_export.h"

class QString;
class QFile;
class QUrl;

class Q_OPENAL_EXPORT QALAbstractAudioDecoder
{
    //Q_DECLARE_PRIVATE(QALAbstractAudioDecoder)
public:
    QALAbstractAudioDecoder();
    virtual ~QALAbstractAudioDecoder();

    virtual bool open(const QFile &file) = 0;
    virtual bool open(const QUrl &fileUrl) = 0;
    virtual bool open(const QString &fileName) = 0;
    virtual qint64 pos() = 0;
    virtual bool seek(qint64 pos) = 0;
    virtual bool close() = 0;

    virtual void setEncodedData(const QByteArray &encodedData) = 0;

    virtual int channels() const = 0;
    virtual int sampleRate() const = 0;
    virtual int sampleSize() const = 0;

    virtual QByteArray decode(qint64 maxlen) = 0;
    virtual qint64 decode(char *decodedData, qint64 maxlen) = 0;
};

#endif