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@179
|
25 class DenseThreeDimensionalModel : public Model
|
Chris@147
|
26 {
|
Chris@147
|
27 Q_OBJECT
|
Chris@147
|
28
|
Chris@147
|
29 public:
|
Chris@147
|
30 /**
|
Chris@147
|
31 * Return the number of sample frames covered by each set of bins.
|
Chris@147
|
32 */
|
Chris@152
|
33 virtual size_t getResolution() const = 0;
|
Chris@147
|
34
|
Chris@147
|
35 /**
|
Chris@147
|
36 * Return the number of bins in each set of bins.
|
Chris@147
|
37 */
|
Chris@152
|
38 virtual size_t getYBinCount() const = 0;
|
Chris@147
|
39
|
Chris@147
|
40 /**
|
Chris@147
|
41 * Return the minimum value of the value in each bin.
|
Chris@147
|
42 */
|
Chris@152
|
43 virtual float getMinimumLevel() const = 0;
|
Chris@147
|
44
|
Chris@147
|
45 /**
|
Chris@147
|
46 * Return the maximum value of the value in each bin.
|
Chris@147
|
47 */
|
Chris@152
|
48 virtual float getMaximumLevel() const = 0;
|
Chris@147
|
49
|
Chris@147
|
50 typedef std::vector<float> BinValueSet;
|
Chris@147
|
51
|
Chris@147
|
52 /**
|
Chris@147
|
53 * Get the set of bin values at the given sample frame (i.e. the
|
Chris@147
|
54 * windowStartFrame/getWindowSize()'th set of bins).
|
Chris@147
|
55 */
|
Chris@152
|
56 virtual void getBinValues(long windowStartFrame, BinValueSet &result) const = 0;
|
Chris@147
|
57
|
Chris@147
|
58 /**
|
Chris@147
|
59 * Get a single value, the one at the n'th bin of the set of bins
|
Chris@147
|
60 * starting at the given sample frame.
|
Chris@147
|
61 */
|
Chris@152
|
62 virtual float getBinValue(long windowStartFrame, size_t n) const = 0;
|
Chris@147
|
63
|
Chris@152
|
64 virtual QString getBinName(size_t n) const = 0;
|
Chris@147
|
65
|
Chris@152
|
66 virtual int getCompletion() const = 0;
|
Chris@147
|
67
|
Chris@147
|
68 protected:
|
Chris@152
|
69 DenseThreeDimensionalModel() { }
|
Chris@147
|
70 };
|
Chris@147
|
71
|
Chris@147
|
72 #endif
|