From a673a209a71b06488df3244903b5b4b7f994451d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Nusser?= Date: Wed, 6 Mar 2019 09:54:29 +0100 Subject: Split sample selection into own class. --- src/powerlist.h | 26 +++++++++----------------- 1 file changed, 9 insertions(+), 17 deletions(-) (limited to 'src/powerlist.h') diff --git a/src/powerlist.h b/src/powerlist.h index b3b47e4..000da15 100644 --- a/src/powerlist.h +++ b/src/powerlist.h @@ -30,38 +30,30 @@ #include "sample.h" -class Random; -struct Settings; +struct PowerListItem +{ + Sample* sample; + float power; +}; +using PowerListItems = std::vector; class PowerList { public: - PowerList(Random& rand, Settings& settings); + PowerList(); void add(Sample* s); void finalise(); ///< Call this when no more samples will be added. - Sample* get(level_t velocity, std::size_t pos); + const PowerListItems& getPowerListItems() const; float getMaxPower() const; float getMinPower() const; private: - struct PowerListItem - { - Sample* sample; - float power; - }; - - Random& rand; - Settings& settings; - - std::vector samples; + PowerListItems samples; float power_max; float power_min; const Channel* getMasterChannel(); - Sample* lastsample; - - std::vector last; }; -- cgit v1.2.3