comparison data/model/DenseTimeValueModel.h @ 147:3a13b0d4934e

* Reorganising code base. This revision will not compile.
author Chris Cannam
date Mon, 31 Jul 2006 11:44:37 +0000
parents
children 4b2ea82fd0ed
comparison
equal deleted inserted replaced
146:f90fad823cea 147:3a13b0d4934e
1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
2
3 /*
4 Sonic Visualiser
5 An audio file viewer and annotation editor.
6 Centre for Digital Music, Queen Mary, University of London.
7 This file copyright 2006 Chris Cannam.
8
9 This program is free software; you can redistribute it and/or
10 modify it under the terms of the GNU General Public License as
11 published by the Free Software Foundation; either version 2 of the
12 License, or (at your option) any later version. See the file
13 COPYING included with this distribution for more information.
14 */
15
16 #ifndef _DENSE_TIME_VALUE_MODEL_H_
17 #define _DENSE_TIME_VALUE_MODEL_H_
18
19 #include <QObject>
20
21 #include "base/Model.h"
22
23 /**
24 * Base class for models containing dense two-dimensional data (value
25 * against time). For example, audio waveform data.
26 */
27
28 class DenseTimeValueModel : public Model,
29 virtual public QObject
30 {
31 Q_OBJECT
32
33 public:
34 DenseTimeValueModel();
35
36 /**
37 * Return the minimum possible value found in this model type.
38 * (That is, the minimum that would be valid, not the minimum
39 * actually found in a particular model).
40 */
41 virtual float getValueMinimum() const = 0;
42
43 /**
44 * Return the minimum possible value found in this model type.
45 * (That is, the minimum that would be valid, not the minimum
46 * actually found in a particular model).
47 */
48 virtual float getValueMaximum() const = 0;
49
50 /**
51 * Return the number of distinct channels for this model.
52 */
53 virtual size_t getChannelCount() const = 0;
54
55 /**
56 * Get the specified set of samples from the given channel of the
57 * model in single-precision floating-point format. Return the
58 * number of samples actually retrieved.
59 * If the channel is given as -1, mix all available channels and
60 * return the result.
61 */
62 virtual size_t getValues(int channel, size_t start, size_t end,
63 float *buffer) const = 0;
64
65 /**
66 * Get the specified set of samples from the given channel of the
67 * model in double-precision floating-point format. Return the
68 * number of samples actually retrieved.
69 * If the channel is given as -1, mix all available channels and
70 * return the result.
71 */
72 virtual size_t getValues(int channel, size_t start, size_t end,
73 double *buffer) const = 0;
74 };
75
76 #endif