diff --git a/include/Editor.h b/include/Editor.h index 1c80e9f2f..454ec4d3e 100644 --- a/include/Editor.h +++ b/include/Editor.h @@ -58,6 +58,9 @@ protected slots: private slots: /// Called by pressing the space key. Plays or stops. void togglePlayStop(); + + /// Called by pressing shift+space. Toggles pause state. + void togglePause(); signals: diff --git a/src/gui/editors/Editor.cpp b/src/gui/editors/Editor.cpp index c27eda4c0..00a659d07 100644 --- a/src/gui/editors/Editor.cpp +++ b/src/gui/editors/Editor.cpp @@ -74,6 +74,11 @@ void Editor::togglePlayStop() play(); } +void Editor::togglePause() +{ + Engine::getSong()->togglePause(); +} + Editor::Editor(bool record, bool stepRecord) : m_toolBar(new DropToolBar(this)), m_playAction(nullptr), @@ -104,6 +109,7 @@ Editor::Editor(bool record, bool stepRecord) : connect(m_toggleStepRecordingAction, SIGNAL(triggered()), this, SLOT(toggleStepRecording())); connect(m_stopAction, SIGNAL(triggered()), this, SLOT(stop())); new QShortcut(Qt::Key_Space, this, SLOT(togglePlayStop())); + new QShortcut(QKeySequence(Qt::SHIFT + Qt::Key_Space), this, SLOT(togglePause())); // Add actions to toolbar addButton(m_playAction, "playButton");