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:
@@ -155,6 +155,7 @@ public:
|
||||
|
||||
void initDevices();
|
||||
void clear();
|
||||
void clearNewPlayHandles();
|
||||
|
||||
|
||||
// audio-device-stuff
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user