From 7597339b67eab6405cde2ee382384eeade20e7ed Mon Sep 17 00:00:00 2001 From: Matthias Neeracher Date: Sun, 13 Jul 2008 21:15:07 +0000 Subject: [PATCH] Fix interaction between useSharps and fVisuals --- Sources/VLModel.cpp | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/Sources/VLModel.cpp b/Sources/VLModel.cpp index a244827..7386d9c 100644 --- a/Sources/VLModel.cpp +++ b/Sources/VLModel.cpp @@ -131,7 +131,12 @@ VLNote::VLNote(VLFraction dur, int pitch) void VLNote::Name(std::string & name, bool useSharps) const { - name = PitchName(fPitch, useSharps && !(fVisual & kWantFlat)); + if (fVisual & kWantSharp) + useSharps = true; + else if (fVisual & kWantFlat) + useSharps = false; + + name = PitchName(fPitch, useSharps); } void VLNote::MakeRepresentable() @@ -327,7 +332,12 @@ static const char * kStepNames[] = { void VLChord::Name(std::string & base, std::string & ext, std::string & root, bool useSharps) const { - base = PitchName(fPitch, useSharps && !(fVisual & kWantFlat)); + if (fVisual & kWantSharp) + useSharps = true; + else if (fVisual & kWantFlat) + useSharps = false; + + base = PitchName(fPitch, useSharps); ext = ""; root = ""; @@ -399,7 +409,7 @@ void VLChord::Name(std::string & base, std::string & ext, std::string & root, bo // Root // if (fRootPitch != kNoPitch) - root = PitchName(fRootPitch, useSharps && !(fVisual & kWantFlat)); + root = PitchName(fRootPitch, useSharps); } VLMeasure::VLMeasure()