Mercurial > hg > svcore
diff data/model/FFTModel.cpp @ 533:55ad231c9db7
* try some qvectors
author | Chris Cannam |
---|---|
date | Thu, 22 Jan 2009 17:58:33 +0000 |
parents | 6066bde1c126 |
children | 408e56d30f58 |
line wrap: on
line diff
--- a/data/model/FFTModel.cpp Thu Jan 22 17:39:04 2009 +0000 +++ b/data/model/FFTModel.cpp Thu Jan 22 17:58:33 2009 +0000 @@ -161,11 +161,13 @@ return isOK() ? m_server->getModel()->getSampleRate() : 0; } -void -FFTModel::getColumn(size_t x, Column &result) const +FFTModel::Column +FFTModel::getColumn(size_t x) const { Profiler profiler("FFTModel::getColumn", false); + Column result; + result.clear(); size_t h = getHeight(); result.reserve(h); @@ -181,6 +183,8 @@ } else { for (size_t i = 0; i < h; ++i) result.push_back(0.f); } + + return result; } QString @@ -261,7 +265,7 @@ return peaks; } - getColumn(x, values); + values = getColumn(x); float mean = 0.f; for (int i =0; i < values.size(); ++i) mean += values[i];