Mercurial > hg > svcore
changeset 1194:238780e92f86 spectrogram-minor-refactor
Toward updating mag cache
author | Chris Cannam |
---|---|
date | Wed, 20 Jul 2016 13:40:23 +0100 |
parents | 927d329252bf |
children | c118d2022ffa |
files | base/MagnitudeRange.h |
diffstat | 1 files changed, 12 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/base/MagnitudeRange.h Thu Jul 14 16:12:05 2016 +0100 +++ b/base/MagnitudeRange.h Wed Jul 20 13:40:23 2016 +0100 @@ -16,6 +16,8 @@ #ifndef MAGNITUDE_RANGE_H #define MAGNITUDE_RANGE_H +#include <vector> + /** * Maintain a min and max value, and update them when supplied a new * data point. @@ -43,7 +45,16 @@ changed = true; } return changed; - } + } + bool sample(const std::vector<float> &ff) { + bool changed = false; + for (auto f: ff) { + if (sample(f)) { + changed = true; + } + } + return changed; + } bool sample(const MagnitudeRange &r) { bool changed = false; if (isSet()) {