Mercurial > hg > svcore
comparison data/model/FFTModel.cpp @ 182:f75f8a1cd7b1
* Some dull work to continue unifying the fft model and editable dense 3d model
interfaces
author | Chris Cannam |
---|---|
date | Mon, 09 Oct 2006 10:49:46 +0000 |
parents | 0ed2b2e26b44 |
children | 146eb9e35baa |
comparison
equal
deleted
inserted
replaced
181:9c652f2c39b1 | 182:f75f8a1cd7b1 |
---|---|
77 { | 77 { |
78 return isOK() ? m_server->getModel()->getSampleRate() : 0; | 78 return isOK() ? m_server->getModel()->getSampleRate() : 0; |
79 } | 79 } |
80 | 80 |
81 void | 81 void |
82 FFTModel::getBinValues(long windowStartFrame, BinValueSet &result) const | 82 FFTModel::getColumn(size_t x, Column &result) const |
83 { | 83 { |
84 if (windowStartFrame < 0) windowStartFrame = 0; | |
85 size_t x = windowStartFrame / getResolution(); | |
86 result.clear(); | 84 result.clear(); |
87 size_t height(getHeight()); | 85 size_t height(getHeight()); |
88 for (size_t y = 0; y < height; ++y) { | 86 for (size_t y = 0; y < height; ++y) { |
89 result.push_back(const_cast<FFTModel *>(this)->getMagnitudeAt(x, y)); | 87 result.push_back(const_cast<FFTModel *>(this)->getMagnitudeAt(x, y)); |
90 } | 88 } |
91 } | |
92 | |
93 float | |
94 FFTModel::getBinValue(long windowStartFrame, size_t n) const | |
95 { | |
96 if (windowStartFrame < 0) windowStartFrame = 0; | |
97 size_t x = windowStartFrame / getResolution(); | |
98 return const_cast<FFTModel *>(this)->getMagnitudeAt(x, n); | |
99 } | 89 } |
100 | 90 |
101 QString | 91 QString |
102 FFTModel::getBinName(size_t n) const | 92 FFTModel::getBinName(size_t n) const |
103 { | 93 { |