This commit is contained in:
Roman Pudashkin 2022-12-13 17:29:09 +02:00
parent e11bdd35e6
commit dae6d6ebff
2 changed files with 17 additions and 1 deletions

View file

@ -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()

View file

@ -108,6 +108,7 @@ private:
void addTie();
void chordTie();
void addSlur();
void addFret(int num);
framework::IInteractive::Result showErrorMessage(const std::string& message) const;