Skip to content

Commit

Permalink
Adds more actions and shortcuts:
Browse files Browse the repository at this point in the history
*) new shortcuts for increase/decrease note pad value
*) HARMONY/FIGBASS: shortcuts for 'measured' advances
*) HARMONY/FIGBASS: shortcuts for jump to prev/next measure
*) HARMONY: shortcuts for jump to prev/next beat

*) Allow to combine shortcuts for TAB frets > 9 (for instance, use "fret-1" "fret-0" shortcuts to generate a fret '10')
  • Loading branch information
Maurizio M. Gavioli committed Mar 28, 2013
1 parent 2f265da commit afad87a
Show file tree
Hide file tree
Showing 6 changed files with 365 additions and 70 deletions.
74 changes: 74 additions & 0 deletions libmscore/cmd.cpp
Expand Up @@ -2183,6 +2183,80 @@ void Score::cmd(const QAction* a)
padToggle(PAD_NOTE64);
else if (cmd == "pad-note-128")
padToggle(PAD_NOTE128);
else if (cmd == "pad-note-increase") {
switch (_is.duration().type() ) {
// cycle back from longest to shortest?
// case TDuration::V_LONG:
// padToggle(PAD_NOTE128);
// break;
case TDuration::V_BREVE:
padToggle(PAD_NOTE00);
break;
case TDuration::V_WHOLE:
padToggle(PAD_NOTE0);
break;
case TDuration::V_HALF:
padToggle(PAD_NOTE1);
break;
case TDuration::V_QUARTER:
padToggle(PAD_NOTE2);
break;
case TDuration::V_EIGHT:
padToggle(PAD_NOTE4);
break;
case TDuration::V_16TH:
padToggle(PAD_NOTE8);
break;
case TDuration::V_32ND:
padToggle(PAD_NOTE16);
break;
case TDuration::V_64TH:
padToggle(PAD_NOTE32);
break;
case TDuration::V_128TH:
padToggle(PAD_NOTE64);
break;
default:
break;
}
}
else if (cmd == "pad-note-decrease") {
switch (_is.duration().type() ) {
case TDuration::V_LONG:
padToggle(PAD_NOTE0);
break;
case TDuration::V_BREVE:
padToggle(PAD_NOTE1);
break;
case TDuration::V_WHOLE:
padToggle(PAD_NOTE2);
break;
case TDuration::V_HALF:
padToggle(PAD_NOTE4);
break;
case TDuration::V_QUARTER:
padToggle(PAD_NOTE8);
break;
case TDuration::V_EIGHT:
padToggle(PAD_NOTE16);
break;
case TDuration::V_16TH:
padToggle(PAD_NOTE32);
break;
case TDuration::V_32ND:
padToggle(PAD_NOTE64);
break;
case TDuration::V_64TH:
padToggle(PAD_NOTE128);
break;
// cycle back from shortest to longest?
// case TDuration::V_128TH:
// padToggle(PAD_NOTE00);
// break;
default:
break;
}
}
else if (cmd == "pad-rest")
padToggle(PAD_REST);
else if (cmd == "pad-dot")
Expand Down
13 changes: 11 additions & 2 deletions libmscore/edit.cpp
Expand Up @@ -687,6 +687,8 @@ void Score::putNote(const Position& p, bool replace)
const Instrument* instr = st->part()->instr();
MScore::Direction stemDirection = MScore::AUTO;
NoteVal nval;
Tablature* neck = 0;
StaffTypeTablature * tab = 0;

switch(st->staffType()->group()) {
case PERCUSSION_STAFF: {
Expand All @@ -705,8 +707,8 @@ void Score::putNote(const Position& p, bool replace)
case TAB_STAFF: {
if (_is.rest)
return;
Tablature* neck = instr->tablature();
StaffTypeTablature * tab = (StaffTypeTablature*)st->staffType();
neck = instr->tablature();
tab = (StaffTypeTablature*)st->staffType();
int string = tab->VisualStringToPhys(line);
if (string < 0 || string >= neck->strings())
return;
Expand Down Expand Up @@ -768,6 +770,13 @@ void Score::putNote(const Position& p, bool replace)
// if a note on same string already exists, update to new pitch/fret
foreach(Note * note, static_cast<Chord*>(cr)->notes())
if(note->string() == nval.string) { // if string is the same
// if current note fret can receive a new digit,
// add a digit
if (neck && note->fret() >= 1 && note->fret() <= 2) {
nval.fret = note->fret() * 10 + nval.fret;
nval.pitch = neck->getPitch(nval.string, nval.fret);
}
// otherwise, replace with new fret
note->undoChangeProperty(P_PITCH, nval.pitch);
note->undoChangeProperty(P_FRET, nval.fret);
return;
Expand Down

0 comments on commit afad87a

Please sign in to comment.