Chris@147
|
1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
|
Chris@147
|
2
|
Chris@147
|
3 /*
|
Chris@147
|
4 Sonic Visualiser
|
Chris@147
|
5 An audio file viewer and annotation editor.
|
Chris@147
|
6 Centre for Digital Music, Queen Mary, University of London.
|
Chris@147
|
7 This file copyright 2006 Chris Cannam.
|
Chris@147
|
8
|
Chris@147
|
9 This program is free software; you can redistribute it and/or
|
Chris@147
|
10 modify it under the terms of the GNU General Public License as
|
Chris@147
|
11 published by the Free Software Foundation; either version 2 of the
|
Chris@147
|
12 License, or (at your option) any later version. See the file
|
Chris@147
|
13 COPYING included with this distribution for more information.
|
Chris@147
|
14 */
|
Chris@147
|
15
|
Chris@147
|
16 #ifndef _DENSE_THREE_DIMENSIONAL_MODEL_H_
|
Chris@147
|
17 #define _DENSE_THREE_DIMENSIONAL_MODEL_H_
|
Chris@147
|
18
|
Chris@150
|
19 #include "Model.h"
|
Chris@147
|
20 #include "base/ZoomConstraint.h"
|
Chris@147
|
21
|
Chris@147
|
22 #include <QMutex>
|
Chris@147
|
23 #include <vector>
|
Chris@147
|
24
|
Chris@147
|
25 class DenseThreeDimensionalModel : public Model,
|
Chris@147
|
26 virtual public ZoomConstraint,
|
Chris@147
|
27 virtual public QObject
|
Chris@147
|
28 {
|
Chris@147
|
29 Q_OBJECT
|
Chris@147
|
30
|
Chris@147
|
31 public:
|
Chris@147
|
32 /**
|
Chris@147
|
33 * Return the number of sample frames covered by each set of bins.
|
Chris@147
|
34 */
|
Chris@152
|
35 virtual size_t getResolution() const = 0;
|
Chris@147
|
36
|
Chris@147
|
37 /**
|
Chris@147
|
38 * Return the number of bins in each set of bins.
|
Chris@147
|
39 */
|
Chris@152
|
40 virtual size_t getYBinCount() const = 0;
|
Chris@147
|
41
|
Chris@147
|
42 /**
|
Chris@147
|
43 * Return the minimum value of the value in each bin.
|
Chris@147
|
44 */
|
Chris@152
|
45 virtual float getMinimumLevel() const = 0;
|
Chris@147
|
46
|
Chris@147
|
47 /**
|
Chris@147
|
48 * Return the maximum value of the value in each bin.
|
Chris@147
|
49 */
|
Chris@152
|
50 virtual float getMaximumLevel() const = 0;
|
Chris@147
|
51
|
Chris@147
|
52 typedef std::vector<float> BinValueSet;
|
Chris@147
|
53
|
Chris@147
|
54 /**
|
Chris@147
|
55 * Get the set of bin values at the given sample frame (i.e. the
|
Chris@147
|
56 * windowStartFrame/getWindowSize()'th set of bins).
|
Chris@147
|
57 */
|
Chris@152
|
58 virtual void getBinValues(long windowStartFrame, BinValueSet &result) const = 0;
|
Chris@147
|
59
|
Chris@147
|
60 /**
|
Chris@147
|
61 * Get a single value, the one at the n'th bin of the set of bins
|
Chris@147
|
62 * starting at the given sample frame.
|
Chris@147
|
63 */
|
Chris@152
|
64 virtual float getBinValue(long windowStartFrame, size_t n) const = 0;
|
Chris@147
|
65
|
Chris@152
|
66 virtual QString getBinName(size_t n) const = 0;
|
Chris@147
|
67
|
Chris@152
|
68 virtual int getCompletion() const = 0;
|
Chris@147
|
69
|
Chris@147
|
70 protected:
|
Chris@152
|
71 DenseThreeDimensionalModel() { }
|
Chris@147
|
72 };
|
Chris@147
|
73
|
Chris@147
|
74 #endif
|