summaryrefslogtreecommitdiff
path: root/dgedit/samplesorter.cc
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2014-03-19 21:04:47 +0100
committerBent Bisballe Nyeng <deva@aasimon.org>2014-03-19 21:04:47 +0100
commit63bf74ffaeb5580af677719485c40fe50e248f51 (patch)
tree9ad5c79bd6b14204bc347af4166aed681e0d62a5 /dgedit/samplesorter.cc
parented54ecfc42371545ea438c21ba4d736cdd6f15ff (diff)
Make editor store calculated sample energies in the xml files.
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;