initial hooks

This commit is contained in:
Marc Sabatella 2013-08-02 09:39:45 -06:00
parent 9bd49722ce
commit 1ae7471be6
4 changed files with 28 additions and 10 deletions

View file

@ -1688,7 +1688,7 @@ Element* Score::move(const QString& cmd)
// retrieve last element of section list
if (!selection().elements().isEmpty())
el = selection().elements().last();
if(!el) // no element, no party!
if (!el) // no element, no party!
return 0;
// get parent of element and process accordingly:
// trg is the element to select on "next-chord" cmd
@ -1744,7 +1744,7 @@ Element* Score::move(const QString& cmd)
return trg;
}
// if no chordrest found, do nothing
if(cr == 0)
if (cr == 0)
return 0;
// if some chordrest found, continue with default processing
}
@ -1795,6 +1795,10 @@ Element* Score::move(const QString& cmd)
moveInputPos(crc->segment());
}
}
else if (cmd == "next-track")
el = downStaff(cr);
else if (cmd == "prev-track")
el = upStaff(cr);
if (el) {
if (el->type() == Element::CHORD)
el = static_cast<Chord*>(el)->downNote();

View file

@ -624,6 +624,12 @@ Shortcut Shortcut::sc[] = {
"prev-measure",
QT_TRANSLATE_NOOP("action","Previous measure")
),
Shortcut(
STATE_NORMAL | STATE_NOTE_ENTRY,
0,
"prev-track",
QT_TRANSLATE_NOOP("action","Previous staff or voice")
),
Shortcut(
STATE_NORMAL | STATE_NOTE_ENTRY,
0,
@ -636,6 +642,12 @@ Shortcut Shortcut::sc[] = {
"next-measure",
QT_TRANSLATE_NOOP("action","Next measure")
),
Shortcut(
STATE_NORMAL | STATE_NOTE_ENTRY,
0,
"next-track",
QT_TRANSLATE_NOOP("action","Next staff or voice")
),
Shortcut(
STATE_NORMAL,
0,

View file

@ -252,10 +252,6 @@
<key>pitch-up-octave</key>
<seq>Ctrl+Up</seq>
</SC>
<SC>
<key>up-chord</key>
<seq>Alt+Up</seq>
</SC>
<SC>
<key>top-chord</key>
<seq>Ctrl+Alt+Up</seq>
@ -276,10 +272,6 @@
<key>pitch-down-octave</key>
<seq>Ctrl+Down</seq>
</SC>
<SC>
<key>down-chord</key>
<seq>Alt+Down</seq>
</SC>
<SC>
<key>bottom-chord</key>
<seq>Ctrl+Alt+Down</seq>
@ -292,6 +284,10 @@
<key>prev-chord</key>
<seq>Left</seq>
</SC>
<SC>
<key>prev-track</key>
<seq>Alt+Up</seq>
</SC>
<SC>
<key>prev-measure</key>
<seq>Ctrl+Left</seq>
@ -300,6 +296,10 @@
<key>next-chord</key>
<seq>Right</seq>
</SC>
<SC>
<key>next-track</key>
<seq>Alt+Down</seq>
</SC>
<SC>
<key>next-measure</key>
<seq>Ctrl+Right</seq>

View file

@ -2498,6 +2498,8 @@ void ScoreView::cmd(const QAction* a)
}
else if (cmd == "next-chord"
|| cmd == "prev-chord"
|| cmd == "next-track"
|| cmd == "prev-track"
|| cmd == "next-measure"
|| cmd == "prev-measure") {
Element* el = score()->selection().element();