@@ -1764,22 +1764,22 @@ static void markUserAccidentals(const int firstStaff,
1764
1764
AccidentalVal currAccVal = currAcc.accidentalVal (ln);
1765
1765
if ((alter == -1
1766
1766
&& currAccVal == AccidentalVal::FLAT
1767
- && nt->accidental ()->accidentalType () == Accidental::Type ::FLAT
1767
+ && nt->accidental ()->accidentalType () == AccidentalType ::FLAT
1768
1768
&& !accTmp.value (ln, false ))
1769
1769
|| (alter == 0
1770
1770
&& currAccVal == AccidentalVal::NATURAL
1771
- && nt->accidental ()->accidentalType () == Accidental::Type ::NATURAL
1771
+ && nt->accidental ()->accidentalType () == AccidentalType ::NATURAL
1772
1772
&& !accTmp.value (ln, false ))
1773
1773
|| (alter == 1
1774
1774
&& currAccVal == AccidentalVal::SHARP
1775
- && nt->accidental ()->accidentalType () == Accidental::Type ::SHARP
1775
+ && nt->accidental ()->accidentalType () == AccidentalType ::SHARP
1776
1776
&& !accTmp.value (ln, false ))) {
1777
- nt->accidental ()->setRole (Accidental::Role ::USER);
1777
+ nt->accidental ()->setRole (AccidentalRole ::USER);
1778
1778
}
1779
- else if (nt->accidental ()->accidentalType () > Accidental::Type ::NATURAL
1780
- && nt->accidental ()->accidentalType () < Accidental::Type ::END) {
1779
+ else if (nt->accidental ()->accidentalType () > AccidentalType ::NATURAL
1780
+ && nt->accidental ()->accidentalType () < AccidentalType ::END) {
1781
1781
// microtonal accidental
1782
- nt->accidental ()->setRole (Accidental::Role ::USER);
1782
+ nt->accidental ()->setRole (AccidentalRole ::USER);
1783
1783
accTmp.insert (ln, false );
1784
1784
}
1785
1785
else {
@@ -1847,7 +1847,7 @@ void MusicXMLParserPass2::measure(const QString& partId,
1847
1847
// note: chord and grace note handling done in note()
1848
1848
// dura > 0 iff valid rest or first note of chord found
1849
1849
Note* n = note (partId, measure, time + mTime , time + prevTime, dura, cv, gcl, beam, fbl, alt);
1850
- if (n && n->accidental () && n->accidental ()->accidentalType () != Accidental::Type ::NONE)
1850
+ if (n && n->accidental () && n->accidental ()->accidentalType () != AccidentalType ::NONE)
1851
1851
alterMap.insert (n, alt);
1852
1852
if (dura.isValid () && dura > Fraction (0 , 1 )) {
1853
1853
prevTime = mTime ; // save time stamp last chord created
@@ -2984,36 +2984,36 @@ static bool isAppr(const double v, const double ref, const double epsilon)
2984
2984
// ---------------------------------------------------------
2985
2985
2986
2986
/* *
2987
- Convert a MusicXML alter tag into a microtonal accidental in MuseScore enum Accidental::Type .
2987
+ Convert a MusicXML alter tag into a microtonal accidental in MuseScore enum AccidentalType .
2988
2988
Works only for quarter tone, half tone, three-quarters tone and whole tone accidentals.
2989
2989
*/
2990
2990
2991
- static Accidental::Type microtonalGuess (double val)
2991
+ static AccidentalType microtonalGuess (double val)
2992
2992
{
2993
2993
const double eps = 0.001 ;
2994
2994
if (isAppr (val, -2 , eps))
2995
- return Accidental::Type ::FLAT2;
2995
+ return AccidentalType ::FLAT2;
2996
2996
else if (isAppr (val, -1.5 , eps))
2997
- return Accidental::Type ::MIRRORED_FLAT2;
2997
+ return AccidentalType ::MIRRORED_FLAT2;
2998
2998
else if (isAppr (val, -1 , eps))
2999
- return Accidental::Type ::FLAT;
2999
+ return AccidentalType ::FLAT;
3000
3000
else if (isAppr (val, -0.5 , eps))
3001
- return Accidental::Type ::MIRRORED_FLAT;
3001
+ return AccidentalType ::MIRRORED_FLAT;
3002
3002
else if (isAppr (val, 0 , eps))
3003
- return Accidental::Type ::NATURAL;
3003
+ return AccidentalType ::NATURAL;
3004
3004
else if (isAppr (val, 0.5 , eps))
3005
- return Accidental::Type ::SHARP_SLASH;
3005
+ return AccidentalType ::SHARP_SLASH;
3006
3006
else if (isAppr (val, 1 , eps))
3007
- return Accidental::Type ::SHARP;
3007
+ return AccidentalType ::SHARP;
3008
3008
else if (isAppr (val, 1.5 , eps))
3009
- return Accidental::Type ::SHARP_SLASH4;
3009
+ return AccidentalType ::SHARP_SLASH4;
3010
3010
else if (isAppr (val, 2 , eps))
3011
- return Accidental::Type ::SHARP2;
3011
+ return AccidentalType ::SHARP2;
3012
3012
else
3013
3013
qDebug (" Guess for microtonal accidental corresponding to value %f failed." , val); // TODO
3014
3014
3015
3015
// default
3016
- return Accidental::Type ::NONE;
3016
+ return AccidentalType ::NONE;
3017
3017
}
3018
3018
3019
3019
// ---------------------------------------------------------
@@ -3034,7 +3034,7 @@ static void addSymToSig(KeySigEvent& sig, const QString& step, const QString& al
3034
3034
bool ok;
3035
3035
double d;
3036
3036
d = alter.toDouble (&ok);
3037
- Accidental::Type accTpAlter = ok ? microtonalGuess (d) : Accidental::Type ::NONE;
3037
+ AccidentalType accTpAlter = ok ? microtonalGuess (d) : AccidentalType ::NONE;
3038
3038
id = mxmlString2accSymId (accidentalType2MxmlString (accTpAlter));
3039
3039
}
3040
3040
@@ -3710,7 +3710,7 @@ Note* MusicXMLParserPass2::note(const QString& partId,
3710
3710
Fraction timeMod (0 , 0 ); // invalid (will handle "present but incorrect" as "not present")
3711
3711
QString type;
3712
3712
QString voice;
3713
- Accidental::Type accType = Accidental::Type ::NONE; // set based on alter value (can be microtonal)
3713
+ AccidentalType accType = AccidentalType ::NONE; // set based on alter value (can be microtonal)
3714
3714
Accidental* acc = 0 ; // created based on accidental element
3715
3715
MScore::Direction stemDir = MScore::Direction::AUTO;
3716
3716
bool noStem = false ;
@@ -3808,8 +3808,8 @@ Note* MusicXMLParserPass2::note(const QString& partId,
3808
3808
3809
3809
// accidental handling
3810
3810
// qDebug("note acc %p type %hhd acctype %hhd",
3811
- // acc, acc ? acc->accidentalType() : static_cast<Ms::Accidental::Type >(0), accType);
3812
- if (!acc && accType != Accidental::Type ::NONE) {
3811
+ // acc, acc ? acc->accidentalType() : static_cast<Ms::AccidentalType >(0), accType);
3812
+ if (!acc && accType != AccidentalType ::NONE) {
3813
3813
acc = new Accidental (_score);
3814
3814
acc->setAccidentalType (accType);
3815
3815
}
@@ -4055,7 +4055,7 @@ Note* MusicXMLParserPass2::note(const QString& partId,
4055
4055
if (acc) {
4056
4056
note->add (acc);
4057
4057
// save alter value for user accidental
4058
- if (acc->accidentalType () != Accidental::Type ::NONE)
4058
+ if (acc->accidentalType () != AccidentalType ::NONE)
4059
4059
alt = alter;
4060
4060
}
4061
4061
c->add (note);
@@ -4580,14 +4580,14 @@ Accidental* MusicXMLParserPass2::accidental()
4580
4580
bool parentheses = _e.attributes ().value (" parentheses" ) == " yes" ;
4581
4581
4582
4582
QString s = _e.readElementText ();
4583
- Accidental::Type type = mxmlString2accidentalType (s);
4583
+ AccidentalType type = mxmlString2accidentalType (s);
4584
4584
4585
- if (type != Accidental::Type ::NONE) {
4585
+ if (type != AccidentalType ::NONE) {
4586
4586
Accidental* a = new Accidental (_score);
4587
4587
a->setAccidentalType (type);
4588
4588
if (editorial || cautionary || parentheses) {
4589
4589
a->setHasBracket (cautionary || parentheses);
4590
- a->setRole (Accidental::Role ::USER);
4590
+ a->setRole (AccidentalRole ::USER);
4591
4591
}
4592
4592
return a;
4593
4593
}
@@ -4709,7 +4709,7 @@ void MusicXMLParserPass2::timeModification(Fraction& timeMod, TDuration& normalT
4709
4709
// pitch
4710
4710
// ---------------------------------------------------------
4711
4711
4712
- void MusicXMLParserPass2::pitch (int & step, int & alter, int & oct, Accidental::Type & accid)
4712
+ void MusicXMLParserPass2::pitch (int & step, int & alter, int & oct, AccidentalType & accid)
4713
4713
{
4714
4714
Q_ASSERT (_e.isStartElement () && _e.name () == " pitch" );
4715
4715
@@ -4727,7 +4727,7 @@ void MusicXMLParserPass2::pitch(int& step, int& alter, int& oct, Accidental::Typ
4727
4727
logError (QString (" invalid alter '%1'" ).arg (strAlter));
4728
4728
bool ok2;
4729
4729
double altervalue = strAlter.toDouble (&ok2);
4730
- if (ok2 && (qAbs (altervalue) < 2.0 ) && (accid == Accidental::Type ::NONE)) {
4730
+ if (ok2 && (qAbs (altervalue) < 2.0 ) && (accid == AccidentalType ::NONE)) {
4731
4731
// try to see if a microtonal accidental is needed
4732
4732
accid = microtonalGuess (altervalue);
4733
4733
}
@@ -5440,4 +5440,4 @@ MusicXMLParserDirection::MusicXMLParserDirection(QXmlStreamReader& e,
5440
5440
// nothing
5441
5441
}
5442
5442
5443
- }
5443
+ }
0 commit comments