Skip to content

Commit

Permalink
enhanced 1.2 import
Browse files Browse the repository at this point in the history
  • Loading branch information
wschweer committed Aug 23, 2012
1 parent 0eb12e9 commit 4a09825
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 10 deletions.
7 changes: 4 additions & 3 deletions Compatibility
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@

Compatibility with 1.2 scores

- In 1.2 beams cannot span measures. "Begin Beam" markings are ignored.
In 2.0 the marking is honored.
* In 1.2 beams cannot span measures. "Middle Beam" markings are ignored in
this case. In 2.0 the marking is honored.
Bug: the current implementation does not handle beams spanning pages.
The resulting layout is undefined.

(Fixed by replacing "Middle Beam" markings at the beginning of a Measure
by "Beam Begin" marking)

9 changes: 6 additions & 3 deletions libmscore/beam.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -453,8 +453,7 @@ bool Beam::twoBeamedNotes()
void Beam::layout1()
{
//delete old segments
foreach(QLineF* i, beamSegments)
delete i;
qDeleteAll(beamSegments);
beamSegments.clear();

maxDuration.setType(TDuration::V_INVALID);
Expand Down Expand Up @@ -1728,7 +1727,11 @@ void Beam::layout2(QList<ChordRest*>crl, SpannerSegmentType, int frag)
qreal yo = py1 + bl * _beamDist * _grow1;
qreal ly1 = (x2 - x1) * slope + yo;
qreal ly2 = (x3 - x1) * slope + yo;
beamSegments.push_back(new QLineF(x2, ly1, x3, ly2));
if (!qIsFinite(x2) || !qIsFinite(ly1)
|| !qIsFinite(x3) || !qIsFinite(ly2))
qDebug("bad beam segment");
else
beamSegments.push_back(new QLineF(x2, ly1, x3, ly2));
--i;
}
}
Expand Down
3 changes: 2 additions & 1 deletion libmscore/imageStore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,8 @@ ImageStoreItem* ImageStore::getImage(const QString& path) const
if (item->path() == path)
return item;
}
qDebug("ImageStore::getImage(): bad base name <%s>", qPrintable(s));
qDebug("ImageStore::getImage(%s): bad base name <%s>",
qPrintable(path), qPrintable(s));
return 0;
}
QByteArray hash(16, 0);
Expand Down
34 changes: 33 additions & 1 deletion libmscore/read114.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,39 @@ bool Score::read114(const QDomElement& de)
spanner.clear();
connectTies();

searchSelectedElements();
// searchSelectedElements();

for(Measure* m = firstMeasure(); m; m = m->nextMeasure()) {
int tracks = nstaves() * VOICES;
for (int track = 0; track < tracks; ++track) {
for (Segment* s = m->first(); s; s = s->next()) {
if (s->subtype() != Segment::SegChordRest)
continue;
ChordRest* cr = static_cast<ChordRest*>(s->element(track));
if (cr) {
switch(cr->beamMode()) {
case BEAM_AUTO:
case BEAM_BEGIN:
case BEAM_END:
case BEAM_NO:
break;
case BEAM_MID:
case BEAM_BEGIN32:
case BEAM_BEGIN64:
cr->setBeamMode(BEAM_BEGIN);
break;
case BEAM_INVALID:
if (cr->type() == CHORD)
cr->setBeamMode(BEAM_AUTO);
else
cr->setBeamMode(BEAM_NO);
break;
}
break;
}
}
}
}

_fileDivision = MScore::division;

Expand Down
3 changes: 1 addition & 2 deletions mscore/file.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1086,8 +1086,7 @@ QString MuseScore::getFotoFilename()
if (myImages.isRelative())
myImages.setFile(QDir::home(), preferences.myImagesPath);
QList<QUrl> urls;
QString home = QDir::homePath();
urls.append(QUrl::fromLocalFile(home));
urls.append(QUrl::fromLocalFile(QDir::homePath()));
urls.append(QUrl::fromLocalFile(myImages.absoluteFilePath()));
urls.append(QUrl::fromLocalFile(QDir::currentPath()));

Expand Down

0 comments on commit 4a09825

Please sign in to comment.