summaryrefslogtreecommitdiff
path: root/dgedit/samplesorter.cc
diff options
context:
space:
mode:
authorJonas Suhr Christensen <jsc@umbraculum.org>2014-03-19 21:12:24 +0100
committerJonas Suhr Christensen <jsc@umbraculum.org>2014-03-19 21:12:24 +0100
commitc852a24fc978ca7916c0f5819bfed870a1d9519e (patch)
treea3ac7ee0fc886e0f1d361a7c4734d0b65824d7ff /dgedit/samplesorter.cc
parentaa656f19d015febb1174c0c91cb1711657280c70 (diff)
parent63bf74ffaeb5580af677719485c40fe50e248f51 (diff)
Merge branch 'master' of http://git.drumgizmo.org/drumgizmo
Diffstat (limited to 'dgedit/samplesorter.cc')
-rw-r--r--dgedit/samplesorter.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/dgedit/samplesorter.cc b/dgedit/samplesorter.cc
index adfdf65..8f857a6 100644
--- a/dgedit/samplesorter.cc
+++ b/dgedit/samplesorter.cc
@@ -139,7 +139,7 @@ void SampleSorter::resort()
QMap<int, Selection>::iterator i = _selections.begin();
while(i != _selections.end()) {
float energy = 0.0;
- Selection s = i.value();
+ Selection &s = i.value();
for(size_t idx = s.from;
(idx < (size_t)s.from + (size_t)attackLength()) &&
@@ -152,6 +152,8 @@ void SampleSorter::resort()
energy += 1; // Make sure that the key is unique.
}
+ s.energy = energy;
+
sorted[energy] = i.value();
if(energy < min) min = energy;