diff options
Diffstat (limited to 'dgedit/samplesorter.cc')
-rw-r--r-- | dgedit/samplesorter.cc | 4 |
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; |