From e11bdd35e69505b6aaea41751640f373c21e437e Mon Sep 17 00:00:00 2001 From: Roman Pudashkin Date: Tue, 13 Dec 2022 16:43:55 +0200 Subject: [PATCH 1/3] update selection when moving from one note to another within a single chord on a tab staff --- src/notation/internal/notationinteraction.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/notation/internal/notationinteraction.cpp b/src/notation/internal/notationinteraction.cpp index 9a85622bf4..3a7b263fe2 100644 --- a/src/notation/internal/notationinteraction.cpp +++ b/src/notation/internal/notationinteraction.cpp @@ -2709,6 +2709,18 @@ void NotationInteraction::moveStringSelection(MoveDirection d) int strg = is.string() + delta; if (strg >= 0 && strg < instrStrgs && strg != is.string()) { is.setString(strg); + + const ChordRest* chordRest = is.cr(); + if (chordRest && chordRest->isChord()) { + const Chord* chord = toChord(chordRest); + + for (Note* note : chord->notes()) { + if (note->string() == strg) { + select({ note }, SelectType::SINGLE); + } + } + } + notifyAboutNoteInputStateChanged(); } } From dae6d6ebff2df4b4308af031576041872bdeefd7 Mon Sep 17 00:00:00 2001 From: Roman Pudashkin Date: Tue, 13 Dec 2022 17:29:09 +0200 Subject: [PATCH 2/3] fix #13403 --- .../internal/notationactioncontroller.cpp | 17 ++++++++++++++++- .../internal/notationactioncontroller.h | 1 + 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/src/notation/internal/notationactioncontroller.cpp b/src/notation/internal/notationactioncontroller.cpp index 5b30bded01..8f6d92f8d4 100644 --- a/src/notation/internal/notationactioncontroller.cpp +++ b/src/notation/internal/notationactioncontroller.cpp @@ -474,7 +474,7 @@ void NotationActionController::init() registerTabPadNoteAction("pad-note-1024-TAB", Pad::NOTE1024); for (int i = 0; i < MAX_FRET; ++i) { - registerAction("fret-" + std::to_string(i), &Interaction::addFret, i, &Controller::isTablatureStaff); + registerAction("fret-" + std::to_string(i), [i, this]() { addFret(i); }, &Controller::isTablatureStaff); } // listen on state changes @@ -1140,6 +1140,17 @@ void NotationActionController::addSlur() } } +void NotationActionController::addFret(int num) +{ + auto interaction = currentNotationInteraction(); + if (!interaction) { + return; + } + + interaction->addFret(num); + playSelectedElement(currentNotationElements()->msScore()->playChord()); +} + IInteractive::Result NotationActionController::showErrorMessage(const std::string& message) const { return interactive()->info(message, @@ -1843,6 +1854,10 @@ void NotationActionController::playSelectedElement(bool playChord) } playbackController()->playElements({ element }); + + mu::engraving::Score* score = currentNotationElements()->msScore(); + score->setPlayChord(false); + score->setPlayNote(false); } void NotationActionController::startNoteInputIfNeed() diff --git a/src/notation/internal/notationactioncontroller.h b/src/notation/internal/notationactioncontroller.h index f570a817dc..d6b3e64709 100644 --- a/src/notation/internal/notationactioncontroller.h +++ b/src/notation/internal/notationactioncontroller.h @@ -108,6 +108,7 @@ private: void addTie(); void chordTie(); void addSlur(); + void addFret(int num); framework::IInteractive::Result showErrorMessage(const std::string& message) const; From 4eb6cc0e646e0b8975ee65a15cadf8aa785f2596 Mon Sep 17 00:00:00 2001 From: Roman Pudashkin Date: Tue, 13 Dec 2022 17:52:54 +0200 Subject: [PATCH 3/3] fix #14949: don't handle the Left-click release event during playback --- src/notation/view/notationviewinputcontroller.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/notation/view/notationviewinputcontroller.cpp b/src/notation/view/notationviewinputcontroller.cpp index 38f1dc299d..430804921d 100644 --- a/src/notation/view/notationviewinputcontroller.cpp +++ b/src/notation/view/notationviewinputcontroller.cpp @@ -772,7 +772,7 @@ void NotationViewInputController::mouseReleaseEvent(QMouseEvent* event) void NotationViewInputController::handleLeftClickRelease(const QPointF& releasePoint) { - if (m_view->isNoteEnterMode()) { + if (m_view->isNoteEnterMode() || playbackController()->isPlaying()) { return; }