Mask for accidentals in whole test

This commit is contained in:
Matthias Neeracher 2011-09-06 00:20:48 +02:00
parent e417048548
commit 09b5babe70

View File

@ -83,36 +83,34 @@ static inline int8_t StepToSemi(int step)
uint16_t VLPitchAccidental(int8_t pitch, uint16_t visual, int key) uint16_t VLPitchAccidental(int8_t pitch, uint16_t visual, int key)
{ {
int semi = pitch % 12; int semi = pitch % 12;
if (visual & VLNote::kAccidentalsMask) { //
// // The user expressed a preference, try to match it
// The user expressed a preference, try to match it //
// switch (visual & VLNote::kAccidentalsMask) {
switch (visual) { case VLNote::kWantNatural:
case VLNote::kWantNatural: if (IsBasicNote(semi))
if (IsBasicNote(semi)) return visual;
return visual; break;
break; case VLNote::kWant2Flat:
case VLNote::kWant2Flat: if (IsBasicNote(semi+2))
if (IsBasicNote(semi+2)) return visual;
return visual; else
else return VLNote::kWantFlat;
return VLNote::kWantFlat; case VLNote::kWantFlat:
case VLNote::kWantFlat: if (IsBasicNote(semi+1))
if (IsBasicNote(semi+1)) return visual;
return visual; break;
break; case VLNote::kWant2Sharp:
case VLNote::kWant2Sharp: if (IsBasicNote(semi-2))
if (IsBasicNote(semi-2)) return visual;
return visual; else
else return VLNote::kWantSharp;
return VLNote::kWantSharp; case VLNote::kWantSharp:
case VLNote::kWantSharp: if (IsBasicNote(semi-1))
if (IsBasicNote(semi-1)) return visual;
return visual; break;
break; default:
default: break;
break;
}
} }
// //
// No visuals, or no match // No visuals, or no match