-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathtio.h
122 lines (79 loc) · 1.71 KB
/
tio.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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
#ifndef TIO_H
#define TIO_H
#include <QObject>
#include <QMultiHash>
#include <QHash>
#include <QStringList>
#include <sndfile.h>
#include "floatbuffer.h"
class CFileFormats
{
public:
QMultiHash <int, int> hformat;
QHash <int, QString> hsubtype;
QHash <int, QString> hformatnames;
QMultiHash <int, QString> hextensions;
CFileFormats();
};
class CSignaturesList: public QObject
{
Q_OBJECT
public:
QString encname;
QList <QByteArray> words;
};
class CTio: public QObject
{
Q_OBJECT
public:
QString id;
bool ronly;
CFloatBuffer *float_input_buffer;
QStringList extensions;
QString error_string;
virtual CFloatBuffer* load (const QString &fname) = 0;
virtual bool save (const QString &fname) = 0;
virtual bool save_16bit_pcm (const QString &fname) = 0;
};
class CTioPlainAudio: public CTio
{
Q_OBJECT
public:
CTioPlainAudio();
CTioPlainAudio (bool rnly);
~CTioPlainAudio();
CFloatBuffer* load (const QString &fname);
bool save (const QString &fname);
bool save_16bit_pcm (const QString &fname);
};
class CTioProxy: public CTio
{
Q_OBJECT
public:
QHash <QString, QString> proxies;
CTioProxy();
~CTioProxy();
CFloatBuffer* load (const QString &fname);
bool save (const QString &fname);
bool save_16bit_pcm (const QString &fname);
};
class CTioReadOnly: public CTio
{
Q_OBJECT
public:
bool save (const QString &fname);
};
class CTioHandler: public QObject
{
Q_OBJECT
public:
QList <CTio *> list;
QStringList supported_extensions;
CTioHandler();
~CTioHandler();
bool is_ext_supported (const QString &fname);
CTio* get_for_fname (const QString &fname);
};
void file_formats_init();
void file_formats_done();
#endif // TIO_H