Skip to content

Commit

Permalink
Don't reload sample from disk when reversing (LMMS#5701)
Browse files Browse the repository at this point in the history
  • Loading branch information
DomClark authored Oct 7, 2020
1 parent ca34809 commit 81dcd2f
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/core/SampleBuffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@

#include "SampleBuffer.h"

#include <algorithm>

#include <QBuffer>
#include <QFile>
#include <QFileInfo>
Expand Down Expand Up @@ -1411,8 +1413,13 @@ void SampleBuffer::setAmplification( float _a )

void SampleBuffer::setReversed( bool _on )
{
Engine::mixer()->requestChangeInModel();
m_varLock.lockForWrite();
if (m_reversed != _on) { std::reverse(m_data, m_data + m_frames); }
m_reversed = _on;
update( true );
m_varLock.unlock();
Engine::mixer()->doneChangeInModel();
emit sampleUpdated();
}


Expand Down

0 comments on commit 81dcd2f

Please sign in to comment.