comparison transform/Transform.h @ 0:da6937383da8

initial import
author Chris Cannam
date Tue, 10 Jan 2006 16:33:16 +0000
parents
children d86891498eef
comparison
equal deleted inserted replaced
-1:000000000000 0:da6937383da8
1 /* -*- c-basic-offset: 4 -*- vi:set ts=8 sts=4 sw=4: */
2
3 /*
4 A waveform viewer and audio annotation editor.
5 Chris Cannam, Queen Mary University of London, 2005
6
7 This is experimental software. Not for distribution.
8 */
9
10 #ifndef _TRANSFORM_H_
11 #define _TRANSFORM_H_
12
13 #include <QThread>
14
15 #include "base/Model.h"
16
17 typedef QString TransformName;
18
19 /**
20 * A Transform turns one data model into another.
21 *
22 * Typically in this application, a Transform might have a
23 * DenseTimeValueModel as its input (e.g. an audio waveform) and a
24 * SparseOneDimensionalModel (e.g. detected beats) as its output.
25 *
26 * The Transform typically runs in the background, as a separate
27 * thread populating the output model. The model is available to the
28 * user of the Transform immediately, but may be initially empty until
29 * the background thread has populated it.
30 */
31
32 class Transform : public QThread
33 {
34 public:
35 virtual ~Transform();
36
37 Model *getInputModel() { return m_input; }
38 Model *getOutputModel() { return m_output; }
39 Model *detachOutputModel() { m_detached = true; return m_output; }
40
41 protected:
42 Transform(Model *m);
43
44 Model *m_input; // I don't own this
45 Model *m_output; // I own this, unless...
46 bool m_detached; // ... this is true.
47 bool m_deleting;
48 };
49
50 #endif