Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Advanced Preference: Octave tendency for next note-entry position #34

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions global/settings/types/preferencekeys.h
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@
#define PREF_SCORE_NOTE_DEFAULTPLAYDURATION "score/note/defaultPlayDuration"
#define PREF_SCORE_NOTE_WARNPITCHRANGE "score/note/warnPitchRange"
#define PREF_SCORE_NOTE_INPUT_DISABLE_MOUSE_INPUT "ui/score/noteEntry/disableMouseEntry"
#define PREF_SCORE_NOTE_INPUT_OCTAVE_TENDENCY "ui/score/noteEntry/octaveTendencyIsTopNote"
#define PREF_SCORE_STYLE_DEFAULTSTYLEFILE "score/style/defaultStyleFile"
#define PREF_SCORE_STYLE_PARTSTYLEFILE "score/style/partStyleFile"
#define PREF_UI_CANVAS_BG_USECOLOR "ui/canvas/background/useColor"
Expand Down
18 changes: 9 additions & 9 deletions libmscore/cmd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4107,9 +4107,9 @@ void Score::cmdAddPitch(const EditData& ed, int note, bool addFlag, bool insert)
if (seg->isChordRestType()) {
Element* p = seg->element(is.track());
if (p && p->isChord()) {
Note* n = toChord(p)->downNote();
auto note = useUpNote ? toChord(p)->upNote() : toChord(p)->downNote();
// forget any accidental and/or adjustment due to key signature
curPitch = n->epitch() - static_cast<int>(tpc2alter(n->tpc()));
curPitch = note->epitch() - static_cast<int>(tpc2alter(note->tpc()));
break;
}
}
Expand Down Expand Up @@ -4469,13 +4469,13 @@ void Score::cmd(const QAction* a, EditData& ed)
};

static const std::vector<ScoreCmd> cmdList {
{ "note-c", [](Score* cs, EditData& ed){ cs->cmdAddPitch(ed, 0, false, false); }},
{ "note-d", [](Score* cs, EditData& ed){ cs->cmdAddPitch(ed, 1, false, false); }},
{ "note-e", [](Score* cs, EditData& ed){ cs->cmdAddPitch(ed, 2, false, false); }},
{ "note-f", [](Score* cs, EditData& ed){ cs->cmdAddPitch(ed, 3, false, false); }},
{ "note-g", [](Score* cs, EditData& ed){ cs->cmdAddPitch(ed, 4, false, false); }},
{ "note-a", [](Score* cs, EditData& ed){ cs->cmdAddPitch(ed, 5, false, false); }},
{ "note-b", [](Score* cs, EditData& ed){ cs->cmdAddPitch(ed, 6, false, false); }},
{ "note-c", [](Score* cs, EditData& ed){ cs->cmdAddPitch(ed, 0, false, false, MScore::noteInputOctaveTendencyIsTopNote); }},
{ "note-d", [](Score* cs, EditData& ed){ cs->cmdAddPitch(ed, 1, false, false, MScore::noteInputOctaveTendencyIsTopNote); }},
{ "note-e", [](Score* cs, EditData& ed){ cs->cmdAddPitch(ed, 2, false, false, MScore::noteInputOctaveTendencyIsTopNote); }},
{ "note-f", [](Score* cs, EditData& ed){ cs->cmdAddPitch(ed, 3, false, false, MScore::noteInputOctaveTendencyIsTopNote); }},
{ "note-g", [](Score* cs, EditData& ed){ cs->cmdAddPitch(ed, 4, false, false, MScore::noteInputOctaveTendencyIsTopNote); }},
{ "note-a", [](Score* cs, EditData& ed){ cs->cmdAddPitch(ed, 5, false, false, MScore::noteInputOctaveTendencyIsTopNote); }},
{ "note-b", [](Score* cs, EditData& ed){ cs->cmdAddPitch(ed, 6, false, false, MScore::noteInputOctaveTendencyIsTopNote); }},
{ "chord-c", [](Score* cs, EditData& ed){ cs->cmdAddPitch(ed, 0, true, false); }},
{ "chord-d", [](Score* cs, EditData& ed){ cs->cmdAddPitch(ed, 1, true, false); }},
{ "chord-e", [](Score* cs, EditData& ed){ cs->cmdAddPitch(ed, 2, true, false); }},
Expand Down
3 changes: 3 additions & 0 deletions libmscore/mscore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,9 @@ qreal MScore::horizontalPageGapOdd = 50.0;
QColor MScore::selectColor[VOICES];
QColor MScore::cursorColor;
QColor MScore::defaultColor;

bool MScore::noteInputOctaveTendencyIsTopNote;

QColor MScore::layoutBreakColor;
QColor MScore::frameMarginColor;
QColor MScore::bgColor;
Expand Down
3 changes: 3 additions & 0 deletions libmscore/mscore.h
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,9 @@ class MScore {
static QColor selectColor[VOICES];
static QColor cursorColor;
static QColor defaultColor;

static bool noteInputOctaveTendencyIsTopNote;

static QColor dropColor;
static QColor layoutBreakColor;
static QColor frameMarginColor;
Expand Down
2 changes: 2 additions & 0 deletions mscore/musescore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,8 @@ void updateExternalValuesFromPreferences() {
MScore::bgColor = preferences.getColor(PREF_UI_CANVAS_BG_COLOR);
MScore::dropColor = preferences.getColor(PREF_UI_SCORE_NOTE_DROPCOLOR);
MScore::defaultColor = preferences.getColor(PREF_UI_SCORE_DEFAULTCOLOR);

MScore::noteInputOctaveTendencyIsTopNote = preferences.getBool(PREF_SCORE_NOTE_INPUT_OCTAVE_TENDENCY);
MScore::defaultPlayDuration = preferences.getInt(PREF_SCORE_NOTE_DEFAULTPLAYDURATION);
MScore::panPlayback = preferences.getBool(PREF_APP_PLAYBACK_PANPLAYBACK);
MScore::harmonyPlayDisableCompatibility = preferences.getBool(PREF_SCORE_HARMONY_PLAY_DISABLE_COMPATIBILITY);
Expand Down
1 change: 1 addition & 0 deletions mscore/preferences.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,7 @@ void Preferences::init(bool storeInMemoryOnly)
{PREF_SCORE_NOTE_DEFAULTPLAYDURATION, new IntPreference(300 /* ms */, false)},
{PREF_SCORE_NOTE_WARNPITCHRANGE, new BoolPreference(true, false)},
{PREF_SCORE_NOTE_INPUT_DISABLE_MOUSE_INPUT, new BoolPreference(false, true)},
{PREF_SCORE_NOTE_INPUT_OCTAVE_TENDENCY, new BoolPreference(false, true)},
{PREF_SCORE_STYLE_DEFAULTSTYLEFILE, new StringPreference("", false)},
{PREF_SCORE_STYLE_PARTSTYLEFILE, new StringPreference("", false)},
{PREF_UI_CANVAS_BG_USECOLOR, new BoolPreference(true, false)},
Expand Down
Loading