summaryrefslogtreecommitdiff
path: root/src/powerlist.h
diff options
context:
space:
mode:
authorAndré Nusser <andre.nusser@googlemail.com>2019-03-06 09:54:29 +0100
committerAndré Nusser <andre.nusser@googlemail.com>2019-05-11 14:54:51 +0200
commita673a209a71b06488df3244903b5b4b7f994451d (patch)
tree61403df77a0916d52ec1631b515422bfd1082f92 /src/powerlist.h
parent1965889ac953b354763f194cd7ec44932942477d (diff)
Split sample selection into own class.
Diffstat (limited to 'src/powerlist.h')
-rw-r--r--src/powerlist.h26
1 files changed, 9 insertions, 17 deletions
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<PowerListItem>;
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<PowerListItem> samples;
+ PowerListItems samples;
float power_max;
float power_min;
const Channel* getMasterChannel();
- Sample* lastsample;
-
- std::vector<std::size_t> last;
};