diff --git a/mscore/data/icons/edit-playback.svg b/mscore/data/icons/edit-playback.svg new file mode 100644 index 0000000000000..5b2e1da0fcbde --- /dev/null +++ b/mscore/data/icons/edit-playback.svg @@ -0,0 +1,50 @@ + + + + + + + + + diff --git a/mscore/icons.cpp b/mscore/icons.cpp index a56582cd0c2cb..d04855ae27017 100644 --- a/mscore/icons.cpp +++ b/mscore/icons.cpp @@ -63,6 +63,7 @@ static const char* iconNames[] = { "note-dot4.svg", "stem-flip.svg", "mouse-entry.svg", + "edit-playback.svg", "edit-undo.svg", "edit-redo.svg", "edit-cut.svg", diff --git a/mscore/icons.h b/mscore/icons.h index 58dc988976e4e..ac8cc4489263b 100644 --- a/mscore/icons.h +++ b/mscore/icons.h @@ -30,7 +30,7 @@ enum class Icons : short { Invalid_ICON = -1, note32_ICON, note64_ICON, note128_ICON, note256_ICON, note512_ICON, note1024_ICON, natural_ICON, sharp_ICON, sharpsharp_ICON, flat_ICON, flatflat_ICON, quartrest_ICON, dot_ICON, dotdot_ICON, dot3_ICON, dot4_ICON, - flip_ICON, mouseEntry_ICON, + flip_ICON, mouseEntry_ICON, editPlayback_ICON, undo_ICON, redo_ICON, cut_ICON, copy_ICON, paste_ICON, swap_ICON, print_ICON, clef_ICON, midiin_ICON, speaker_ICON, start_ICON, play_ICON, repeat_ICON, pan_ICON, sbeam_ICON, mbeam_ICON, nbeam_ICON, beam32_ICON, beam64_ICON, abeam_ICON, fbeam1_ICON, fbeam2_ICON, diff --git a/mscore/musescore.cpp b/mscore/musescore.cpp index 27cdbb615dfec..313c3c8d564f3 100644 --- a/mscore/musescore.cpp +++ b/mscore/musescore.cpp @@ -266,6 +266,7 @@ const std::list MuseScore::_allNoteInputMenuEntries { "flat2", "flip", "toggle-mouse-entry", + "toggle-edit-playback", "", "voice-1", "voice-2", @@ -481,6 +482,7 @@ void MuseScore::preferencesChanged(bool fromWorkspace, bool changeUI) getAction("midi-on")->setChecked(preferences.getBool(PREF_IO_MIDI_ENABLEINPUT)); getAction("toggle-statusbar")->setChecked(preferences.getBool(PREF_UI_APP_SHOWSTATUSBAR)); getAction("show-tours")->setChecked(preferences.getBool(PREF_UI_APP_STARTUP_SHOWTOURS)); + getAction("toggle-edit-playback")->setChecked(preferences.getBool(PREF_SCORE_NOTE_PLAYONCLICK)); _statusBar->setVisible(preferences.getBool(PREF_UI_APP_SHOWSTATUSBAR)); if (!cs) @@ -1336,6 +1338,8 @@ MuseScore::MuseScore() populateNoteInputMenu(); + getAction("toggle-edit-playback")->setChecked(preferences.getBool(PREF_SCORE_NOTE_PLAYONCLICK)); + //------------------------------- // Workspaces Tool Bar //------------------------------- diff --git a/mscore/musescore.qrc b/mscore/musescore.qrc index 07596e7c4177c..1016b6e5ddba4 100644 --- a/mscore/musescore.qrc +++ b/mscore/musescore.qrc @@ -217,5 +217,6 @@ data/icons/png/dockwidget-float.png data/icons/png/dockwidget-float@2x.png data/icons/mouse-entry.svg + data/icons/edit-playback.svg diff --git a/mscore/scoreview.cpp b/mscore/scoreview.cpp index 976e308e1deba..58bfc2be2be85 100644 --- a/mscore/scoreview.cpp +++ b/mscore/scoreview.cpp @@ -2866,6 +2866,11 @@ void ScoreView::cmd(const char* s) cv->score()->endCmd(); } }}, + {{"toggle-edit-playback"}, [](ScoreView* /*cv*/, const QByteArray&) { + + bool value = preferences.getBool(PREF_SCORE_NOTE_PLAYONCLICK); + preferences.setPreference(PREF_SCORE_NOTE_PLAYONCLICK, !value); + }}, }; auto c = std::find_if(cmdList.begin(), cmdList.end(), [cmd](const ScoreViewCmd& cc) { diff --git a/mscore/shortcut.cpp b/mscore/shortcut.cpp index 9dc9f8f167937..6847ae66f3682 100644 --- a/mscore/shortcut.cpp +++ b/mscore/shortcut.cpp @@ -1945,6 +1945,17 @@ Shortcut Shortcut::_sc[] = { Qt::WindowShortcut, ShortcutFlags::A_CHECKABLE }, + { + MsWidget::SCORE_TAB, + STATE_NORMAL | STATE_NOTE_ENTRY, + "toggle-edit-playback", + QT_TRANSLATE_NOOP("action","Toggle editing sound playback"), + QT_TRANSLATE_NOOP("action","Toggle editing sound playback"), + 0, + Icons::editPlayback_ICON, + Qt::WindowShortcut, + ShortcutFlags::A_CHECKABLE + }, { MsWidget::MAIN_WINDOW, STATE_NORMAL | STATE_NOTE_ENTRY,