synthclone 0.3.0
Loading...
Searching...
No Matches
sample.h
Go to the documentation of this file.
1/*
2 * libsynthclone - a plugin API for `synthclone`
3 * Copyright (C) 2011 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_SAMPLE_H__
21#define __SYNTHCLONE_SAMPLE_H__
22
23#include <QtCore/QObject>
24#include <QtCore/QString>
25
26namespace synthclone {
27
30
36
37 class Sample: public QObject {
38
39 Q_OBJECT
40
41 friend class SampleInputStream;
42 friend class SampleOutputStream;
43
44 public:
45
59
60 explicit
61 Sample(bool temporary=true, QObject *parent=0);
62
78
79 explicit
80 Sample(const QString &path, bool temporary=false, QObject *parent=0);
81
97
98 explicit
99 Sample(const Sample &sample, bool temporary=true, QObject *parent=0);
100
118
119 Sample(const Sample &sample, const QString &path, bool temporary=false,
120 QObject *parent=0);
121
126
128
135
136 QString
137 getPath() const;
138
146
147 bool
148 isTemporary() const;
149
150 public slots:
151
159
160 void
161 setTemporary(bool temporary);
162
163 signals:
164
171
172 void
173 temporaryChanged(bool temporary);
174
175 private:
176
177 void
178 initializeData(const Sample &sample);
179
180 void
181 initializeTemporaryPath();
182
183 QString path;
184 bool temporary;
185
186 };
187
188}
189
190#endif
Used to read sample data from a sample file.
Definition sampleinputstream.h:34
Used to write sample data to a sample file.
Definition sampleoutputstream.h:34
friend class SampleInputStream
Definition sample.h:41
Sample(const Sample &sample, const QString &path, bool temporary=false, QObject *parent=0)
Initializes a sample object.
Sample(bool temporary=true, QObject *parent=0)
Initializes an empty sample object.
void setTemporary(bool temporary)
Sets a boolean indicating whether or not the file referenced by this object will be deleted when this...
bool isTemporary() const
Returns a boolean indicating whether or not the file referenced by this object will be deleted when t...
QString getPath() const
Gets the path to the file holding this sample.
friend class SampleOutputStream
Definition sample.h:42
Sample(const QString &path, bool temporary=false, QObject *parent=0)
Initializes a sample object.
~Sample()
If the file linked to this sample object is a temporary file, then the temporary file is deleted.
Sample(const Sample &sample, bool temporary=true, QObject *parent=0)
Initializes a sample object.
void temporaryChanged(bool temporary)
Emitted when the temporary flag changes.
Definition component.h:26