From 192119621f1d321ac3eb853ec5ba54a1b3ba67e6 Mon Sep 17 00:00:00 2001 From: dev Date: Wed, 10 Mar 2021 13:33:31 +0530 Subject: [PATCH] Save Piano Roll behaviour at stop state --- include/TimeLineWidget.h | 5 +++++ src/gui/editors/PianoRoll.cpp | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/include/TimeLineWidget.h b/include/TimeLineWidget.h index 0f9b1e23a..061a31081 100644 --- a/include/TimeLineWidget.h +++ b/include/TimeLineWidget.h @@ -121,6 +121,11 @@ public: return m_behaviourAtStop; } + void setBehaviourAtStop (int state) + { + emit loadBehaviourAtStop (state); + } + bool loopPointsEnabled() const { return m_loopPoints == LoopPointsEnabled; diff --git a/src/gui/editors/PianoRoll.cpp b/src/gui/editors/PianoRoll.cpp index 5f294d6e8..1dbbe1cf4 100644 --- a/src/gui/editors/PianoRoll.cpp +++ b/src/gui/editors/PianoRoll.cpp @@ -5180,6 +5180,8 @@ void PianoRollWindow::saveSettings( QDomDocument & doc, QDomElement & de ) de.appendChild(markedSemiTonesRoot); } + de.setAttribute("stopbehaviour", m_editor->m_timeLine->behaviourAtStop()); + MainWindow::saveWidgetState( this, de ); } @@ -5193,6 +5195,8 @@ void PianoRollWindow::loadSettings( const QDomElement & de ) MainWindow::restoreWidgetState( this, de ); + m_editor->m_timeLine->setBehaviourAtStop(de.attribute("stopbehaviour").toInt()); + // update margins here because we're later in the startup process // We can't earlier because everything is still starting with the // WHITE_KEY_WIDTH default