synthclone 0.3.0
Loading...
Searching...
No Matches
samplestream.h
Go to the documentation of this file.
1/*
2 * libsynthclone - a plugin API for `synthclone`
3 * Copyright (C) 2011-2012 Devin Anderson
4 *
5 * This library is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU Lesser General Public License as published by the
7 * Free Software Foundation; either version 2.1 of the License, or (at your
8 * option) any later version.
9 *
10 * This library is distributed in the hope that it will be useful, but WITHOUT
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
13 * for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public License
16 * along with this library; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18 */
19
20#ifndef __SYNTHCLONE_SAMPLESTREAM_H__
21#define __SYNTHCLONE_SAMPLESTREAM_H__
22
23#include <QtCore/QObject>
24
25#include <synthclone/types.h>
26
27namespace synthclone {
28
29 class SampleFile;
30
38 class SampleStream: public QObject {
39
40 Q_OBJECT
41
42 public:
43
53 };
54
60 enum Offset {
63 OFFSET_START = 2
64 };
65
70 enum SubType {
79
84
87
91
96
99
101 };
102
107 enum Type {
133 TYPE_XI
134 };
135
142 void
144
153 getChannels() const;
154
164
174
184
192 SubType
193 getSubType() const;
194
202 Type
203 getType() const;
204
212 bool
213 isClosed() const;
214
230 seek(SampleFrameCount frames, Offset offset);
231
232 protected:
233
234 explicit
235 SampleStream(QObject *parent=0);
236
237 virtual
239
240 SampleFile *file;
241
242 };
243
244}
245
246#endif
Base class for reading/writing Sample files.
Definition: samplestream.h:38
SampleStream(QObject *parent=0)
SampleFile * file
Definition: samplestream.h:240
SampleFrameCount seek(SampleFrameCount frames, Offset offset)
Sets the position of the stream in the sample file.
SampleChannelCount getChannels() const
Gets the channel count for the sample.
SubType
Contains format sub-types supported by sample streams.
Definition: samplestream.h:70
@ SUBTYPE_G721_32
Definition: samplestream.h:88
@ SUBTYPE_UNKNOWN
Definition: samplestream.h:71
@ SUBTYPE_ALAW
Definition: samplestream.h:81
@ SUBTYPE_VORBIS
Definition: samplestream.h:100
@ SUBTYPE_FLOAT
Definition: samplestream.h:77
@ SUBTYPE_VOX_ADPCM
Definition: samplestream.h:86
@ SUBTYPE_GSM610
Definition: samplestream.h:85
@ SUBTYPE_MS_ADPCM
Definition: samplestream.h:83
@ SUBTYPE_IMA_ADPCM
Definition: samplestream.h:82
@ SUBTYPE_DWVW_12
Definition: samplestream.h:92
@ SUBTYPE_PCM_24
Definition: samplestream.h:75
@ SUBTYPE_PCM_U8
Definition: samplestream.h:73
@ SUBTYPE_DOUBLE
Definition: samplestream.h:78
@ SUBTYPE_DWVW_16
Definition: samplestream.h:93
@ SUBTYPE_PCM_S8
Definition: samplestream.h:72
@ SUBTYPE_DPCM_16
Definition: samplestream.h:98
@ SUBTYPE_G723_40
Definition: samplestream.h:90
@ SUBTYPE_PCM_16
Definition: samplestream.h:74
@ SUBTYPE_G723_24
Definition: samplestream.h:89
@ SUBTYPE_ULAW
Definition: samplestream.h:80
@ SUBTYPE_PCM_32
Definition: samplestream.h:76
@ SUBTYPE_DWVW_N
Definition: samplestream.h:95
@ SUBTYPE_DWVW_24
Definition: samplestream.h:94
@ SUBTYPE_DPCM_8
Definition: samplestream.h:97
bool isClosed() const
Gets a boolean indicating whether or not the stream is closed.
SampleFrameCount getFrames()
Gets the total number of frames in this sample.
Type
Contains format types supported by sample streams.
Definition: samplestream.h:107
@ TYPE_WAV
Definition: samplestream.h:130
@ TYPE_HTK
Definition: samplestream.h:114
@ TYPE_OGG
Definition: samplestream.h:120
@ TYPE_SVX
Definition: samplestream.h:127
@ TYPE_AU
Definition: samplestream.h:110
@ TYPE_WVE
Definition: samplestream.h:132
@ TYPE_RF64
Definition: samplestream.h:124
@ TYPE_SD2
Definition: samplestream.h:125
@ TYPE_PAF
Definition: samplestream.h:121
@ TYPE_SDS
Definition: samplestream.h:126
@ TYPE_AIFF
Definition: samplestream.h:109
@ TYPE_MAT4
Definition: samplestream.h:116
@ TYPE_NIST
Definition: samplestream.h:119
@ TYPE_PVF
Definition: samplestream.h:122
@ TYPE_AVR
Definition: samplestream.h:111
@ TYPE_CAF
Definition: samplestream.h:112
@ TYPE_W64
Definition: samplestream.h:129
@ TYPE_UNKNOWN
Definition: samplestream.h:108
@ TYPE_XI
Definition: samplestream.h:133
@ TYPE_FLAC
Definition: samplestream.h:113
@ TYPE_RAW
Definition: samplestream.h:123
@ TYPE_MPC2K
Definition: samplestream.h:118
@ TYPE_WAVEX
Definition: samplestream.h:131
@ TYPE_IRCAM
Definition: samplestream.h:115
@ TYPE_MAT5
Definition: samplestream.h:117
@ TYPE_VOC
Definition: samplestream.h:128
EndianType
Contains format endian types supported by sample streams.
Definition: samplestream.h:48
@ ENDIANTYPE_CPU
Definition: samplestream.h:52
@ ENDIANTYPE_FILE
Definition: samplestream.h:49
@ ENDIANTYPE_BIG
Definition: samplestream.h:51
@ ENDIANTYPE_LITTLE
Definition: samplestream.h:50
EndianType getEndianType() const
Gets the format endian type of the underlying sample.
void close()
Closes the sample stream, which causes any unwritten data to be written to the sample.
Type getType() const
Gets the format type of the underlying sample.
SampleRate getSampleRate() const
Gets the sample rate for this sample.
Offset
Offsets are used to set the position of the stream using the seek() call.
Definition: samplestream.h:60
@ OFFSET_CURRENT
Definition: samplestream.h:61
@ OFFSET_END
Definition: samplestream.h:62
@ OFFSET_START
Definition: samplestream.h:63
SubType getSubType() const
Gets the format sub-type of the underlying sample.
Definition: component.h:26
quint32 SampleRate
Holds a sample rate.
Definition: types.h:96
quint16 SampleChannelCount
Holds a sample channel count.
Definition: types.h:72
qint64 SampleFrameCount
Holds a count of sample frames, or an offset with sample frames.
Definition: types.h:90