Mercurial > hg > tony
changeset 269:8eb167e817e7
Remove any pitch candidate layers and selections before saving session
author | Chris Cannam |
---|---|
date | Thu, 03 Apr 2014 09:04:33 +0100 |
parents | 577101c9fdb7 |
children | e33aa832e766 |
files | src/Analyser.cpp src/Analyser.h src/MainWindow.cpp |
diffstat | 3 files changed, 19 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/src/Analyser.cpp Thu Apr 03 08:51:30 2014 +0100 +++ b/src/Analyser.cpp Thu Apr 03 09:04:33 2014 +0100 @@ -605,6 +605,12 @@ } void +Analyser::clearReAnalysis() +{ + discardPitchCandidates(); +} + +void Analyser::discardPitchCandidates() { if (!m_reAnalysisCandidates.empty()) {
--- a/src/Analyser.h Thu Apr 03 08:51:30 2014 +0100 +++ b/src/Analyser.h Thu Apr 03 09:04:33 2014 +0100 @@ -180,6 +180,14 @@ void abandonReAnalysis(Selection sel); /** + * Remove any re-analysis layers, without any expectation of + * adding them later, unlike showPitchCandidates(false), and + * without changing the current pitch track, unlike + * abandonReAnalysis(). + */ + void clearReAnalysis(); + + /** * Import the pitch track from the given layer into our * pitch-track layer. */
--- a/src/MainWindow.cpp Thu Apr 03 08:51:30 2014 +0100 +++ b/src/MainWindow.cpp Thu Apr 03 09:04:33 2014 +0100 @@ -1685,6 +1685,11 @@ void MainWindow::saveSession() { + // We do not want to save mid-analysis regions -- that would cause + // confusion on reloading + m_analyser->clearReAnalysis(); + clearSelection(); + if (m_sessionFile != "") { if (!saveSessionFile(m_sessionFile)) { QMessageBox::critical