MainWindow: skip autosave while playing or exporting

It's a very bad idea to autosave while playing as this causes severe
underrun problems. Therefore instead of autosaving, trigger a re-try
timer for 10 seconds.

Closes #3317776.
This commit is contained in:
Tobias Doerffel
2011-06-22 11:15:20 +02:00
parent 34e61f0ea3
commit 66d36b3071

View File

@@ -1047,8 +1047,17 @@ void MainWindow::browseHelp( void )
void MainWindow::autoSave()
{
QDir work(configManager::inst()->workingDir());
engine::getSong()->saveProjectFile(work.absoluteFilePath("recover.mmp"));
if( !( engine::getSong()->isPlaying() ||
engine::getSong()->isExporting() ) )
{
QDir work(configManager::inst()->workingDir());
engine::getSong()->saveProjectFile(work.absoluteFilePath("recover.mmp"));
}
else
{
// try again in 10 seconds
QTimer::singleShot( 10*1000, this, SLOT( autoSave() ) );
}
}