turn enum TIMESTEP into enum class TimeStep
This commit is contained in:
parent
4b989f8251
commit
fd97658835
3 changed files with 30 additions and 30 deletions
|
@ -103,29 +103,29 @@ static void SetCapGraceDuration(Chord* chord,ChordObj* o)
|
|||
{
|
||||
NoteType nt = NoteType::APPOGGIATURA;
|
||||
((Chord*)chord)->setNoteType(nt);
|
||||
if (o->t == D4) {
|
||||
if (o->t == TIMESTEP::D4) {
|
||||
((Chord*)chord)->setNoteType(NoteType::GRACE4);
|
||||
chord->setDurationType(TDuration::DurationType::V_QUARTER);
|
||||
}
|
||||
else if (o->t == D_BREVE)
|
||||
else if (o->t == TIMESTEP::D_BREVE)
|
||||
((Chord*)chord)->setDurationType(TDuration::DurationType::V_BREVE);
|
||||
else if (o->t == D1)
|
||||
else if (o->t == TIMESTEP::D1)
|
||||
((Chord*)chord)->setDurationType(TDuration::DurationType::V_WHOLE);
|
||||
else if (o->t == D2)
|
||||
else if (o->t == TIMESTEP::D2)
|
||||
((Chord*)chord)->setDurationType(TDuration::DurationType::V_HALF);
|
||||
else if (o->t == D16) {
|
||||
else if (o->t == TIMESTEP::D16) {
|
||||
((Chord*)chord)->setNoteType(NoteType::GRACE16);
|
||||
chord->setDurationType(TDuration::DurationType::V_16TH);
|
||||
}
|
||||
else if (o->t == D32) {
|
||||
else if (o->t == TIMESTEP::D32) {
|
||||
((Chord*)chord)->setNoteType(NoteType::GRACE32);
|
||||
chord->setDurationType(TDuration::DurationType::V_32ND);
|
||||
}
|
||||
else if (o->t == D64)
|
||||
else if (o->t == TIMESTEP::D64)
|
||||
((Chord*)chord)->setDurationType(TDuration::DurationType::V_64TH);
|
||||
else if (o->t == D128)
|
||||
else if (o->t == TIMESTEP::D128)
|
||||
((Chord*)chord)->setDurationType(TDuration::DurationType::V_128TH);
|
||||
else if (o->t == D256)
|
||||
else if (o->t == TIMESTEP::D256)
|
||||
((Chord*)chord)->setDurationType(TDuration::DurationType::V_256TH);
|
||||
else
|
||||
((Chord*)chord)->setDurationType(TDuration::DurationType::V_EIGHT);
|
||||
|
@ -2227,16 +2227,16 @@ int BasicDurationalObj::ticks() const
|
|||
return 0;
|
||||
int len = 0;
|
||||
switch (t) {
|
||||
case D1: len = 4 * MScore::division; break;
|
||||
case D2: len = 2 * MScore::division; break;
|
||||
case D4: len = MScore::division; break;
|
||||
case D8: len = MScore::division >> 1; break;
|
||||
case D16: len = MScore::division >> 2; break;
|
||||
case D32: len = MScore::division >> 3; break;
|
||||
case D64: len = MScore::division >> 4; break;
|
||||
case D128: len = MScore::division >> 5; break;
|
||||
case D256: len = MScore::division >> 6; break;
|
||||
case D_BREVE: len = MScore::division * 8; break;
|
||||
case TIMESTEP::D1: len = 4 * MScore::division; break;
|
||||
case TIMESTEP::D2: len = 2 * MScore::division; break;
|
||||
case TIMESTEP::D4: len = MScore::division; break;
|
||||
case TIMESTEP::D8: len = MScore::division >> 1; break;
|
||||
case TIMESTEP::D16: len = MScore::division >> 2; break;
|
||||
case TIMESTEP::D32: len = MScore::division >> 3; break;
|
||||
case TIMESTEP::D64: len = MScore::division >> 4; break;
|
||||
case TIMESTEP::D128: len = MScore::division >> 5; break;
|
||||
case TIMESTEP::D256: len = MScore::division >> 6; break;
|
||||
case TIMESTEP::D_BREVE: len = MScore::division * 8; break;
|
||||
default:
|
||||
qDebug("BasicDurationalObj::ticks: illegal duration value %d", t);
|
||||
break;
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
|
||||
namespace Ms {
|
||||
|
||||
enum TIMESTEP { D1, D2, D4, D8, D16, D32, D64, D128, D256, D_BREVE };
|
||||
enum class TIMESTEP : char { D1, D2, D4, D8, D16, D32, D64, D128, D256, D_BREVE };
|
||||
|
||||
#if 0
|
||||
static const char* timeNames[] = { "1/1", "1/2", "1/4", "1/8", "1/16", "1/32", "1/64",
|
||||
|
|
|
@ -62,15 +62,15 @@ static QFont capxReadFont(XmlReader& e)
|
|||
|
||||
static bool qstring2timestep(QString& str, TIMESTEP& tstp)
|
||||
{
|
||||
if (str == "1/1") { tstp = D1; return true; }
|
||||
else if (str == "1/2") { tstp = D2; return true; }
|
||||
else if (str == "1/4") { tstp = D4; return true; }
|
||||
else if (str == "1/8") { tstp = D8; return true; }
|
||||
else if (str == "1/16") { tstp = D16; return true; }
|
||||
else if (str == "1/32") { tstp = D32; return true; }
|
||||
else if (str == "1/64") { tstp = D64; return true; }
|
||||
else if (str == "1/128") { tstp = D128; return true; }
|
||||
else if (str == "2/1") { tstp = D_BREVE; return true; }
|
||||
if (str == "1/1") { tstp = TIMESTEP::D1; return true; }
|
||||
else if (str == "1/2") { tstp = TIMESTEP::D2; return true; }
|
||||
else if (str == "1/4") { tstp = TIMESTEP::D4; return true; }
|
||||
else if (str == "1/8") { tstp = TIMESTEP::D8; return true; }
|
||||
else if (str == "1/16") { tstp = TIMESTEP::D16; return true; }
|
||||
else if (str == "1/32") { tstp = TIMESTEP::D32; return true; }
|
||||
else if (str == "1/64") { tstp = TIMESTEP::D64; return true; }
|
||||
else if (str == "1/128") { tstp = TIMESTEP::D128; return true; }
|
||||
else if (str == "2/1") { tstp = TIMESTEP::D_BREVE; return true; }
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -109,7 +109,7 @@ void BasicDurationalObj::readCapx(XmlReader& e, unsigned int& fullm)
|
|||
invisible = false;
|
||||
notBlack = false;
|
||||
color = Qt::black;
|
||||
t = D1;
|
||||
t = TIMESTEP::D1;
|
||||
horizontalShift = 0;
|
||||
count = 0;
|
||||
tripartite = 0;
|
||||
|
|
Loading…
Reference in a new issue