Skip to content

Commit

Permalink
Move message box to the end
Browse files Browse the repository at this point in the history
  • Loading branch information
zonkmachine committed Jan 30, 2017
1 parent f39937d commit 5b997c9
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions src/core/SampleBuffer.cpp
Expand Up @@ -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
Expand Down Expand Up @@ -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 )
{
Expand All @@ -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
Expand Down Expand Up @@ -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 );
}
}


Expand Down

0 comments on commit 5b997c9

Please sign in to comment.