synthclone  0.3.0
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 
27 namespace synthclone {
28 
29  class SampleFile;
30 
38  class SampleStream: public QObject {
39 
40  Q_OBJECT
41 
42  public:
43 
48  enum EndianType {
53  };
54 
60  enum Offset {
64  };
65 
70  enum SubType {
79 
84 
87 
91 
96 
99 
101  };
102 
107  enum Type {
134  };
135 
142  void
143  close();
144 
153  getChannels() const;
154 
162  EndianType
163  getEndianType() const;
164 
173  getFrames();
174 
182  SampleRate
183  getSampleRate() const;
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
238  ~SampleStream();
239 
240  SampleFile *file;
241 
242  };
243 
244 }
245 
246 #endif
Definition: samplestream.h:71
Definition: samplestream.h:75
Definition: samplestream.h:86
Definition: samplestream.h:131
quint16 SampleChannelCount
Holds a sample channel count.
Definition: types.h:72
Definition: samplestream.h:51
Definition: samplestream.h:119
Definition: samplestream.h:111
Definition: samplestream.h:113
Definition: samplestream.h:94
Definition: samplestream.h:126
Definition: samplestream.h:108
Definition: samplestream.h:62
Definition: samplestream.h:118
Definition: samplestream.h:127
Definition: samplestream.h:123
Definition: samplestream.h:92
SampleFrameCount getFrames()
Gets the total number of frames in this sample.
Definition: samplestream.h:117
Definition: samplestream.h:124
SampleFrameCount seek(SampleFrameCount frames, Offset offset)
Sets the position of the stream in the sample file.
Definition: samplestream.h:128
Definition: samplestream.h:122
Definition: samplestream.h:83
Offset
Offsets are used to set the position of the stream using the seek() call.
Definition: samplestream.h:60
Definition: samplestream.h:130
Definition: samplestream.h:63
EndianType
Contains format endian types supported by sample streams.
Definition: samplestream.h:48
Definition: samplestream.h:97
Definition: component.h:26
Definition: samplestream.h:110
Definition: samplestream.h:116
Definition: samplestream.h:98
SubType getSubType() const
Gets the format sub-type of the underlying sample.
Definition: samplestream.h:77
Definition: samplestream.h:74
Definition: samplestream.h:93
Definition: samplestream.h:73
Definition: samplestream.h:85
Definition: samplestream.h:100
qint64 SampleFrameCount
Holds a count of sample frames, or an offset with sample frames.
Definition: types.h:90
Definition: samplestream.h:61
SampleFile * file
Definition: samplestream.h:240
Definition: samplestream.h:132
Definition: samplestream.h:81
SampleRate getSampleRate() const
Gets the sample rate for this sample.
EndianType getEndianType() const
Gets the format endian type of the underlying sample.
Type
Contains format types supported by sample streams.
Definition: samplestream.h:107
void close()
Closes the sample stream, which causes any unwritten data to be written to the sample.
Definition: samplestream.h:129
Definition: samplestream.h:125
Definition: samplestream.h:76
SampleStream(QObject *parent=0)
Definition: samplestream.h:112
bool isClosed() const
Gets a boolean indicating whether or not the stream is closed.
Definition: samplestream.h:78
Definition: samplestream.h:80
Definition: samplestream.h:89
quint32 SampleRate
Holds a sample rate.
Definition: types.h:96
SubType
Contains format sub-types supported by sample streams.
Definition: samplestream.h:70
Definition: samplestream.h:114
Definition: samplestream.h:88
Definition: samplestream.h:109
Base class for reading/writing Sample files.
Definition: samplestream.h:38
Definition: samplestream.h:133
Definition: samplestream.h:49
Definition: samplestream.h:121
Definition: samplestream.h:50
SampleChannelCount getChannels() const
Gets the channel count for the sample.
Definition: samplestream.h:82
Definition: samplestream.h:52
Definition: samplestream.h:95
Definition: samplestream.h:120
Definition: samplestream.h:90
Definition: samplestream.h:115
Type getType() const
Gets the format type of the underlying sample.
Definition: samplestream.h:72