Skip to content

Commit

Permalink
remove post 1.3 and pre-2.0 compatibility checks and tweaks
Browse files Browse the repository at this point in the history
There's probably quite a bit more, but these are the most
obvious places.
Impoved the error mssage, with a hint where to get 2.0.
Most of the templates and sample scores had been created with a pre2.0
nightly version, so they have been resaved with 2.0.0. They'll most
probably need to get updated for 3.0 at some point again.
  • Loading branch information
Jojo-Schmitz committed May 13, 2016
1 parent 45f0100 commit b6f3e9d
Show file tree
Hide file tree
Showing 776 changed files with 2,585 additions and 2,683 deletions.
Binary file modified demos/All_Dudes.mscz
Binary file not shown.
Binary file modified demos/Amazing_grace.mscz
Binary file not shown.
Binary file modified demos/Reunion.mscz
Binary file not shown.
Binary file modified demos/Triumph.mscz
Binary file not shown.
169 changes: 65 additions & 104 deletions demos/adeste.mscx

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions libmscore/box.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ void Box::read(XmlReader& e)
// with .msc versions prior to 1.17, box margins were only used when nesting another box inside this box:
// for backward compatibility set them to 0 in all other cases

if (score()->mscVersion() < 117 && (type() == Element::Type::HBOX || type() == Element::Type::VBOX) && !keepMargins) {
if (score()->mscVersion() <= 114 && (type() == Element::Type::HBOX || type() == Element::Type::VBOX) && !keepMargins) {
_leftMargin = _rightMargin = _topMargin = _bottomMargin = 0.0;
}
}
Expand All @@ -238,12 +238,12 @@ bool Box::readProperties(XmlReader& e)
_boxWidth = Spatium(e.readDouble());
else if (tag == "topGap") {
_topGap = e.readDouble();
if (score()->mscVersion() >= 203)
if (score()->mscVersion() >= 206)
_topGap *= score()->spatium();
}
else if (tag == "bottomGap") {
_bottomGap = e.readDouble();
if (score()->mscVersion() >= 203)
if (score()->mscVersion() >= 206)
_bottomGap *= score()->spatium();
}
else if (tag == "leftMargin")
Expand Down
2 changes: 1 addition & 1 deletion libmscore/chordrest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ bool ChordRest::readProperties(XmlReader& e)
setDuration(actualDurationType().fraction());
}
else {
if (score()->mscVersion() < 115) {
if (score()->mscVersion() <= 114) {
SigEvent event = score()->sigmap()->timesig(e.tick());
setDuration(event.timesig());
}
Expand Down
2 changes: 1 addition & 1 deletion libmscore/dynamic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ void Dynamic::read(XmlReader& e)
void Dynamic::layout()
{
if (!readPos().isNull()) {
if (score()->mscVersion() < 118) {
if (score()->mscVersion() <= 114) {
setReadPos(QPointF());
// hack: 1.2 boundingBoxes are a bit wider which results
// in symbols moved right
Expand Down
2 changes: 1 addition & 1 deletion libmscore/image.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ void Image::write(Xml& xml) const

void Image::read(XmlReader& e)
{
if (score()->mscVersion() <= 123)
if (score()->mscVersion() <= 114)
_sizeIsSpatium = false;

while (e.readNextStartElement()) {
Expand Down
36 changes: 2 additions & 34 deletions libmscore/measure.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1734,7 +1734,7 @@ void Measure::read(XmlReader& e, int staffIdx)
breath->setTrack(e.track());
int tick = e.tick();
breath->read(e);
if (score()->mscVersion() < 205) {
if (score()->mscVersion() <= 206) {
// older scores placed the breath segment right after the chord to which it applies
// rather than before the next chordrest segment with an element for the staff
// result would be layout too far left if there are other segments due to notes in other staves
Expand Down Expand Up @@ -2129,39 +2129,7 @@ void Measure::read(XmlReader& e, int staffIdx)
}
}
#endif
//
// for compatibility with 1.22:
//
if (score()->mscVersion() == 122) {
int ticks1 = 0;
for (Segment* s = last(); s; s = s->prev()) {
if (s->segmentType() == Segment::Type::ChordRest) {
if (s->element(0)) {
ChordRest* cr = static_cast<ChordRest*>(s->element(0));
if (cr->type() == Element::Type::REPEAT_MEASURE)
ticks1 = ticks();
else
ticks1 = s->rtick() + cr->actualTicks();
break;
}
}
}
if (ticks() != ticks1) {
// this is a irregular measure
_len = Fraction::fromTicks(ticks1);
_len.reduce();
for (Segment* s = last(); s; s = s->prev()) {
if (s->tick() < tick() + ticks())
break;
if (s->segmentType() == Segment::Type::BarLine) {
qDebug("reduce BarLine to EndBarLine");
s->setSegmentType(Segment::Type::EndBarLine);
}
}

}
}
foreach (Tuplet* tuplet, e.tuplets()) {
for (Tuplet* tuplet : e.tuplets()) {
if (tuplet->elements().empty()) {
// this should not happen and is a sign of input file corruption
qDebug("Measure:read(): empty tuplet id %d (%p), input file corrupted?",
Expand Down
4 changes: 2 additions & 2 deletions libmscore/note.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -853,7 +853,7 @@ void Note::read(XmlReader& e)
a->read(e);
if (!hasAccidental) // only the new accidental, if it has been added previously
add(a);
if (score()->mscVersion() < 117)
if (score()->mscVersion() <= 114)
hasAccidental = true; // we now have an accidental
}
else if (tag == "Tie") {
Expand Down Expand Up @@ -1122,7 +1122,7 @@ void Note::read(XmlReader& e)
// ensure sane values:
_pitch = limit(_pitch, 0, 127);

if (score()->mscVersion() < 117) {
if (score()->mscVersion() <= 114) {
if (concertPitch()) {
_tpc[1] = Tpc::TPC_INVALID;
}
Expand Down
4 changes: 2 additions & 2 deletions libmscore/scorefile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -674,7 +674,7 @@ void Score::saveFile(QIODevice* f, bool msczFormat, bool onlySelection)
xml.tag("programRevision", revision);
}
else {
xml.stag("museScore version=\"2.00\"");
xml.stag("museScore version=\"2.06\"");
}
write(xml, onlySelection);
xml.etag();
Expand Down Expand Up @@ -905,7 +905,7 @@ Score::FileError MasterScore::read1(XmlReader& e, bool ignoreVersionError)
QString message;
if (mscVersion() > MSCVERSION)
return FileError::FILE_TOO_NEW;
if (mscVersion() < 200)
if (mscVersion() < 206)
return FileError::FILE_TOO_OLD;
}

Expand Down
2 changes: 1 addition & 1 deletion libmscore/slur.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -646,7 +646,7 @@ void SlurSegment::layoutSegment(const QPointF& p1, const QPointF& p2)
}
}
setbbox(path.boundingRect());
if ((staffIdx() > 0) && score()->mscVersion() < 201 && !readPos().isNull()) {
if ((staffIdx() > 0) && score()->mscVersion() < 206 && !readPos().isNull()) {
QPointF staffOffset;
if (system() && track() >= 0)
staffOffset = QPointF(0.0, system()->staff(staffIdx())->y());
Expand Down
2 changes: 1 addition & 1 deletion libmscore/tempotext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ void TempoText::read(XmlReader& e)
else if (!Text::readProperties(e))
e.unknown();
}
if (score()->mscVersion() < 119) {
if (score()->mscVersion() <= 114) {
//
// Reset text in old version to
// style.
Expand Down
9 changes: 1 addition & 8 deletions libmscore/timesig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -201,14 +201,7 @@ void TimeSig::read(XmlReader& e)
}
else if (tag == "subtype") {
int i = e.readInt();
if (score()->mscVersion() < 122 && score()->mscVersion() > 114) {
setSig(Fraction(
((i >> 24) & 0x3f)
+ ((i >> 18) & 0x3f)
+ ((i >> 12) & 0x3f)
+ ((i >> 6) & 0x3f), i & 0x3f), TimeSigType::NORMAL);
}
else if (score()->mscVersion() <= 114) {
if (score()->mscVersion() <= 114) {
if (i == 0x40000104)
_timeSigType = TimeSigType::FOUR_FOUR;
else if (i == 0x40002084)
Expand Down
5 changes: 4 additions & 1 deletion mscore/file.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,10 @@ static bool readScoreError(const QString& name, Score::FileError error, bool ask
case Score::FileError::FILE_TOO_OLD:
msg += QObject::tr("It was last saved with a version older than 2.0.0.\n"
"You can convert this score by opening and then\n"
"saving with MuseScore version 2.x");
"saving with MuseScore version 2.x.\n"
"Visit the %1MuseScore download page%2 to obtain such a 2.x version.")
.arg("<a href=\"http://musescore.org/download#older-versions\">")
.arg("</a>");
canIgnore = true;
break;
case Score::FileError::FILE_TOO_NEW:
Expand Down
2 changes: 1 addition & 1 deletion mtest/biab/chords-ref.mscx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<museScore version="2.00">
<museScore version="2.06">
<Score>
<LayerTag id="0" tag="default"></LayerTag>
<currentLayer>0</currentLayer>
Expand Down
2 changes: 1 addition & 1 deletion mtest/capella/io/test1.cap-ref.mscx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<museScore version="2.00">
<museScore version="2.06">
<Score>
<LayerTag id="0" tag="default"></LayerTag>
<currentLayer>0</currentLayer>
Expand Down
2 changes: 1 addition & 1 deletion mtest/capella/io/test1.capx-ref.mscx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<museScore version="2.00">
<museScore version="2.06">
<Score>
<LayerTag id="0" tag="default"></LayerTag>
<currentLayer>0</currentLayer>
Expand Down
2 changes: 1 addition & 1 deletion mtest/capella/io/test2.cap-ref.mscx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<museScore version="2.00">
<museScore version="2.06">
<Score>
<LayerTag id="0" tag="default"></LayerTag>
<currentLayer>0</currentLayer>
Expand Down
2 changes: 1 addition & 1 deletion mtest/capella/io/test2.capx-ref.mscx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<museScore version="2.00">
<museScore version="2.06">
<Score>
<LayerTag id="0" tag="default"></LayerTag>
<currentLayer>0</currentLayer>
Expand Down
2 changes: 1 addition & 1 deletion mtest/capella/io/test3.cap-ref.mscx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<museScore version="2.00">
<museScore version="2.06">
<Score>
<LayerTag id="0" tag="default"></LayerTag>
<currentLayer>0</currentLayer>
Expand Down
2 changes: 1 addition & 1 deletion mtest/capella/io/test3.capx-ref.mscx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<museScore version="2.00">
<museScore version="2.06">
<Score>
<LayerTag id="0" tag="default"></LayerTag>
<currentLayer>0</currentLayer>
Expand Down
2 changes: 1 addition & 1 deletion mtest/capella/io/test4.cap-ref.mscx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<museScore version="2.00">
<museScore version="2.06">
<Score>
<LayerTag id="0" tag="default"></LayerTag>
<currentLayer>0</currentLayer>
Expand Down
2 changes: 1 addition & 1 deletion mtest/capella/io/test4.capx-ref.mscx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<museScore version="2.00">
<museScore version="2.06">
<Score>
<LayerTag id="0" tag="default"></LayerTag>
<currentLayer>0</currentLayer>
Expand Down
2 changes: 1 addition & 1 deletion mtest/capella/io/test5.cap-ref.mscx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<museScore version="2.00">
<museScore version="2.06">
<Score>
<LayerTag id="0" tag="default"></LayerTag>
<currentLayer>0</currentLayer>
Expand Down
2 changes: 1 addition & 1 deletion mtest/capella/io/test5.capx-ref.mscx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<museScore version="2.00">
<museScore version="2.06">
<Score>
<LayerTag id="0" tag="default"></LayerTag>
<currentLayer>0</currentLayer>
Expand Down
2 changes: 1 addition & 1 deletion mtest/capella/io/test6.cap-ref.mscx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<museScore version="2.00">
<museScore version="2.06">
<Score>
<LayerTag id="0" tag="default"></LayerTag>
<currentLayer>0</currentLayer>
Expand Down
2 changes: 1 addition & 1 deletion mtest/capella/io/test6.capx-ref.mscx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<museScore version="2.00">
<museScore version="2.06">
<Score>
<LayerTag id="0" tag="default"></LayerTag>
<currentLayer>0</currentLayer>
Expand Down
2 changes: 1 addition & 1 deletion mtest/capella/io/test7.cap-ref.mscx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<museScore version="2.00">
<museScore version="2.06">
<Score>
<LayerTag id="0" tag="default"></LayerTag>
<currentLayer>0</currentLayer>
Expand Down
2 changes: 1 addition & 1 deletion mtest/capella/io/test7.capx-ref.mscx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<museScore version="2.00">
<museScore version="2.06">
<Score>
<LayerTag id="0" tag="default"></LayerTag>
<currentLayer>0</currentLayer>
Expand Down
2 changes: 1 addition & 1 deletion mtest/capella/io/test8.cap-ref.mscx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<museScore version="2.00">
<museScore version="2.06">
<Score>
<LayerTag id="0" tag="default"></LayerTag>
<currentLayer>0</currentLayer>
Expand Down
2 changes: 1 addition & 1 deletion mtest/capella/io/testBarline.capx-ref.mscx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<museScore version="2.00">
<museScore version="2.06">
<Score>
<LayerTag id="0" tag="default"></LayerTag>
<currentLayer>0</currentLayer>
Expand Down
2 changes: 1 addition & 1 deletion mtest/capella/io/testPianoG4G5.capx-ref.mscx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<museScore version="2.00">
<museScore version="2.06">
<Score>
<LayerTag id="0" tag="default"></LayerTag>
<currentLayer>0</currentLayer>
Expand Down
2 changes: 1 addition & 1 deletion mtest/capella/io/testScaleC4C5.capx-ref.mscx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<museScore version="2.00">
<museScore version="2.06">
<Score>
<LayerTag id="0" tag="default"></LayerTag>
<currentLayer>0</currentLayer>
Expand Down
2 changes: 1 addition & 1 deletion mtest/capella/io/testSlurTie.capx-ref.mscx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<museScore version="2.00">
<museScore version="2.06">
<Score>
<LayerTag id="0" tag="default"></LayerTag>
<currentLayer>0</currentLayer>
Expand Down
2 changes: 1 addition & 1 deletion mtest/capella/io/testText1.capx-ref.mscx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<museScore version="2.00">
<museScore version="2.06">
<Score>
<LayerTag id="0" tag="default"></LayerTag>
<currentLayer>0</currentLayer>
Expand Down
2 changes: 1 addition & 1 deletion mtest/capella/io/testTuplet1.capx-ref.mscx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<museScore version="2.00">
<museScore version="2.06">
<Score>
<LayerTag id="0" tag="default"></LayerTag>
<currentLayer>0</currentLayer>
Expand Down
2 changes: 1 addition & 1 deletion mtest/capella/io/testTuplet2.cap-ref.mscx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<museScore version="2.00">
<museScore version="2.06">
<Score>
<LayerTag id="0" tag="default"></LayerTag>
<currentLayer>0</currentLayer>
Expand Down
2 changes: 1 addition & 1 deletion mtest/capella/io/testTuplet2.capx-ref.mscx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<museScore version="2.00">
<museScore version="2.06">
<Score>
<LayerTag id="0" tag="default"></LayerTag>
<currentLayer>0</currentLayer>
Expand Down
2 changes: 1 addition & 1 deletion mtest/capella/io/testVolta1.capx-ref.mscx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<museScore version="2.00">
<museScore version="2.06">
<Score>
<LayerTag id="0" tag="default"></LayerTag>
<currentLayer>0</currentLayer>
Expand Down
2 changes: 1 addition & 1 deletion mtest/guitarpro/accent.gpx-ref.mscx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<museScore version="2.00">
<museScore version="2.06">
<Score>
<LayerTag id="0" tag="default"></LayerTag>
<currentLayer>0</currentLayer>
Expand Down
2 changes: 1 addition & 1 deletion mtest/guitarpro/all-percussion.gp5-ref.mscx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<museScore version="2.00">
<museScore version="2.06">
<Score>
<LayerTag id="0" tag="default"></LayerTag>
<currentLayer>0</currentLayer>
Expand Down
2 changes: 1 addition & 1 deletion mtest/guitarpro/arpeggio.gpx-ref.mscx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<museScore version="2.00">
<museScore version="2.06">
<Score>
<LayerTag id="0" tag="default"></LayerTag>
<currentLayer>0</currentLayer>
Expand Down
2 changes: 1 addition & 1 deletion mtest/guitarpro/artificial-harmonic.gpx-ref.mscx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<museScore version="2.00">
<museScore version="2.06">
<Score>
<LayerTag id="0" tag="default"></LayerTag>
<currentLayer>0</currentLayer>
Expand Down
2 changes: 1 addition & 1 deletion mtest/guitarpro/barre.gpx-ref.mscx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<museScore version="2.00">
<museScore version="2.06">
<Score>
<LayerTag id="0" tag="default"></LayerTag>
<currentLayer>0</currentLayer>
Expand Down
2 changes: 1 addition & 1 deletion mtest/guitarpro/basic-bend.gp5-ref.mscx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<museScore version="2.00">
<museScore version="2.06">
<Score>
<LayerTag id="0" tag="default"></LayerTag>
<currentLayer>0</currentLayer>
Expand Down
Loading

0 comments on commit b6f3e9d

Please sign in to comment.