Default project when cancelling project loading (#3941)

Default project when cancelling project loading

If a user isn't aware that the loading of a project has been
cancelled, it may be in an incomplete state. Saving such a project
will overwrite the original file and result in data loss. This is
solved by loading the default project on cancelling project loading.

Add Mixer::clearNewPlayHandles() to prevent crash when cancelling
loading of a single streamed instrument.
This commit is contained in:
Oskar Wallgren
2017-11-17 02:03:49 +01:00
committed by GitHub
parent 601046aa03
commit 01265ace66
5 changed files with 48 additions and 2 deletions

View File

@@ -155,6 +155,7 @@ public:
void initDevices();
void clear();
void clearNewPlayHandles();
// audio-device-stuff

View File

@@ -33,6 +33,7 @@
#include "TrackContainer.h"
#include "Controller.h"
#include "MeterModel.h"
#include "Mixer.h"
#include "VstSyncController.h"
@@ -229,6 +230,17 @@ public:
return m_loadingProject;
}
void loadingCancelled()
{
m_isCancelled = true;
Engine::mixer()->clearNewPlayHandles();
}
bool isCancelled()
{
return m_isCancelled;
}
bool isModified() const
{
return m_modified;
@@ -358,6 +370,7 @@ private:
volatile bool m_paused;
bool m_loadingProject;
bool m_isCancelled;
QStringList m_errors;