implemented resequence-rehearsal-marks action

This commit is contained in:
RomanPudashkin 2021-02-25 16:15:29 +02:00
parent 73e85b3dde
commit 46833b89bd
7 changed files with 29 additions and 1 deletions

View file

@ -332,7 +332,7 @@ MenuItem AppMenuModel::toolsItem()
makeSeparator(),
makeAction("pitch-spell"),
makeAction("reset-groupings"),
makeAction("resequence-rehearsal-marks"), // need implement
makeAction("resequence-rehearsal-marks"),
makeAction("unroll-repeats"), // need implement
makeSeparator(),
makeAction("copy-lyrics-to-clipboard"), // need implement

View file

@ -131,6 +131,7 @@ public:
virtual void spellPitches() = 0;
virtual void regroupNotesAndRests() = 0;
virtual void resequenceRehearsalMarks() = 0;
virtual void resetToDefault(ResettableValueType type) = 0;

View file

@ -216,6 +216,7 @@ void NotationActionController::init()
dispatcher()->reg(this, "slash-rhythm", this, &NotationActionController::replaceSelectedNotesWithSlashes);
dispatcher()->reg(this, "pitch-spell", this, &NotationActionController::spellPitches);
dispatcher()->reg(this, "reset-groupings", this, &NotationActionController::regroupNotesAndRests);
dispatcher()->reg(this, "resequence-rehearsal-marks", this, &NotationActionController::resequenceRehearsalMarks);
for (int i = MIN_NOTES_INTERVAL; i <= MAX_NOTES_INTERVAL; ++i) {
if (isNotesIntervalValid(i)) {
@ -994,6 +995,16 @@ void NotationActionController::regroupNotesAndRests()
interaction->regroupNotesAndRests();
}
void NotationActionController::resequenceRehearsalMarks()
{
auto interaction = currentNotationInteraction();
if (!interaction) {
return;
}
interaction->resequenceRehearsalMarks();
}
void NotationActionController::addStretch(qreal value)
{
auto interaction = currentNotationInteraction();

View file

@ -110,6 +110,7 @@ private:
void replaceSelectedNotesWithSlashes();
void spellPitches();
void regroupNotesAndRests();
void resequenceRehearsalMarks();
void resetState();
void resetStretch();

View file

@ -219,6 +219,11 @@ const ActionList NotationActions::m_actions = {
QT_TRANSLATE_NOOP("action", "Regroup Rhythms"),
QT_TRANSLATE_NOOP("action", "Combine rests and tied notes from selection and resplit at rhythmical")
),
ActionItem("resequence-rehearsal-marks",
ShortcutContext::NotationActive,
QT_TRANSLATE_NOOP("action", "Resequence Rehearsal Marks"),
QT_TRANSLATE_NOOP("action", "Resequence rehearsal marks")
),
ActionItem("parts",
ShortcutContext::NotationActive,
QT_TRANSLATE_NOOP("action", "Parts"),

View file

@ -2458,6 +2458,15 @@ void NotationInteraction::regroupNotesAndRests()
notifyAboutNotationChanged();
}
void NotationInteraction::resequenceRehearsalMarks()
{
startEdit();
score()->cmdResequenceRehearsalMarks();
apply();
notifyAboutNotationChanged();
}
void NotationInteraction::resetToDefault(ResettableValueType type)
{
switch (type) {

View file

@ -148,6 +148,7 @@ public:
void spellPitches() override;
void regroupNotesAndRests() override;
void resequenceRehearsalMarks() override;
void resetToDefault(ResettableValueType type) override;