From 5b997c9fd45338b7a53db1233058514fe0bb6bce Mon Sep 17 00:00:00 2001 From: Oskar Wallgren Date: Mon, 30 Jan 2017 12:24:47 +0100 Subject: [PATCH] Move message box to the end --- src/core/SampleBuffer.cpp | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/core/SampleBuffer.cpp b/src/core/SampleBuffer.cpp index 8227a8f3d63..041cbfc55ec 100644 --- a/src/core/SampleBuffer.cpp +++ b/src/core/SampleBuffer.cpp @@ -173,6 +173,7 @@ void SampleBuffer::update( bool _keep_settings ) MM_FREE( m_data ); } + bool fileLoadError = false; if( m_audioFile.isEmpty() && m_origData != NULL && m_origFrames > 0 ) { // TODO: reverse- and amplification-property is not covered @@ -200,7 +201,6 @@ void SampleBuffer::update( bool _keep_settings ) sample_rate_t samplerate = Engine::mixer()->baseSampleRate(); m_frames = 0; - bool fileLoadError = false; const QFileInfo fileInfo( file ); if( fileInfo.size() > 100*1024*1024 ) { @@ -223,15 +223,7 @@ void SampleBuffer::update( bool _keep_settings ) } } - if( fileLoadError ) - { - QMessageBox::information( NULL, - "Fail to open file", - "Audio files are limited to 100 MB " - "in size and 1 hour of playing time", - QMessageBox::Ok ); - } - else + if( ! fileLoadError ) { #ifdef LMMS_HAVE_OGGVORBIS // workaround for a bug in libsndfile or our libsndfile decoder @@ -294,8 +286,16 @@ void SampleBuffer::update( bool _keep_settings ) m_varLock.unlock(); Engine::mixer()->doneChangeInModel(); } - emit sampleUpdated(); + + if( fileLoadError ) + { + QMessageBox::information( NULL, + "Fail to open file", + "Audio files are limited to 100 MB " + "in size and 1 hour of playing time", + QMessageBox::Ok ); + } }