summaryrefslogtreecommitdiff
path: root/src/instrument.cc
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2018-06-23 09:02:37 +0200
committerBent Bisballe Nyeng <deva@aasimon.org>2018-08-12 11:11:49 +0200
commit592f05fa549c7e680e502f569c27e71177361ad6 (patch)
tree31e884348253086cdc8ce9bd1aaee938e4d74374 /src/instrument.cc
parentd6ba6aac44a2a30920be6938bb61a6ff234729f8 (diff)
Remove the old instrument and drumkit parser code as well as version 1.0 kit handling (velocity range maps).
Diffstat (limited to 'src/instrument.cc')
-rw-r--r--src/instrument.cc41
1 files changed, 7 insertions, 34 deletions
diff --git a/src/instrument.cc b/src/instrument.cc
index c1cd4aa..05ac17d 100644
--- a/src/instrument.cc
+++ b/src/instrument.cc
@@ -56,46 +56,19 @@ bool Instrument::isValid() const
Sample* Instrument::sample(level_t level, size_t pos)
{
- Sample *sample = nullptr;
-
- if(version >= VersionStr("2.0"))
- {
- // Version 2.0
- sample = powerlist.get(level * mod);
- }
- else
- {
- // Version 1.0
- std::vector<Sample*> s = samples.get(level * mod);
- if(s.size() == 0)
- {
- return nullptr;
- }
-
- sample = rand.choose(s);
- }
-
- return sample;
-}
-
-void Instrument::addSample(level_t a, level_t b, Sample* s)
-{
- samples.insert(a, b, s);
+ return powerlist.get(level * mod);
}
void Instrument::finalise()
{
- if(version >= VersionStr("2.0"))
+ std::vector<Sample*>::iterator s = samplelist.begin();
+ while(s != samplelist.end())
{
- std::vector<Sample*>::iterator s = samplelist.begin();
- while(s != samplelist.end())
- {
- powerlist.add(*s);
- s++;
- }
-
- powerlist.finalise();
+ powerlist.add(*s);
+ s++;
}
+
+ powerlist.finalise();
}
const std::string& Instrument::getName() const