Mercurial > hg > svcore
comparison data/model/DenseThreeDimensionalModel.h @ 152:21792a550ec9 last-cc-copyright
* Move the current DenseThreeDimensionalModel to EditableDenseThreeDimensionalModel
(wow!), and make DTDM an abstract base
* Move FFTFuzzyAdapter to FFTModel as a new subclass of DTDM
author | Chris Cannam |
---|---|
date | Mon, 31 Jul 2006 17:05:18 +0000 |
parents | 4b2ea82fd0ed |
children | 0ed2b2e26b44 |
comparison
equal
deleted
inserted
replaced
151:3c1d5ef43baa | 152:21792a550ec9 |
---|---|
27 virtual public QObject | 27 virtual public QObject |
28 { | 28 { |
29 Q_OBJECT | 29 Q_OBJECT |
30 | 30 |
31 public: | 31 public: |
32 //!!! need to reconcile terminology -- windowSize here, resolution in sparse models | |
33 DenseThreeDimensionalModel(size_t sampleRate, | |
34 size_t windowSize, | |
35 size_t yBinCount, | |
36 bool notifyOnAdd = true); | |
37 | |
38 virtual bool isOK() const; | |
39 | |
40 virtual size_t getSampleRate() const; | |
41 virtual size_t getStartFrame() const; | |
42 virtual size_t getEndFrame() const; | |
43 | |
44 virtual Model *clone() const; | |
45 | |
46 | |
47 /** | 32 /** |
48 * Return the number of sample frames covered by each set of bins. | 33 * Return the number of sample frames covered by each set of bins. |
49 */ | 34 */ |
50 virtual size_t getWindowSize() const; | 35 virtual size_t getResolution() const = 0; |
51 | |
52 /** | |
53 * Set the number of sample frames covered by each set of bins. | |
54 */ | |
55 virtual void setWindowSize(size_t sz); | |
56 | 36 |
57 /** | 37 /** |
58 * Return the number of bins in each set of bins. | 38 * Return the number of bins in each set of bins. |
59 */ | 39 */ |
60 virtual size_t getYBinCount() const; | 40 virtual size_t getYBinCount() const = 0; |
61 | |
62 /** | |
63 * Set the number of bins in each set of bins. | |
64 */ | |
65 virtual void setYBinCount(size_t sz); | |
66 | 41 |
67 /** | 42 /** |
68 * Return the minimum value of the value in each bin. | 43 * Return the minimum value of the value in each bin. |
69 */ | 44 */ |
70 virtual float getMinimumLevel() const; | 45 virtual float getMinimumLevel() const = 0; |
71 | |
72 /** | |
73 * Set the minimum value of the value in a bin. | |
74 */ | |
75 virtual void setMinimumLevel(float sz); | |
76 | 46 |
77 /** | 47 /** |
78 * Return the maximum value of the value in each bin. | 48 * Return the maximum value of the value in each bin. |
79 */ | 49 */ |
80 virtual float getMaximumLevel() const; | 50 virtual float getMaximumLevel() const = 0; |
81 | |
82 /** | |
83 * Set the maximum value of the value in a bin. | |
84 */ | |
85 virtual void setMaximumLevel(float sz); | |
86 | 51 |
87 typedef std::vector<float> BinValueSet; | 52 typedef std::vector<float> BinValueSet; |
88 | 53 |
89 /** | 54 /** |
90 * Get the set of bin values at the given sample frame (i.e. the | 55 * Get the set of bin values at the given sample frame (i.e. the |
91 * windowStartFrame/getWindowSize()'th set of bins). | 56 * windowStartFrame/getWindowSize()'th set of bins). |
92 */ | 57 */ |
93 virtual void getBinValues(long windowStartFrame, BinValueSet &result) const; | 58 virtual void getBinValues(long windowStartFrame, BinValueSet &result) const = 0; |
94 | 59 |
95 /** | 60 /** |
96 * Get a single value, the one at the n'th bin of the set of bins | 61 * Get a single value, the one at the n'th bin of the set of bins |
97 * starting at the given sample frame. | 62 * starting at the given sample frame. |
98 */ | 63 */ |
99 virtual float getBinValue(long windowStartFrame, size_t n) const; | 64 virtual float getBinValue(long windowStartFrame, size_t n) const = 0; |
100 | 65 |
101 /** | 66 virtual QString getBinName(size_t n) const = 0; |
102 * Set the entire set of bin values at the given sample frame. | |
103 */ | |
104 virtual void setBinValues(long windowStartFrame, const BinValueSet &values); | |
105 | 67 |
106 virtual QString getBinName(size_t n) const; | 68 virtual int getCompletion() const = 0; |
107 virtual void setBinName(size_t n, QString); | |
108 virtual void setBinNames(std::vector<QString> names); | |
109 | |
110 virtual void setCompletion(int completion); | |
111 virtual int getCompletion() const { return m_completion; } | |
112 | |
113 virtual void toXml(QTextStream &out, | |
114 QString indent = "", | |
115 QString extraAttributes = "") const; | |
116 | |
117 virtual QString toXmlString(QString indent = "", | |
118 QString extraAttributes = "") const; | |
119 | 69 |
120 protected: | 70 protected: |
121 typedef std::vector<BinValueSet> ValueMatrix; | 71 DenseThreeDimensionalModel() { } |
122 ValueMatrix m_data; | |
123 | |
124 std::vector<QString> m_binNames; | |
125 | |
126 size_t m_sampleRate; | |
127 size_t m_windowSize; | |
128 size_t m_yBinCount; | |
129 float m_minimum; | |
130 float m_maximum; | |
131 bool m_notifyOnAdd; | |
132 long m_sinceLastNotifyMin; | |
133 long m_sinceLastNotifyMax; | |
134 int m_completion; | |
135 | |
136 mutable QMutex m_mutex; | |
137 }; | 72 }; |
138 | 73 |
139 #endif | 74 #endif |