fix #275218: fix MSVC C4458 warnings
reg. a declaration shadowing a class member, "Warning C4458: declaration of 'XXX' hides class member"
This commit is contained in:
parent
7d7f7e74e5
commit
fe50c85097
40 changed files with 454 additions and 461 deletions
|
@ -30,7 +30,7 @@ namespace Awl {
|
|||
AbstractSlider::AbstractSlider(QWidget* parent)
|
||||
: QWidget(parent), _scaleColor(Qt::darkGray), _scaleValueColor(QColor("#2456aa"))
|
||||
{
|
||||
_id = 0;
|
||||
__id = 0;
|
||||
_value = 0.5;
|
||||
_minValue = 0.0;
|
||||
_maxValue = 1.0;
|
||||
|
@ -192,7 +192,7 @@ void AbstractSlider::setValue(double val)
|
|||
|
||||
void AbstractSlider::valueChange()
|
||||
{
|
||||
emit valueChanged(value(), _id);
|
||||
emit valueChanged(value(), __id);
|
||||
update();
|
||||
}
|
||||
|
||||
|
|
|
@ -59,7 +59,7 @@ class AbstractSlider : public QWidget {
|
|||
Q_PROPERTY(double dclickValue2 READ dclickValue2 WRITE setDclickValue2)
|
||||
|
||||
protected:
|
||||
int _id;
|
||||
int __id;
|
||||
double _value;
|
||||
double _minValue, _maxValue, _lineStep, _pageStep;
|
||||
double _dclickValue1;
|
||||
|
@ -106,8 +106,8 @@ class AbstractSlider : public QWidget {
|
|||
virtual void setInvertedAppearance(bool val) { _invert = val; }
|
||||
bool invertedAppearance() const { return _invert; }
|
||||
|
||||
int id() const { return _id; }
|
||||
void setId(int i) { _id = i; }
|
||||
int id() const { return __id; }
|
||||
void setId(int i) { __id = i; }
|
||||
|
||||
virtual double value() const;
|
||||
virtual QString userValue() const;
|
||||
|
|
|
@ -107,7 +107,7 @@ void Knob::setBorder(int val)
|
|||
void Knob::mousePressEvent(QMouseEvent* ev)
|
||||
{
|
||||
startY = ev->y();
|
||||
emit sliderPressed(_id);
|
||||
emit sliderPressed(__id);
|
||||
if (_center) {
|
||||
QRect r(points->boundingRect().toRect());
|
||||
if (r.contains(ev->pos())) {
|
||||
|
@ -123,7 +123,7 @@ void Knob::mousePressEvent(QMouseEvent* ev)
|
|||
|
||||
void Knob::mouseReleaseEvent(QMouseEvent*)
|
||||
{
|
||||
emit sliderReleased(_id);
|
||||
emit sliderReleased(__id);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------
|
||||
|
|
|
@ -41,7 +41,7 @@ MidiPanKnob::MidiPanKnob(QWidget* parent)
|
|||
|
||||
void MidiPanKnob::valueChange()
|
||||
{
|
||||
emit valueChanged(_value + 64.0f, _id);
|
||||
emit valueChanged(_value + 64.0f, __id);
|
||||
update();
|
||||
}
|
||||
|
||||
|
|
|
@ -142,7 +142,7 @@ void Slider::mousePressEvent(QMouseEvent* ev)
|
|||
{
|
||||
startDrag = ev->pos();
|
||||
// if (points->boundingRect().toRect().contains(startDrag)) {
|
||||
emit sliderPressed(_id);
|
||||
emit sliderPressed(__id);
|
||||
dragMode = true;
|
||||
int pixel = (orient == Qt::Vertical) ? height() - _sliderSize.height() : width() - _sliderSize.width();
|
||||
dragppos = int(pixel * (_value - minValue()) / (maxValue() - minValue()));
|
||||
|
@ -158,7 +158,7 @@ void Slider::mousePressEvent(QMouseEvent* ev)
|
|||
void Slider::mouseReleaseEvent(QMouseEvent*)
|
||||
{
|
||||
if (dragMode) {
|
||||
emit sliderReleased(_id);
|
||||
emit sliderReleased(__id);
|
||||
dragMode = false;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -85,16 +85,16 @@ static inline int intmaxlog(int n)
|
|||
// initialize
|
||||
//---------------------------------------------------------
|
||||
|
||||
void BspTree::initialize(const QRectF& rect, int n)
|
||||
void BspTree::initialize(const QRectF& rec, int n)
|
||||
{
|
||||
depth = intmaxlog(n);
|
||||
this->rect = rect;
|
||||
this->rect = rec;
|
||||
leafCnt = 0;
|
||||
|
||||
nodes.resize((1 << (depth+1)) - 1);
|
||||
leaves.resize(1 << depth);
|
||||
leaves.fill(QList<Element*>());
|
||||
initialize(rect, depth, 0);
|
||||
initialize(rec, depth, 0);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------
|
||||
|
@ -134,14 +134,14 @@ void BspTree::remove(Element* element)
|
|||
// items
|
||||
//---------------------------------------------------------
|
||||
|
||||
QList<Element*> BspTree::items(const QRectF& rect)
|
||||
QList<Element*> BspTree::items(const QRectF& rec)
|
||||
{
|
||||
FindItemBspTreeVisitor findVisitor;
|
||||
climbTree(&findVisitor, rect);
|
||||
climbTree(&findVisitor, rec);
|
||||
QList<Element*> l;
|
||||
for (Element * e : findVisitor.foundItems) {
|
||||
e->itemDiscovered = false;
|
||||
if (e->pageBoundingRect().intersects(rect))
|
||||
if (e->pageBoundingRect().intersects(rec))
|
||||
l.append(e);
|
||||
}
|
||||
return l;
|
||||
|
@ -176,11 +176,11 @@ QString BspTree::debug(int index) const
|
|||
|
||||
QString tmp;
|
||||
if (node->type == Node::Type::LEAF) {
|
||||
QRectF rect = rectForIndex(index);
|
||||
QRectF rec = rectForIndex(index);
|
||||
if (!leaves[node->leafIndex].empty()) {
|
||||
tmp += QString::fromLatin1("[%1, %2, %3, %4] contains %5 items\n")
|
||||
.arg(rect.left()).arg(rect.top())
|
||||
.arg(rect.width()).arg(rect.height())
|
||||
.arg(rec.left()).arg(rec.top())
|
||||
.arg(rec.width()).arg(rec.height())
|
||||
.arg(leaves[node->leafIndex].size());
|
||||
}
|
||||
}
|
||||
|
@ -202,30 +202,30 @@ QString BspTree::debug(int index) const
|
|||
// initialize
|
||||
//---------------------------------------------------------
|
||||
|
||||
void BspTree::initialize(const QRectF& rect, int depth, int index)
|
||||
void BspTree::initialize(const QRectF& rec, int dep, int index)
|
||||
{
|
||||
Node* node = &nodes[index];
|
||||
if (index == 0) {
|
||||
node->type = Node::Type::HORIZONTAL;
|
||||
node->offset = rect.center().x();
|
||||
node->offset = rec.center().x();
|
||||
}
|
||||
|
||||
if (depth) {
|
||||
if (dep) {
|
||||
Node::Type type;
|
||||
QRectF rect1, rect2;
|
||||
qreal offset1, offset2;
|
||||
|
||||
if (node->type == Node::Type::HORIZONTAL) {
|
||||
type = Node::Type::VERTICAL;
|
||||
rect1.setRect(rect.left(), rect.top(), rect.width(), rect.height() * .5);
|
||||
rect2.setRect(rect1.left(), rect1.bottom(), rect1.width(), rect.height() - rect1.height());
|
||||
rect1.setRect(rec.left(), rec.top(), rec.width(), rec.height() * .5);
|
||||
rect2.setRect(rect1.left(), rect1.bottom(), rect1.width(), rec.height() - rect1.height());
|
||||
offset1 = rect1.center().x();
|
||||
offset2 = rect2.center().x();
|
||||
}
|
||||
else {
|
||||
type = Node::Type::HORIZONTAL;
|
||||
rect1.setRect(rect.left(), rect.top(), rect.width() * .5, rect.height());
|
||||
rect2.setRect(rect1.right(), rect1.top(), rect.width() - rect1.width(), rect1.height());
|
||||
rect1.setRect(rec.left(), rec.top(), rec.width() * .5, rec.height());
|
||||
rect2.setRect(rect1.right(), rect1.top(), rec.width() - rect1.width(), rect1.height());
|
||||
offset1 = rect1.center().y();
|
||||
offset2 = rect2.center().y();
|
||||
}
|
||||
|
@ -240,8 +240,8 @@ void BspTree::initialize(const QRectF& rect, int depth, int index)
|
|||
child->offset = offset2;
|
||||
child->type = type;
|
||||
|
||||
initialize(rect1, depth - 1, childIndex);
|
||||
initialize(rect2, depth - 1, childIndex + 1);
|
||||
initialize(rect1, dep - 1, childIndex);
|
||||
initialize(rect2, dep - 1, childIndex + 1);
|
||||
}
|
||||
else {
|
||||
node->type = Node::Type::LEAF;
|
||||
|
@ -284,7 +284,7 @@ void BspTree::climbTree(BspTreeVisitor* visitor, const QPointF& pos, int index)
|
|||
// climbTree
|
||||
//---------------------------------------------------------
|
||||
|
||||
void BspTree::climbTree(BspTreeVisitor* visitor, const QRectF& rect, int index)
|
||||
void BspTree::climbTree(BspTreeVisitor* visitor, const QRectF& rec, int index)
|
||||
{
|
||||
if (nodes.empty())
|
||||
return;
|
||||
|
@ -297,23 +297,23 @@ void BspTree::climbTree(BspTreeVisitor* visitor, const QRectF& rect, int index)
|
|||
visitor->visit(&leaves[node->leafIndex]);
|
||||
break;
|
||||
case Node::Type::VERTICAL:
|
||||
if (rect.left() < node->offset) {
|
||||
climbTree(visitor, rect, childIndex);
|
||||
if (rect.right() >= node->offset)
|
||||
climbTree(visitor, rect, childIndex + 1);
|
||||
if (rec.left() < node->offset) {
|
||||
climbTree(visitor, rec, childIndex);
|
||||
if (rec.right() >= node->offset)
|
||||
climbTree(visitor, rec, childIndex + 1);
|
||||
}
|
||||
else {
|
||||
climbTree(visitor, rect, childIndex + 1);
|
||||
climbTree(visitor, rec, childIndex + 1);
|
||||
}
|
||||
break;
|
||||
case Node::Type::HORIZONTAL:
|
||||
if (rect.top() < node->offset) {
|
||||
climbTree(visitor, rect, childIndex);
|
||||
if (rect.bottom() >= node->offset)
|
||||
climbTree(visitor, rect, childIndex + 1);
|
||||
if (rec.top() < node->offset) {
|
||||
climbTree(visitor, rec, childIndex);
|
||||
if (rec.bottom() >= node->offset)
|
||||
climbTree(visitor, rec, childIndex + 1);
|
||||
}
|
||||
else {
|
||||
climbTree(visitor, rect, childIndex + 1);
|
||||
climbTree(visitor, rec, childIndex + 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -328,22 +328,22 @@ QRectF BspTree::rectForIndex(int index) const
|
|||
return rect;
|
||||
|
||||
int parentIdx = parentIndex(index);
|
||||
QRectF rect = rectForIndex(parentIdx);
|
||||
QRectF rec = rectForIndex(parentIdx);
|
||||
const Node *parent = &nodes.at(parentIdx);
|
||||
|
||||
if (parent->type == Node::Type::HORIZONTAL) {
|
||||
if (index & 1)
|
||||
rect.setRight(parent->offset);
|
||||
rec.setRight(parent->offset);
|
||||
else
|
||||
rect.setLeft(parent->offset);
|
||||
rec.setLeft(parent->offset);
|
||||
}
|
||||
else {
|
||||
if (index & 1)
|
||||
rect.setBottom(parent->offset);
|
||||
rec.setBottom(parent->offset);
|
||||
else
|
||||
rect.setTop(parent->offset);
|
||||
rec.setTop(parent->offset);
|
||||
}
|
||||
return rect;
|
||||
return rec;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -628,7 +628,7 @@ void Chord::addLedgerLines()
|
|||
// the line pos corresponding to the bottom line of the staff
|
||||
int lineBelow = 8; // assuming 5-lined "staff"
|
||||
qreal lineDistance = 1;
|
||||
qreal _mag = 1;
|
||||
qreal mag = 1;
|
||||
bool staffVisible = true;
|
||||
|
||||
if (segment()) { //not palette
|
||||
|
@ -638,7 +638,7 @@ void Chord::addLedgerLines()
|
|||
Staff* st = score()->staff(idx);
|
||||
lineBelow = (st->lines(tick) - 1) * 2;
|
||||
lineDistance = st->lineDistance(tick);
|
||||
_mag = staff()->mag(tick);
|
||||
mag = staff()->mag(tick);
|
||||
staffVisible = !staff()->invisible();
|
||||
}
|
||||
|
||||
|
@ -647,7 +647,7 @@ void Chord::addLedgerLines()
|
|||
return;
|
||||
|
||||
// the extra length of a ledger line with respect to notehead (half of it on each side)
|
||||
qreal extraLen = score()->styleP(Sid::ledgerLineLength) * _mag * 0.5;
|
||||
qreal extraLen = score()->styleP(Sid::ledgerLineLength) * mag * 0.5;
|
||||
qreal hw = _notes[0]->headWidth();
|
||||
qreal minX, maxX; // note extrema in raster units
|
||||
int minLine, maxLine;
|
||||
|
@ -1494,7 +1494,7 @@ void Chord::layout2()
|
|||
c->layout2();
|
||||
|
||||
qreal _spatium = spatium();
|
||||
qreal _mag = staff()->mag(tick());
|
||||
qreal mag = staff()->mag(tick());
|
||||
|
||||
//
|
||||
// Experimental:
|
||||
|
@ -1552,7 +1552,7 @@ void Chord::layout2()
|
|||
|
||||
QVector<Chord*> gna = graceNotesAfter();
|
||||
if (!gna.empty()) {
|
||||
qreal minNoteDist = score()->styleP(Sid::minNoteDistance) * _mag * score()->styleD(Sid::graceNoteMag);
|
||||
qreal minNoteDist = score()->styleP(Sid::minNoteDistance) * mag * score()->styleD(Sid::graceNoteMag);
|
||||
// position grace notes from the rightmost to the leftmost
|
||||
// get segment (of whatever type) at the end of this chord; if none, get measure last segment
|
||||
Segment* s = measure()->tick2segment(segment()->tick() + actualTicks(), SegmentType::All);
|
||||
|
@ -1566,7 +1566,7 @@ void Chord::layout2()
|
|||
// final distance: if near to another chord, leave minNoteDist at right of last grace
|
||||
// else leave note-to-barline distance;
|
||||
xOff -= (s != nullptr && s->segmentType() != SegmentType::ChordRest)
|
||||
? score()->styleP(Sid::noteBarDistance) * _mag
|
||||
? score()->styleP(Sid::noteBarDistance) * mag
|
||||
: minNoteDist;
|
||||
// scan grace note list from the end
|
||||
int n = gna.size();
|
||||
|
@ -1725,11 +1725,11 @@ void Chord::layoutPitched()
|
|||
c->layoutPitched();
|
||||
|
||||
qreal _spatium = spatium();
|
||||
qreal _mag = staff() ? staff()->mag(tick()) : 1.0; // palette elements do not have a staff
|
||||
qreal dotNoteDistance = score()->styleP(Sid::dotNoteDistance) * _mag;
|
||||
qreal minNoteDistance = score()->styleP(Sid::minNoteDistance) * _mag;
|
||||
qreal minTieLength = score()->styleP(Sid::MinTieLength) * _mag;
|
||||
qreal ledgerLineLength = score()->styleP(Sid::ledgerLineLength) * _mag;
|
||||
qreal mag_ = staff() ? staff()->mag(tick()) : 1.0; // palette elements do not have a staff
|
||||
qreal dotNoteDistance = score()->styleP(Sid::dotNoteDistance) * mag_;
|
||||
qreal minNoteDistance = score()->styleP(Sid::minNoteDistance) * mag_;
|
||||
qreal minTieLength = score()->styleP(Sid::MinTieLength) * mag_;
|
||||
qreal ledgerLineLength = score()->styleP(Sid::ledgerLineLength) * mag_;
|
||||
|
||||
qreal graceMag = score()->styleD(Sid::graceNoteMag);
|
||||
qreal chordX = (_noteType == NoteType::NORMAL) ? ipos().x() : 0.0;
|
||||
|
@ -1790,7 +1790,7 @@ void Chord::layoutPitched()
|
|||
qreal x = accidental->pos().x() + note->pos().x() + chordX;
|
||||
// distance from accidental to note already taken into account
|
||||
// but here perhaps we create more padding in *front* of accidental?
|
||||
x -= score()->styleP(Sid::accidentalDistance) * _mag;
|
||||
x -= score()->styleP(Sid::accidentalDistance) * mag_;
|
||||
lll = qMax(lll, -x);
|
||||
}
|
||||
|
||||
|
@ -1852,7 +1852,7 @@ void Chord::layoutPitched()
|
|||
addLedgerLines();
|
||||
|
||||
if (_arpeggio) {
|
||||
qreal arpeggioDistance = score()->styleP(Sid::ArpeggioNoteDistance) * _mag;
|
||||
qreal arpeggioDistance = score()->styleP(Sid::ArpeggioNoteDistance) * mag_;
|
||||
_arpeggio->layout(); // only for width() !
|
||||
lll += _arpeggio->width() + arpeggioDistance + chordX;
|
||||
qreal y1 = upnote->pos().y() - upnote->headHeight() * .5;
|
||||
|
@ -1874,7 +1874,7 @@ void Chord::layoutPitched()
|
|||
|
||||
if (dots()) {
|
||||
qreal x = dotPosX() + dotNoteDistance
|
||||
+ (dots()-1) * score()->styleP(Sid::dotDotDistance) * _mag;
|
||||
+ (dots()-1) * score()->styleP(Sid::dotDotDistance) * mag_;
|
||||
x += symWidth(SymId::augmentationDot);
|
||||
rrr = qMax(rrr, x);
|
||||
}
|
||||
|
|
|
@ -499,8 +499,8 @@ void LayoutContext::layoutMeasureLinear(MeasureBase* mb)
|
|||
KeySig* ks = toKeySig(segment.element(staffIdx * VOICES));
|
||||
if (!ks)
|
||||
continue;
|
||||
int tick = segment.tick();
|
||||
as.init(staff->keySigEvent(tick), staff->clef(tick));
|
||||
int t = segment.tick();
|
||||
as.init(staff->keySigEvent(t), staff->clef(t));
|
||||
ks->layout();
|
||||
}
|
||||
else if (segment.isChordRestType()) {
|
||||
|
@ -578,7 +578,7 @@ void LayoutContext::layoutMeasureLinear(MeasureBase* mb)
|
|||
for (Segment& segment : measure->segments()) {
|
||||
if (segment.isBreathType()) {
|
||||
qreal length = 0.0;
|
||||
int tick = segment.tick();
|
||||
int t = segment.tick();
|
||||
// find longest pause
|
||||
for (int i = 0, n = score->ntracks(); i < n; ++i) {
|
||||
Element* e = segment.element(i);
|
||||
|
@ -589,7 +589,7 @@ void LayoutContext::layoutMeasureLinear(MeasureBase* mb)
|
|||
}
|
||||
}
|
||||
if (length != 0.0)
|
||||
score->setPause(tick, length);
|
||||
score->setPause(t, length);
|
||||
}
|
||||
else if (segment.isTimeSigType()) {
|
||||
for (int staffIdx = 0; staffIdx < score->nstaves(); ++staffIdx) {
|
||||
|
|
|
@ -430,15 +430,9 @@ void LyricsLineSegment::layout()
|
|||
rypos() = lyr->ipos().y();
|
||||
else {
|
||||
// use Y position of *next* syllable if there is one on same system
|
||||
<<<<<<< HEAD
|
||||
Lyrics* nextLyr = searchNextLyrics(lyr->segment(), lyr->staffIdx(), lyr->no(), lyr->placement());
|
||||
if (nextLyr && nextLyr->segment()->system() == system())
|
||||
rypos() = nextLyr->ipos().y();
|
||||
=======
|
||||
Lyrics* nextLyr1 = searchNextLyrics(lyr->segment(), lyr->staffIdx(), lyr->no(), lyr->placement());
|
||||
if (nextLyr1 && nextLyr1->segment()->system() == system())
|
||||
rypos() = nextLyr1->y();
|
||||
>>>>>>> fix #275218: fix C4456 warnings
|
||||
rypos() = nextLyr1->ipos().y();
|
||||
else
|
||||
rypos() = lyr->ipos().y();
|
||||
}
|
||||
|
|
|
@ -136,10 +136,10 @@ void TrackList::append(Element* e)
|
|||
|
||||
if (s && !s->score()->isSpannerStartEnd(s->tick(), e->track()) && !s->annotations().size()) {
|
||||
// akkumulate rests
|
||||
Rest* rest = toRest(back());
|
||||
Fraction d = rest->duration();
|
||||
d += toRest(e)->duration();
|
||||
rest->setDuration(d);
|
||||
Rest* rest = toRest(back());
|
||||
Fraction du = rest->duration();
|
||||
du += toRest(e)->duration();
|
||||
rest->setDuration(du);
|
||||
}
|
||||
else {
|
||||
Element* element = 0;
|
||||
|
@ -173,10 +173,10 @@ void TrackList::append(Element* e)
|
|||
}
|
||||
}
|
||||
if (akkumulateChord && back()->isChord()) {
|
||||
Chord* bc = toChord(back());
|
||||
Fraction d = bc->duration();
|
||||
d += bc->duration();
|
||||
bc->setDuration(d);
|
||||
Chord* bc = toChord(back());
|
||||
Fraction du = bc->duration();
|
||||
du += bc->duration();
|
||||
bc->setDuration(du);
|
||||
|
||||
// forward ties
|
||||
int idx = 0;
|
||||
|
@ -206,23 +206,23 @@ void TrackList::append(Element* e)
|
|||
// appendGap
|
||||
//---------------------------------------------------------
|
||||
|
||||
void TrackList::appendGap(const Fraction& d)
|
||||
void TrackList::appendGap(const Fraction& du)
|
||||
{
|
||||
if (d.isZero())
|
||||
if (du.isZero())
|
||||
return;
|
||||
Element* e = empty() ? 0 : back();
|
||||
if (e && e->isRest()) {
|
||||
Rest* rest = toRest(back());
|
||||
Fraction dd = rest->duration();
|
||||
dd += d;
|
||||
_duration += d;
|
||||
dd += du;
|
||||
_duration += du;
|
||||
rest->setDuration(dd);
|
||||
}
|
||||
else {
|
||||
Rest* rest = new Rest(0);
|
||||
rest->setDuration(d);
|
||||
rest->setDuration(du);
|
||||
QList<Element*>::append(rest);
|
||||
_duration += d;
|
||||
_duration += du;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -352,10 +352,10 @@ Tuplet* TrackList::writeTuplet(Tuplet* parent, Tuplet* tuplet, Measure*& measure
|
|||
Score* score = measure->score();
|
||||
Tuplet* dt = tuplet->clone();
|
||||
dt->setParent(measure);
|
||||
Fraction d = tuplet->duration();
|
||||
if (d > rest) {
|
||||
Fraction du = tuplet->duration();
|
||||
if (du > rest) {
|
||||
// we must split the tuplet
|
||||
dt->setDuration(d * Fraction(1, 2));
|
||||
dt->setDuration(du * Fraction(1, 2));
|
||||
dt->setBaseLen(tuplet->baseLen().shift(1));
|
||||
}
|
||||
if (parent)
|
||||
|
@ -505,11 +505,11 @@ bool TrackList::write(Score* score, int tick) const
|
|||
remains.set(0, 1);
|
||||
}
|
||||
else if (e->isChordRest()) {
|
||||
Fraction d = qMin(remains, duration);
|
||||
std::vector<TDuration> dl = toDurationList(d, e->isChord());
|
||||
Fraction du = qMin(remains, duration);
|
||||
std::vector<TDuration> dl = toDurationList(du, e->isChord());
|
||||
|
||||
if (dl.empty())
|
||||
qDebug("duration d %d/%d", d.numerator(), d.denominator());
|
||||
qDebug("duration d %d/%d", du.numerator(), du.denominator());
|
||||
Q_ASSERT(!dl.empty());
|
||||
for (const TDuration& k : dl) {
|
||||
segment = m->undoGetSegment(SegmentType::ChordRest, m->len() - remains);
|
||||
|
@ -770,8 +770,8 @@ void TrackList::dump() const
|
|||
qDebug("elements %d, duration %d/%d", size(), _duration.numerator(), _duration.denominator());
|
||||
for (Element* e : *this) {
|
||||
if (e->isDurationElement()) {
|
||||
Fraction d = toDurationElement(e)->duration();
|
||||
qDebug(" %s %d/%d", e->name(), d.numerator(), d.denominator());
|
||||
Fraction du = toDurationElement(e)->duration();
|
||||
qDebug(" %s %d/%d", e->name(), du.numerator(), du.denominator());
|
||||
}
|
||||
else
|
||||
qDebug(" %s", e->name());
|
||||
|
|
|
@ -1558,18 +1558,18 @@ class XmlNesting : public QStack<QString> {
|
|||
void TextBase::genText()
|
||||
{
|
||||
_text.clear();
|
||||
bool _bold = false;
|
||||
bool _italic = false;
|
||||
bool _underline = false;
|
||||
bool bold_ = false;
|
||||
bool italic_ = false;
|
||||
bool underline_ = false;
|
||||
|
||||
for (const TextBlock& block : _layout) {
|
||||
for (const TextFragment& f : block.fragments()) {
|
||||
if (!f.format.bold() && bold())
|
||||
_bold = true;
|
||||
bold_ = true;
|
||||
if (!f.format.italic() && italic())
|
||||
_italic = true;
|
||||
italic_ = true;
|
||||
if (!f.format.underline() && underline())
|
||||
_underline = true;
|
||||
underline_ = true;
|
||||
}
|
||||
}
|
||||
CharFormat fmt;
|
||||
|
@ -1582,11 +1582,11 @@ void TextBase::genText()
|
|||
fmt.setValign(VerticalAlignment::AlignNormal);
|
||||
|
||||
XmlNesting xmlNesting(&_text);
|
||||
if (_bold)
|
||||
if (bold_)
|
||||
xmlNesting.pushB();
|
||||
if (_italic)
|
||||
if (italic_)
|
||||
xmlNesting.pushI();
|
||||
if (_underline)
|
||||
if (underline_)
|
||||
xmlNesting.pushU();
|
||||
|
||||
for (const TextBlock& block : _layout) {
|
||||
|
@ -1912,8 +1912,8 @@ QString TextBase::convertFromHtml(const QString& ss) const
|
|||
doc.setHtml(ss);
|
||||
|
||||
QString s;
|
||||
qreal _size = size();
|
||||
QString _family = family();
|
||||
qreal size_ = size();
|
||||
QString family_ = family();
|
||||
for (auto b = doc.firstBlock(); b.isValid() ; b = b.next()) {
|
||||
if (!s.isEmpty())
|
||||
s += "\n";
|
||||
|
@ -1926,13 +1926,13 @@ QString TextBase::convertFromHtml(const QString& ss) const
|
|||
// html font sizes may have spatium adjustments; need to undo this
|
||||
if (sizeIsSpatiumDependent())
|
||||
htmlSize *= SPATIUM20 / spatium();
|
||||
if (fabs(_size - htmlSize) > 0.1) {
|
||||
_size = htmlSize;
|
||||
s += QString("<font size=\"%1\"/>").arg(_size);
|
||||
if (fabs(size_ - htmlSize) > 0.1) {
|
||||
size_ = htmlSize;
|
||||
s += QString("<font size=\"%1\"/>").arg(size_);
|
||||
}
|
||||
if (_family != font.family()) {
|
||||
_family = font.family();
|
||||
s += QString("<font face=\"%1\"/>").arg(_family);
|
||||
if (family_ != font.family()) {
|
||||
family_ = font.family();
|
||||
s += QString("<font face=\"%1\"/>").arg(family_);
|
||||
}
|
||||
if (font.bold())
|
||||
s += "<b>";
|
||||
|
|
|
@ -1595,11 +1595,11 @@ void VoltaObj::read()
|
|||
y = cap->readInt();
|
||||
color = cap->readColor();
|
||||
|
||||
unsigned char flags = cap->readByte();
|
||||
bLeft = (flags & 1) != 0; // links abgeknickt
|
||||
bRight = (flags & 2) != 0; // rechts abgeknickt
|
||||
bDotted = (flags & 4) != 0;
|
||||
allNumbers = (flags & 8) != 0;
|
||||
unsigned char f = cap->readByte();
|
||||
bLeft = (f & 1) != 0; // links abgeknickt
|
||||
bRight = (f & 2) != 0; // rechts abgeknickt
|
||||
bDotted = (f & 4) != 0;
|
||||
allNumbers = (f & 8) != 0;
|
||||
|
||||
unsigned char numbers = cap->readByte();
|
||||
from = numbers & 0x0F;
|
||||
|
|
|
@ -450,7 +450,7 @@ void ChordView::mousePressEvent(QMouseEvent* event)
|
|||
QPointF p(mapToScene(event->pos()));
|
||||
int pitch = y2pitch(int(p.y()));
|
||||
int tick = int(p.x()) - CHORD_MAP_OFFSET;
|
||||
int ticks = 1000 - tick;
|
||||
int tcks = 1000 - tick;
|
||||
foreach(const NoteEvent& e, _curNote->playEvents()) {
|
||||
if (e.pitch() != pitch)
|
||||
continue;
|
||||
|
@ -459,13 +459,13 @@ void ChordView::mousePressEvent(QMouseEvent* event)
|
|||
}
|
||||
int nticks = e.ontime() - tick;
|
||||
if (nticks > 0)
|
||||
ticks = qMin(ticks, nticks);
|
||||
tcks = qMin(tcks, nticks);
|
||||
}
|
||||
|
||||
NoteEvent ne;
|
||||
ne.setPitch(pitch);
|
||||
ne.setOntime(tick);
|
||||
ne.setLen(ticks);
|
||||
ne.setLen(tcks);
|
||||
_curNote->playEvents().append(ne);
|
||||
NoteEvent* pne = &_curNote->playEvents()[_curNote->playEvents().size()-1];
|
||||
ChordItem* item = new ChordItem(this, _curNote, pne);
|
||||
|
|
|
@ -466,10 +466,10 @@ void Debugger::updateList(Score* s)
|
|||
}
|
||||
}
|
||||
|
||||
foreach (Page* page, cs->pages()) {
|
||||
ElementItem* pi = new ElementItem(list, page);
|
||||
foreach (Page* pg, cs->pages()) {
|
||||
ElementItem* pi = new ElementItem(list, pg);
|
||||
|
||||
for (System* system : page->systems()) {
|
||||
for (System* system : pg->systems()) {
|
||||
ElementItem* si = new ElementItem(pi, system);
|
||||
for (Bracket* b : system->brackets())
|
||||
new ElementItem(si, b);
|
||||
|
@ -811,11 +811,11 @@ void MeasureView::setElement(Element* e)
|
|||
mb.hasCourtesyKeySig->setChecked(m->hasCourtesyKeySig());
|
||||
mb.hasVoices->setChecked(m->hasVoices(0));
|
||||
mb.sel->clear();
|
||||
for (const Element* el : m->el()) {
|
||||
for (const Element* elm : m->el()) {
|
||||
QTreeWidgetItem* item = new QTreeWidgetItem;
|
||||
item->setText(0, el->name());
|
||||
// item->setText(1, QString("%1").arg(el->subtype()));
|
||||
void* p = (void*) el;
|
||||
item->setText(0, elm->name());
|
||||
// item->setText(1, QString("%1").arg(elm->subtype()));
|
||||
void* p = (void*) elm;
|
||||
item->setData(0, Qt::UserRole, QVariant::fromValue<void*>(p));
|
||||
mb.sel->addTopLevelItem(item);
|
||||
}
|
||||
|
@ -1168,8 +1168,8 @@ void ShowNoteWidget::setElement(Element* e)
|
|||
nb.fingering->addItem(item);
|
||||
}
|
||||
nb.noteEvents->clear();
|
||||
for (const NoteEvent& el : note->playEvents()) {
|
||||
QString s = QString("%1 %2 %3").arg(el.pitch()).arg(el.ontime()).arg(el.len());
|
||||
for (const NoteEvent& elm : note->playEvents()) {
|
||||
QString s = QString("%1 %2 %3").arg(elm.pitch()).arg(elm.ontime()).arg(elm.len());
|
||||
QListWidgetItem* item = new QListWidgetItem(s);
|
||||
nb.noteEvents->addItem(item);
|
||||
}
|
||||
|
@ -1568,10 +1568,10 @@ void SpannerView::setElement(Element* e)
|
|||
sp.track2->setValue(spanner->track2());
|
||||
|
||||
sp.segments->clear();
|
||||
for (const Element* el : spanner->spannerSegments()) {
|
||||
for (const Element* elm : spanner->spannerSegments()) {
|
||||
QTreeWidgetItem* item = new QTreeWidgetItem;
|
||||
item->setText(0, el->name());
|
||||
void* p = (void*) el;
|
||||
item->setText(0, elm->name());
|
||||
void* p = (void*) elm;
|
||||
item->setData(0, Qt::UserRole, QVariant::fromValue<void*>(p));
|
||||
sp.segments->addTopLevelItem(item);
|
||||
}
|
||||
|
@ -1741,12 +1741,12 @@ void TupletView::setElement(Element* e)
|
|||
tb.duration->setText(tuplet->duration().print());
|
||||
|
||||
tb.elements->clear();
|
||||
for (DurationElement* el : tuplet->elements()) {
|
||||
for (DurationElement* elm : tuplet->elements()) {
|
||||
QTreeWidgetItem* item = new QTreeWidgetItem;
|
||||
item->setText(0, el->name());
|
||||
item->setText(1, QString("%1").arg(el->tick()));
|
||||
item->setText(2, QString("%1").arg(el->actualTicks()));
|
||||
void* p = (void*) el;
|
||||
item->setText(0, elm->name());
|
||||
item->setText(1, QString("%1").arg(elm->tick()));
|
||||
item->setText(2, QString("%1").arg(elm->actualTicks()));
|
||||
void* p = (void*) elm;
|
||||
item->setData(0, Qt::UserRole, QVariant::fromValue<void*>(p));
|
||||
tb.elements->addTopLevelItem(item);
|
||||
}
|
||||
|
@ -2119,8 +2119,8 @@ void VoltaView::setElement(Element* e)
|
|||
// lb.rightElement->setText(QString("%1").arg((unsigned long)volta->endElement(), 8, 16));
|
||||
|
||||
sp.segments->clear();
|
||||
const QList<SpannerSegment*>& el = volta->spannerSegments();
|
||||
for (const SpannerSegment* elm : el) {
|
||||
const QList<SpannerSegment*>& ele = volta->spannerSegments();
|
||||
for (const SpannerSegment* elm : ele) {
|
||||
QTreeWidgetItem* item = new QTreeWidgetItem;
|
||||
item->setText(0, QString("%1").arg((quintptr)elm, 8, 16));
|
||||
item->setData(0, Qt::UserRole, QVariant::fromValue<void*>((void*)elm));
|
||||
|
@ -2780,10 +2780,10 @@ void SystemView::setElement(Element* e)
|
|||
System* vs = (System*)e;
|
||||
ShowElementBase::setElement(e);
|
||||
mb.spanner->clear();
|
||||
for (const Element* el : vs->spannerSegments()) {
|
||||
for (const Element* elm : vs->spannerSegments()) {
|
||||
QTreeWidgetItem* item = new QTreeWidgetItem;
|
||||
item->setText(0, el->name());
|
||||
void* p = (void*) el;
|
||||
item->setText(0, elm->name());
|
||||
void* p = (void*) elm;
|
||||
item->setData(0, Qt::UserRole, QVariant::fromValue<void*>(p));
|
||||
mb.spanner->addTopLevelItem(item);
|
||||
}
|
||||
|
|
|
@ -198,17 +198,17 @@ void ScoreView::dragEnterEvent(QDragEnterEvent* event)
|
|||
double _spatium = score()->spatium();
|
||||
editData.element = 0;
|
||||
|
||||
const QMimeData* data = event->mimeData();
|
||||
const QMimeData* dta = event->mimeData();
|
||||
|
||||
if (data->hasFormat(mimeSymbolListFormat) || data->hasFormat(mimeStaffListFormat)) {
|
||||
if (dta->hasFormat(mimeSymbolListFormat) || dta->hasFormat(mimeStaffListFormat)) {
|
||||
event->accept();
|
||||
return;
|
||||
}
|
||||
|
||||
if (data->hasFormat(mimeSymbolFormat)) {
|
||||
if (dta->hasFormat(mimeSymbolFormat)) {
|
||||
event->accept();
|
||||
|
||||
QByteArray a = data->data(mimeSymbolFormat);
|
||||
QByteArray a = dta->data(mimeSymbolFormat);
|
||||
|
||||
if (MScore::debugMode)
|
||||
qDebug("ScoreView::dragEnterEvent Symbol: <%s>", a.data());
|
||||
|
@ -230,8 +230,8 @@ void ScoreView::dragEnterEvent(QDragEnterEvent* event)
|
|||
return;
|
||||
}
|
||||
|
||||
if (data->hasUrls()) {
|
||||
QList<QUrl>ul = data->urls();
|
||||
if (dta->hasUrls()) {
|
||||
QList<QUrl>ul = dta->urls();
|
||||
for (const QUrl& u : ul) {
|
||||
if (MScore::debugMode)
|
||||
qDebug("drag Url: %s", qPrintable(u.toString()));
|
||||
|
@ -252,7 +252,7 @@ void ScoreView::dragEnterEvent(QDragEnterEvent* event)
|
|||
return;
|
||||
}
|
||||
qDebug("unknown drop format: formats:");
|
||||
for (const QString& s : data->formats())
|
||||
for (const QString& s : dta->formats())
|
||||
qDebug(" <%s>", qPrintable(s));
|
||||
event->ignore();
|
||||
}
|
||||
|
@ -428,15 +428,15 @@ void ScoreView::dragMoveEvent(QDragMoveEvent* event)
|
|||
// _score->update();
|
||||
return;
|
||||
}
|
||||
QByteArray data;
|
||||
QByteArray dta;
|
||||
ElementType etype;
|
||||
if (md->hasFormat(mimeSymbolListFormat)) {
|
||||
etype = ElementType::ELEMENT_LIST;
|
||||
data = md->data(mimeSymbolListFormat);
|
||||
dta = md->data(mimeSymbolListFormat);
|
||||
}
|
||||
else if (md->hasFormat(mimeStaffListFormat)) {
|
||||
etype = ElementType::STAFF_LIST;
|
||||
data = md->data(mimeStaffListFormat);
|
||||
dta = md->data(mimeStaffListFormat);
|
||||
}
|
||||
else {
|
||||
// _score->update();
|
||||
|
@ -698,15 +698,15 @@ void ScoreView::dropEvent(QDropEvent* event)
|
|||
|
||||
editData.element = 0;
|
||||
const QMimeData* md = event->mimeData();
|
||||
QByteArray data;
|
||||
QByteArray dta;
|
||||
ElementType etype;
|
||||
if (md->hasFormat(mimeSymbolListFormat)) {
|
||||
etype = ElementType::ELEMENT_LIST;
|
||||
data = md->data(mimeSymbolListFormat);
|
||||
dta = md->data(mimeSymbolListFormat);
|
||||
}
|
||||
else if (md->hasFormat(mimeStaffListFormat)) {
|
||||
etype = ElementType::STAFF_LIST;
|
||||
data = md->data(mimeStaffListFormat);
|
||||
dta = md->data(mimeStaffListFormat);
|
||||
}
|
||||
else {
|
||||
qDebug("cannot drop this object: unknown mime type");
|
||||
|
@ -731,7 +731,7 @@ void ScoreView::dropEvent(QDropEvent* event)
|
|||
}
|
||||
else if (etype == ElementType::MEASURE_LIST || etype == ElementType::STAFF_LIST) {
|
||||
_score->startCmd();
|
||||
XmlReader xml(data);
|
||||
XmlReader xml(dta);
|
||||
System* s = measure->system();
|
||||
int idx = s->y2staff(pos.y());
|
||||
if (idx != -1) {
|
||||
|
|
|
@ -366,9 +366,9 @@ void DrumrollEditor::velocityChanged(int val)
|
|||
// keyPressed
|
||||
//---------------------------------------------------------
|
||||
|
||||
void DrumrollEditor::keyPressed(int pitch)
|
||||
void DrumrollEditor::keyPressed(int p)
|
||||
{
|
||||
seq->startNote(staff->part()->instrument()->channel(0)->channel, pitch, 80, 0, 0.0);
|
||||
seq->startNote(staff->part()->instrument()->channel(0)->channel, p, 80, 0, 0.0);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------
|
||||
|
|
|
@ -54,14 +54,14 @@ EditStyle::EditStyle(Score* s, QWidget* parent)
|
|||
fretNumGroup->addButton(radioFretNumLeft, 0);
|
||||
fretNumGroup->addButton(radioFretNumRight, 1);
|
||||
|
||||
QButtonGroup* keySigNatGroup = new QButtonGroup(this);
|
||||
keySigNatGroup->addButton(radioKeySigNatNone, int(KeySigNatural::NONE));
|
||||
keySigNatGroup->addButton(radioKeySigNatBefore, int(KeySigNatural::BEFORE));
|
||||
keySigNatGroup->addButton(radioKeySigNatAfter, int(KeySigNatural::AFTER));
|
||||
QButtonGroup* ksng = new QButtonGroup(this);
|
||||
ksng->addButton(radioKeySigNatNone, int(KeySigNatural::NONE));
|
||||
ksng->addButton(radioKeySigNatBefore, int(KeySigNatural::BEFORE));
|
||||
ksng->addButton(radioKeySigNatAfter, int(KeySigNatural::AFTER));
|
||||
|
||||
QButtonGroup* clefTypeGroup = new QButtonGroup(this);
|
||||
clefTypeGroup->addButton(clefTab1, int(ClefType::TAB));
|
||||
clefTypeGroup->addButton(clefTab2, int(ClefType::TAB_SERIF));
|
||||
QButtonGroup* ctg = new QButtonGroup(this);
|
||||
ctg->addButton(clefTab1, int(ClefType::TAB));
|
||||
ctg->addButton(clefTab2, int(ClefType::TAB_SERIF));
|
||||
|
||||
QButtonGroup* fbAlign = new QButtonGroup(this);
|
||||
fbAlign->addButton(radioFBTop, 0);
|
||||
|
@ -79,24 +79,24 @@ EditStyle::EditStyle(Score* s, QWidget* parent)
|
|||
QT_TRANSLATE_NOOP("EditStyleBase", "Dash-dotted"),
|
||||
QT_TRANSLATE_NOOP("EditStyleBase", "Dash-dot-dotted")
|
||||
};
|
||||
int data = 1;
|
||||
int dta = 1;
|
||||
voltaLineStyle->clear();
|
||||
ottavaLineStyle->clear();
|
||||
pedalLineStyle->clear();
|
||||
for (const char* p : styles) {
|
||||
QString trs = qApp->translate("EditStyleBase", p);
|
||||
voltaLineStyle->addItem(trs, data);
|
||||
ottavaLineStyle->addItem(trs, data);
|
||||
pedalLineStyle->addItem(trs, data);
|
||||
++data;
|
||||
voltaLineStyle->addItem(trs, dta);
|
||||
ottavaLineStyle->addItem(trs, dta);
|
||||
pedalLineStyle->addItem(trs, dta);
|
||||
++dta;
|
||||
}
|
||||
|
||||
styleWidgets = {
|
||||
// idx --- showPercent --- widget --- resetButton
|
||||
{ Sid::figuredBassAlignment, false, fbAlign, 0 },
|
||||
{ Sid::figuredBassStyle, false, fbStyle, 0 },
|
||||
{ Sid::tabClef, false, clefTypeGroup, 0 },
|
||||
{ Sid::keySigNaturals, false, keySigNatGroup, 0 },
|
||||
{ Sid::tabClef, false, ctg, 0 },
|
||||
{ Sid::keySigNaturals, false, ksng, 0 },
|
||||
{ Sid::voltaLineStyle, false, voltaLineStyle, resetVoltaLineStyle },
|
||||
{ Sid::ottavaLineStyle, false, ottavaLineStyle, resetOttavaLineStyle },
|
||||
{ Sid::pedalLineStyle, false, pedalLineStyle, resetPedalLineStyle },
|
||||
|
|
|
@ -225,15 +225,15 @@ bool MuseScore::saveAudio(Score* score, const QString& name)
|
|||
}
|
||||
}
|
||||
|
||||
virtual qint64 readData(char *data, qint64 maxlen) override final {
|
||||
Q_UNUSED(data);
|
||||
virtual qint64 readData(char *dta, qint64 maxlen) override final {
|
||||
Q_UNUSED(dta);
|
||||
qDebug() << "Error: No write supported!";
|
||||
return maxlen;
|
||||
}
|
||||
|
||||
virtual qint64 writeData(const char *data, qint64 len) override final {
|
||||
virtual qint64 writeData(const char *dta, qint64 len) override final {
|
||||
size_t trueFrames = len / sizeof(float) / 2;
|
||||
sf_writef_float(sf, reinterpret_cast<const float*>(data), trueFrames);
|
||||
sf_writef_float(sf, reinterpret_cast<const float*>(dta), trueFrames);
|
||||
return trueFrames * 2 * sizeof(float);
|
||||
}
|
||||
|
||||
|
|
214
mscore/file.cpp
214
mscore/file.cpp
|
@ -396,9 +396,9 @@ bool MuseScore::saveFile(MasterScore* score)
|
|||
QString f1 = tr("MuseScore File") + " (*.mscz)";
|
||||
QString f2 = tr("Uncompressed MuseScore File") + " (*.mscx)";
|
||||
|
||||
QSettings settings;
|
||||
QSettings set;
|
||||
if (mscore->lastSaveDirectory.isEmpty())
|
||||
mscore->lastSaveDirectory = settings.value("lastSaveDirectory", preferences.getString(PREF_APP_PATHS_MYSCORES)).toString();
|
||||
mscore->lastSaveDirectory = set.value("lastSaveDirectory", preferences.getString(PREF_APP_PATHS_MYSCORES)).toString();
|
||||
QString saveDirectory = mscore->lastSaveDirectory;
|
||||
|
||||
if (saveDirectory.isEmpty())
|
||||
|
@ -811,14 +811,14 @@ static QList<QUrl> sidebarUrls()
|
|||
|
||||
QStringList MuseScore::getOpenScoreNames(const QString& filter, const QString& title)
|
||||
{
|
||||
QSettings settings;
|
||||
QString dir = settings.value("lastOpenPath", preferences.getString(PREF_APP_PATHS_MYSCORES)).toString();
|
||||
QSettings set;
|
||||
QString dir = set.value("lastOpenPath", preferences.getString(PREF_APP_PATHS_MYSCORES)).toString();
|
||||
if (preferences.getBool(PREF_UI_APP_USENATIVEDIALOGS)) {
|
||||
QStringList fileList = QFileDialog::getOpenFileNames(this,
|
||||
title, dir, filter);
|
||||
if (fileList.count() > 0) {
|
||||
QFileInfo fi(fileList[0]);
|
||||
settings.setValue("lastOpenPath", fi.absolutePath());
|
||||
set.setValue("lastOpenPath", fi.absolutePath());
|
||||
}
|
||||
return fileList;
|
||||
}
|
||||
|
@ -851,7 +851,7 @@ QStringList MuseScore::getOpenScoreNames(const QString& filter, const QString& t
|
|||
QStringList result;
|
||||
if (loadScoreDialog->exec())
|
||||
result = loadScoreDialog->selectedFiles();
|
||||
settings.setValue("lastOpenPath", loadScoreDialog->directory().absolutePath());
|
||||
set.setValue("lastOpenPath", loadScoreDialog->directory().absolutePath());
|
||||
return result;
|
||||
}
|
||||
|
||||
|
@ -1037,7 +1037,7 @@ QString MuseScore::getChordStyleFilename(bool open)
|
|||
urls.append(QUrl::fromLocalFile(defaultPath));
|
||||
urls.append(QUrl::fromLocalFile(QDir::currentPath()));
|
||||
|
||||
QSettings settings;
|
||||
QSettings set;
|
||||
if (open) {
|
||||
if (loadChordStyleDialog == 0) {
|
||||
loadChordStyleDialog = new QFileDialog(this);
|
||||
|
@ -1048,7 +1048,7 @@ QString MuseScore::getChordStyleFilename(bool open)
|
|||
loadChordStyleDialog->setDirectory(defaultPath);
|
||||
|
||||
restoreDialogState("loadChordStyleDialog", loadChordStyleDialog);
|
||||
loadChordStyleDialog->restoreState(settings.value("loadChordStyleDialog").toByteArray());
|
||||
loadChordStyleDialog->restoreState(set.value("loadChordStyleDialog").toByteArray());
|
||||
loadChordStyleDialog->setAcceptMode(QFileDialog::AcceptOpen);
|
||||
}
|
||||
// setup side bar urls
|
||||
|
@ -1386,8 +1386,8 @@ QString MuseScore::getPluginFilename(bool open)
|
|||
loadPluginDialog->setOption(QFileDialog::DontUseNativeDialog, true);
|
||||
loadPluginDialog->setDirectory(defaultPath);
|
||||
|
||||
QSettings settings;
|
||||
loadPluginDialog->restoreState(settings.value("loadPluginDialog").toByteArray());
|
||||
QSettings set;
|
||||
loadPluginDialog->restoreState(set.value("loadPluginDialog").toByteArray());
|
||||
loadPluginDialog->setAcceptMode(QFileDialog::AcceptOpen);
|
||||
}
|
||||
urls.append(QUrl::fromLocalFile(mscoreGlobalShare+"/plugins"));
|
||||
|
@ -1396,8 +1396,8 @@ QString MuseScore::getPluginFilename(bool open)
|
|||
else {
|
||||
if (savePluginDialog == 0) {
|
||||
savePluginDialog = new QFileDialog(this);
|
||||
QSettings settings;
|
||||
savePluginDialog->restoreState(settings.value("savePluginDialog").toByteArray());
|
||||
QSettings set;
|
||||
savePluginDialog->restoreState(set.value("savePluginDialog").toByteArray());
|
||||
savePluginDialog->setAcceptMode(QFileDialog::AcceptSave);
|
||||
savePluginDialog->setFileMode(QFileDialog::AnyFile);
|
||||
savePluginDialog->setOption(QFileDialog::DontConfirmOverwrite, false);
|
||||
|
@ -1550,11 +1550,11 @@ void MuseScore::printFile()
|
|||
QPainter p(&printerDev);
|
||||
p.setRenderHint(QPainter::Antialiasing, true);
|
||||
p.setRenderHint(QPainter::TextAntialiasing, true);
|
||||
double mag = printerDev.logicalDpiX() / DPI;
|
||||
double mag_ = printerDev.logicalDpiX() / DPI;
|
||||
|
||||
double pr = MScore::pixelRatio;
|
||||
MScore::pixelRatio = 1.0 / mag;
|
||||
p.scale(mag, mag);
|
||||
MScore::pixelRatio = 1.0 / mag_;
|
||||
p.scale(mag_, mag_);
|
||||
|
||||
int fromPage = printerDev.fromPage() - 1;
|
||||
int toPage = printerDev.toPage() - 1;
|
||||
|
@ -1616,9 +1616,9 @@ void MuseScore::exportFile()
|
|||
if (cs->masterScore()->fileInfo()->exists())
|
||||
saveDirectory = cs->masterScore()->fileInfo()->dir().path();
|
||||
else {
|
||||
QSettings settings;
|
||||
QSettings set;
|
||||
if (lastSaveCopyDirectory.isEmpty())
|
||||
lastSaveCopyDirectory = settings.value("lastSaveCopyDirectory", preferences.getString(PREF_APP_PATHS_MYSCORES)).toString();
|
||||
lastSaveCopyDirectory = set.value("lastSaveCopyDirectory", preferences.getString(PREF_APP_PATHS_MYSCORES)).toString();
|
||||
saveDirectory = lastSaveCopyDirectory;
|
||||
}
|
||||
|
||||
|
@ -1696,9 +1696,9 @@ bool MuseScore::exportParts()
|
|||
if (cs->masterScore()->fileInfo()->exists())
|
||||
saveDirectory = cs->masterScore()->fileInfo()->dir().path();
|
||||
else {
|
||||
QSettings settings;
|
||||
QSettings set;
|
||||
if (lastSaveCopyDirectory.isEmpty())
|
||||
lastSaveCopyDirectory = settings.value("lastSaveCopyDirectory", preferences.getString(PREF_APP_PATHS_MYSCORES)).toString();
|
||||
lastSaveCopyDirectory = set.value("lastSaveCopyDirectory", preferences.getString(PREF_APP_PATHS_MYSCORES)).toString();
|
||||
saveDirectory = lastSaveCopyDirectory;
|
||||
}
|
||||
|
||||
|
@ -1810,7 +1810,7 @@ bool MuseScore::exportParts()
|
|||
// saveAs
|
||||
//---------------------------------------------------------
|
||||
|
||||
bool MuseScore::saveAs(Score* cs, bool saveCopy, const QString& path, const QString& ext)
|
||||
bool MuseScore::saveAs(Score* cs_, bool saveCopy, const QString& path, const QString& ext)
|
||||
{
|
||||
bool rv = false;
|
||||
QString suffix = "." + ext;
|
||||
|
@ -1818,112 +1818,112 @@ bool MuseScore::saveAs(Score* cs, bool saveCopy, const QString& path, const QStr
|
|||
if (!fn.endsWith(suffix))
|
||||
fn += suffix;
|
||||
|
||||
LayoutMode layoutMode = cs->layoutMode();
|
||||
LayoutMode layoutMode = cs_->layoutMode();
|
||||
if (ext == "mscx" || ext == "mscz") {
|
||||
// save as mscore *.msc[xz] file
|
||||
QFileInfo fi(fn);
|
||||
rv = true;
|
||||
// store new file and path into score fileInfo
|
||||
// to have it accessible to resources
|
||||
QString originalScoreFName(cs->masterScore()->fileInfo()->canonicalFilePath());
|
||||
cs->masterScore()->fileInfo()->setFile(fn);
|
||||
if (!cs->isMaster()) { // clone metaTags from masterScore
|
||||
QMapIterator<QString, QString> j(cs->masterScore()->metaTags());
|
||||
QString originalScoreFName(cs_->masterScore()->fileInfo()->canonicalFilePath());
|
||||
cs_->masterScore()->fileInfo()->setFile(fn);
|
||||
if (!cs_->isMaster()) { // clone metaTags from masterScore
|
||||
QMapIterator<QString, QString> j(cs_->masterScore()->metaTags());
|
||||
while (j.hasNext()) {
|
||||
j.next();
|
||||
if (j.key() != "partName") // don't copy "partName" should that exist in masterScore
|
||||
cs->metaTags().insert(j.key(), j.value());
|
||||
cs_->metaTags().insert(j.key(), j.value());
|
||||
#if defined(Q_OS_WIN) // Update "platform", may not be worth the effort
|
||||
cs->metaTags().insert("platform", "Microsoft Windows");
|
||||
cs_->metaTags().insert("platform", "Microsoft Windows");
|
||||
#elif defined(Q_OS_MAC)
|
||||
cs->metaTags().insert("platform", "Apple Macintosh");
|
||||
cs_->metaTags().insert("platform", "Apple Macintosh");
|
||||
#elif defined(Q_OS_LINUX)
|
||||
cs->metaTags().insert("platform", "Linux");
|
||||
cs_->metaTags().insert("platform", "Linux");
|
||||
#else
|
||||
cs->metaTags().insert("platform", "Unknown");
|
||||
cs_->metaTags().insert("platform", "Unknown");
|
||||
#endif
|
||||
cs->metaTags().insert("source", ""); // Empty "source" to avoid clashes with masterrScore when doing "Save online"
|
||||
cs->metaTags().insert("creationDate", QDate::currentDate().toString(Qt::ISODate)); // update "creationDate"
|
||||
cs_->metaTags().insert("source", ""); // Empty "source" to avoid clashes with masterrScore when doing "Save online"
|
||||
cs_->metaTags().insert("creationDate", QDate::currentDate().toString(Qt::ISODate)); // update "creationDate"
|
||||
}
|
||||
}
|
||||
try {
|
||||
if (ext == "mscz")
|
||||
cs->saveCompressedFile(fi, false);
|
||||
cs_->saveCompressedFile(fi, false);
|
||||
else
|
||||
cs->saveFile(fi);
|
||||
cs_->saveFile(fi);
|
||||
}
|
||||
catch (QString s) {
|
||||
rv = false;
|
||||
QMessageBox::critical(this, tr("Save As"), s);
|
||||
}
|
||||
if (!cs->isMaster()) { // remove metaTags added above
|
||||
QMapIterator<QString, QString> j(cs->masterScore()->metaTags());
|
||||
if (!cs_->isMaster()) { // remove metaTags added above
|
||||
QMapIterator<QString, QString> j(cs_->masterScore()->metaTags());
|
||||
while (j.hasNext()) {
|
||||
j.next();
|
||||
// remove all but "partName", should that exist in masterScore
|
||||
if (j.key() != "partName")
|
||||
cs->metaTags().remove(j.key());
|
||||
cs_->metaTags().remove(j.key());
|
||||
}
|
||||
}
|
||||
cs->masterScore()->fileInfo()->setFile(originalScoreFName); // restore original file name
|
||||
cs_->masterScore()->fileInfo()->setFile(originalScoreFName); // restore original file name
|
||||
|
||||
if (rv && !saveCopy) {
|
||||
cs->masterScore()->fileInfo()->setFile(fn);
|
||||
updateWindowTitle(cs);
|
||||
cs->undoStack()->setClean();
|
||||
dirtyChanged(cs);
|
||||
cs->setCreated(false);
|
||||
addRecentScore(cs);
|
||||
cs_->masterScore()->fileInfo()->setFile(fn);
|
||||
updateWindowTitle(cs_);
|
||||
cs_->undoStack()->setClean();
|
||||
dirtyChanged(cs_);
|
||||
cs_->setCreated(false);
|
||||
addRecentScore(cs_);
|
||||
writeSessionFile(false);
|
||||
}
|
||||
}
|
||||
else if (ext == "musicxml") {
|
||||
// save as MusicXML *.musicxml file
|
||||
rv = saveXml(cs, fn);
|
||||
rv = saveXml(cs_, fn);
|
||||
}
|
||||
else if (ext == "mxl") {
|
||||
// save as compressed MusicXML *.mxl file
|
||||
rv = saveMxl(cs, fn);
|
||||
rv = saveMxl(cs_, fn);
|
||||
}
|
||||
else if (ext == "mid") {
|
||||
// save as midi file *.mid
|
||||
rv = saveMidi(cs, fn);
|
||||
rv = saveMidi(cs_, fn);
|
||||
}
|
||||
else if (ext == "pdf") {
|
||||
// save as pdf file *.pdf
|
||||
cs->switchToPageMode();
|
||||
rv = savePdf(cs, fn);
|
||||
cs_->switchToPageMode();
|
||||
rv = savePdf(cs_, fn);
|
||||
}
|
||||
else if (ext == "png") {
|
||||
// save as png file *.png
|
||||
cs->switchToPageMode();
|
||||
rv = savePng(cs, fn);
|
||||
cs_->switchToPageMode();
|
||||
rv = savePng(cs_, fn);
|
||||
}
|
||||
else if (ext == "svg") {
|
||||
// save as svg file *.svg
|
||||
cs->switchToPageMode();
|
||||
rv = saveSvg(cs, fn);
|
||||
cs_->switchToPageMode();
|
||||
rv = saveSvg(cs_, fn);
|
||||
}
|
||||
#ifdef HAS_AUDIOFILE
|
||||
else if (ext == "wav" || ext == "flac" || ext == "ogg")
|
||||
rv = saveAudio(cs, fn);
|
||||
rv = saveAudio(cs_, fn);
|
||||
#endif
|
||||
#ifdef USE_LAME
|
||||
else if (ext == "mp3")
|
||||
rv = saveMp3(cs, fn);
|
||||
rv = saveMp3(cs_, fn);
|
||||
#endif
|
||||
else if (ext == "spos") {
|
||||
cs->switchToPageMode();
|
||||
cs_->switchToPageMode();
|
||||
// save positions of segments
|
||||
rv = savePositions(cs, fn, true);
|
||||
rv = savePositions(cs_, fn, true);
|
||||
}
|
||||
else if (ext == "mpos") {
|
||||
cs->switchToPageMode();
|
||||
cs_->switchToPageMode();
|
||||
// save positions of measures
|
||||
rv = savePositions(cs, fn, false);
|
||||
rv = savePositions(cs_, fn, false);
|
||||
}
|
||||
else if (ext == "mlog") {
|
||||
rv = cs->sanityCheck(fn);
|
||||
rv = cs_->sanityCheck(fn);
|
||||
}
|
||||
else {
|
||||
qDebug("Internal error: unsupported extension <%s>",
|
||||
|
@ -1933,9 +1933,9 @@ bool MuseScore::saveAs(Score* cs, bool saveCopy, const QString& path, const QStr
|
|||
if (!rv && !MScore::noGui)
|
||||
QMessageBox::critical(this, tr("MuseScore:"), tr("Cannot write into %1").arg(fn));
|
||||
|
||||
if (layoutMode != cs->layoutMode()) {
|
||||
cs->setLayoutMode(layoutMode);
|
||||
cs->doLayout();
|
||||
if (layoutMode != cs_->layoutMode()) {
|
||||
cs_->setLayoutMode(layoutMode);
|
||||
cs_->doLayout();
|
||||
}
|
||||
return rv;
|
||||
}
|
||||
|
@ -1959,14 +1959,14 @@ bool MuseScore::savePdf(const QString& saveName)
|
|||
return savePdf(cs, saveName);
|
||||
}
|
||||
|
||||
bool MuseScore::savePdf(Score* cs, const QString& saveName)
|
||||
bool MuseScore::savePdf(Score* cs_, const QString& saveName)
|
||||
{
|
||||
cs->setPrinting(true);
|
||||
cs_->setPrinting(true);
|
||||
MScore::pdfPrinting = true;
|
||||
|
||||
QPdfWriter pdfWriter(saveName);
|
||||
pdfWriter.setResolution(preferences.getInt(PREF_EXPORT_PDF_DPI));
|
||||
QSizeF size(cs->styleD(Sid::pageWidth), cs->styleD(Sid::pageHeight));
|
||||
QSizeF size(cs_->styleD(Sid::pageWidth), cs_->styleD(Sid::pageHeight));
|
||||
QPageSize ps(QPageSize::id(size, QPageSize::Inch));
|
||||
pdfWriter.setPageSize(ps);
|
||||
pdfWriter.setPageOrientation(size.width() > size.height() ? QPageLayout::Landscape : QPageLayout::Portrait);
|
||||
|
@ -1975,13 +1975,13 @@ bool MuseScore::savePdf(Score* cs, const QString& saveName)
|
|||
if (!pdfWriter.setPageMargins(QMarginsF()))
|
||||
qDebug("unable to clear printer margins");
|
||||
|
||||
QString title = cs->metaTag("workTitle");
|
||||
QString title = cs_->metaTag("workTitle");
|
||||
if (title.isEmpty()) // workTitle unset?
|
||||
title = cs->masterScore()->title(); // fall back to (master)score's tab title
|
||||
if (!cs->isMaster()) { // excerpt?
|
||||
QString partname = cs->metaTag("partName");
|
||||
title = cs_->masterScore()->title(); // fall back to (master)score's tab title
|
||||
if (!cs_->isMaster()) { // excerpt?
|
||||
QString partname = cs_->metaTag("partName");
|
||||
if (partname.isEmpty()) // partName unset?
|
||||
partname = cs->title(); // fall back to excerpt's tab title
|
||||
partname = cs_->title(); // fall back to excerpt's tab title
|
||||
title += " - " + partname;
|
||||
}
|
||||
pdfWriter.setTitle(title); // set PDF's meta data for Title
|
||||
|
@ -1999,28 +1999,28 @@ bool MuseScore::savePdf(Score* cs, const QString& saveName)
|
|||
double pr = MScore::pixelRatio;
|
||||
MScore::pixelRatio = DPI / pdfWriter.logicalDpiX();
|
||||
|
||||
const QList<Page*> pl = cs->pages();
|
||||
const QList<Page*> pl = cs_->pages();
|
||||
int pages = pl.size();
|
||||
bool firstPage = true;
|
||||
for (int n = 0; n < pages; ++n) {
|
||||
if (!firstPage)
|
||||
pdfWriter.newPage();
|
||||
firstPage = false;
|
||||
cs->print(&p, n);
|
||||
cs_->print(&p, n);
|
||||
}
|
||||
p.end();
|
||||
cs->setPrinting(false);
|
||||
cs_->setPrinting(false);
|
||||
|
||||
MScore::pixelRatio = pr;
|
||||
MScore::pdfPrinting = false;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool MuseScore::savePdf(QList<Score*> cs, const QString& saveName)
|
||||
bool MuseScore::savePdf(QList<Score*> cs_, const QString& saveName)
|
||||
{
|
||||
if (cs.empty())
|
||||
if (cs_.empty())
|
||||
return false;
|
||||
Score* firstScore = cs[0];
|
||||
Score* firstScore = cs_[0];
|
||||
|
||||
QPdfWriter pdfWriter(saveName);
|
||||
pdfWriter.setResolution(preferences.getInt(PREF_EXPORT_PDF_DPI));
|
||||
|
@ -2056,7 +2056,7 @@ bool MuseScore::savePdf(QList<Score*> cs, const QString& saveName)
|
|||
MScore::pdfPrinting = true;
|
||||
|
||||
bool firstPage = true;
|
||||
for (Score* s : cs) {
|
||||
for (Score* s : cs_) {
|
||||
LayoutMode layoutMode = s->layoutMode();
|
||||
if (layoutMode != LayoutMode::PAGE) {
|
||||
s->setLayoutMode(LayoutMode::PAGE);
|
||||
|
@ -2258,7 +2258,7 @@ Score::FileError readScore(MasterScore* score, QString name, bool ignoreVersionE
|
|||
Return true if OK and false on error.
|
||||
*/
|
||||
|
||||
bool MuseScore::saveAs(Score* cs, bool saveCopy)
|
||||
bool MuseScore::saveAs(Score* cs_, bool saveCopy)
|
||||
{
|
||||
QStringList fl;
|
||||
fl.append(tr("MuseScore File") + " (*.mscz)");
|
||||
|
@ -2267,18 +2267,18 @@ bool MuseScore::saveAs(Score* cs, bool saveCopy)
|
|||
tr("Save As");
|
||||
|
||||
QString saveDirectory;
|
||||
if (cs->masterScore()->fileInfo()->exists())
|
||||
saveDirectory = cs->masterScore()->fileInfo()->dir().path();
|
||||
if (cs_->masterScore()->fileInfo()->exists())
|
||||
saveDirectory = cs_->masterScore()->fileInfo()->dir().path();
|
||||
else {
|
||||
QSettings settings;
|
||||
QSettings set;
|
||||
if (saveCopy) {
|
||||
if (mscore->lastSaveCopyDirectory.isEmpty())
|
||||
mscore->lastSaveCopyDirectory = settings.value("lastSaveCopyDirectory", preferences.getString(PREF_APP_PATHS_MYSCORES)).toString();
|
||||
mscore->lastSaveCopyDirectory = set.value("lastSaveCopyDirectory", preferences.getString(PREF_APP_PATHS_MYSCORES)).toString();
|
||||
saveDirectory = mscore->lastSaveCopyDirectory;
|
||||
}
|
||||
else {
|
||||
if (mscore->lastSaveDirectory.isEmpty())
|
||||
mscore->lastSaveDirectory = settings.value("lastSaveDirectory", preferences.getString(PREF_APP_PATHS_MYSCORES)).toString();
|
||||
mscore->lastSaveDirectory = set.value("lastSaveDirectory", preferences.getString(PREF_APP_PATHS_MYSCORES)).toString();
|
||||
saveDirectory = mscore->lastSaveDirectory;
|
||||
}
|
||||
}
|
||||
|
@ -2289,17 +2289,17 @@ bool MuseScore::saveAs(Score* cs, bool saveCopy)
|
|||
QString name;
|
||||
#ifdef Q_OS_WIN
|
||||
if (QSysInfo::WindowsVersion == QSysInfo::WV_XP) {
|
||||
if (!cs->isMaster())
|
||||
name = QString("%1/%2-%3").arg(saveDirectory).arg(cs->masterScore()->fileInfo()->completeBaseName()).arg(createDefaultFileName(cs->title()));
|
||||
if (!cs_->isMaster())
|
||||
name = QString("%1/%2-%3").arg(saveDirectory).arg(cs_->masterScore()->fileInfo()->completeBaseName()).arg(createDefaultFileName(cs->title()));
|
||||
else
|
||||
name = QString("%1/%2").arg(saveDirectory).arg(cs->masterScore()->fileInfo()->completeBaseName());
|
||||
name = QString("%1/%2").arg(saveDirectory).arg(cs_->masterScore()->fileInfo()->completeBaseName());
|
||||
}
|
||||
else
|
||||
#endif
|
||||
if (!cs->isMaster())
|
||||
name = QString("%1/%2-%3.mscz").arg(saveDirectory).arg(cs->masterScore()->fileInfo()->completeBaseName()).arg(createDefaultFileName(cs->title()));
|
||||
if (!cs_->isMaster())
|
||||
name = QString("%1/%2-%3.mscz").arg(saveDirectory).arg(cs_->masterScore()->fileInfo()->completeBaseName()).arg(createDefaultFileName(cs->title()));
|
||||
else
|
||||
name = QString("%1/%2.mscz").arg(saveDirectory).arg(cs->masterScore()->fileInfo()->completeBaseName());
|
||||
name = QString("%1/%2.mscz").arg(saveDirectory).arg(cs_->masterScore()->fileInfo()->completeBaseName());
|
||||
|
||||
QString filter = fl.join(";;");
|
||||
QString fn = mscore->getSaveScoreName(saveDialogTitle, name, filter);
|
||||
|
@ -2317,7 +2317,7 @@ bool MuseScore::saveAs(Score* cs, bool saveCopy)
|
|||
QMessageBox::critical(mscore, tr("Save As"), tr("Cannot determine file type"));
|
||||
return false;
|
||||
}
|
||||
return saveAs(cs, saveCopy, fn, fi.suffix());
|
||||
return saveAs(cs_, saveCopy, fn, fi.suffix());
|
||||
}
|
||||
|
||||
//---------------------------------------------------------
|
||||
|
@ -2325,9 +2325,9 @@ bool MuseScore::saveAs(Score* cs, bool saveCopy)
|
|||
// return true on success
|
||||
//---------------------------------------------------------
|
||||
|
||||
bool MuseScore::saveSelection(Score* cs)
|
||||
bool MuseScore::saveSelection(Score* cs_)
|
||||
{
|
||||
if (!cs->selection().isRange()) {
|
||||
if (!cs_->selection().isRange()) {
|
||||
if(!MScore::noGui) QMessageBox::warning(mscore, tr("Save Selection"), tr("Please select one or more measures"));
|
||||
return false;
|
||||
}
|
||||
|
@ -2336,19 +2336,19 @@ bool MuseScore::saveSelection(Score* cs)
|
|||
QString saveDialogTitle = tr("Save Selection");
|
||||
|
||||
QString saveDirectory;
|
||||
if (cs->masterScore()->fileInfo()->exists())
|
||||
saveDirectory = cs->masterScore()->fileInfo()->dir().path();
|
||||
if (cs_->masterScore()->fileInfo()->exists())
|
||||
saveDirectory = cs_->masterScore()->fileInfo()->dir().path();
|
||||
else {
|
||||
QSettings settings;
|
||||
QSettings set;
|
||||
if (mscore->lastSaveDirectory.isEmpty())
|
||||
mscore->lastSaveDirectory = settings.value("lastSaveDirectory", preferences.getString(PREF_APP_PATHS_MYSCORES)).toString();
|
||||
mscore->lastSaveDirectory = set.value("lastSaveDirectory", preferences.getString(PREF_APP_PATHS_MYSCORES)).toString();
|
||||
saveDirectory = mscore->lastSaveDirectory;
|
||||
}
|
||||
|
||||
if (saveDirectory.isEmpty())
|
||||
saveDirectory = preferences.getString(PREF_APP_PATHS_MYSCORES);
|
||||
|
||||
QString name = QString("%1/%2.mscz").arg(saveDirectory).arg(cs->title());
|
||||
QString name = QString("%1/%2.mscz").arg(saveDirectory).arg(cs_->title());
|
||||
QString filter = fl.join(";;");
|
||||
QString fn = mscore->getSaveScoreName(saveDialogTitle, name, filter);
|
||||
if (fn.isEmpty())
|
||||
|
@ -2364,7 +2364,7 @@ bool MuseScore::saveSelection(Score* cs)
|
|||
}
|
||||
bool rv = true;
|
||||
try {
|
||||
cs->saveCompressedFile(fi, true);
|
||||
cs_->saveCompressedFile(fi, true);
|
||||
}
|
||||
catch (QString s) {
|
||||
rv = false;
|
||||
|
@ -2497,13 +2497,13 @@ bool MuseScore::savePng(Score* score, const QString& name, bool screenshot, bool
|
|||
|
||||
printer.fill(transparent ? 0 : 0xffffffff);
|
||||
|
||||
double mag = convDpi / DPI;
|
||||
MScore::pixelRatio = 1.0 / mag;
|
||||
double mag_ = convDpi / DPI;
|
||||
MScore::pixelRatio = 1.0 / mag_;
|
||||
|
||||
QPainter p(&printer);
|
||||
p.setRenderHint(QPainter::Antialiasing, true);
|
||||
p.setRenderHint(QPainter::TextAntialiasing, true);
|
||||
p.scale(mag, mag);
|
||||
p.scale(mag_, mag_);
|
||||
if (_trimMargin >= 0)
|
||||
p.translate(-r.topLeft());
|
||||
|
||||
|
@ -2626,14 +2626,14 @@ QString MuseScore::getWallpaper(const QString& caption)
|
|||
loadBackgroundDialog->setNameFilter(filter);
|
||||
loadBackgroundDialog->setDirectory(d);
|
||||
|
||||
QSettings settings;
|
||||
loadBackgroundDialog->restoreState(settings.value("loadBackgroundDialog").toByteArray());
|
||||
QSettings set;
|
||||
loadBackgroundDialog->restoreState(set.value("loadBackgroundDialog").toByteArray());
|
||||
loadBackgroundDialog->setAcceptMode(QFileDialog::AcceptOpen);
|
||||
|
||||
QSplitter* splitter = loadBackgroundDialog->findChild<QSplitter*>("splitter");
|
||||
if (splitter) {
|
||||
QSplitter* sp = loadBackgroundDialog->findChild<QSplitter*>("splitter");
|
||||
if (sp) {
|
||||
WallpaperPreview* preview = new WallpaperPreview;
|
||||
splitter->addWidget(preview);
|
||||
sp->addWidget(preview);
|
||||
connect(loadBackgroundDialog, SIGNAL(currentChanged(const QString&)),
|
||||
preview, SLOT(setImage(const QString&)));
|
||||
}
|
||||
|
|
|
@ -507,9 +507,9 @@ void HarmonyCanvas::dropEvent(QDropEvent* /*event*/)
|
|||
|
||||
void HarmonyCanvas::dragEnterEvent(QDragEnterEvent* event)
|
||||
{
|
||||
const QMimeData* data = event->mimeData();
|
||||
if (data->hasFormat(mimeSymbolFormat)) {
|
||||
QByteArray a = data->data(mimeSymbolFormat);
|
||||
const QMimeData* dta = event->mimeData();
|
||||
if (dta->hasFormat(mimeSymbolFormat)) {
|
||||
QByteArray a = dta->data(mimeSymbolFormat);
|
||||
|
||||
XmlReader e(a);
|
||||
|
||||
|
|
|
@ -69,7 +69,7 @@ bool GuitarPro4::readMixChange(Measure* measure)
|
|||
signed char reverb = readChar();
|
||||
signed char phase = readChar();
|
||||
signed char tremolo = readChar();
|
||||
int tempo = readInt();
|
||||
int temp = readInt();
|
||||
|
||||
bool tempoEdited = false;
|
||||
|
||||
|
@ -85,14 +85,14 @@ bool GuitarPro4::readMixChange(Measure* measure)
|
|||
readChar();
|
||||
if (tremolo >= 0)
|
||||
readChar();
|
||||
if (tempo >= 0) {
|
||||
if (temp >= 0) {
|
||||
if (last_segment) {
|
||||
score->setTempo(last_segment->tick(), double(tempo) / 60.0f);
|
||||
score->setTempo(last_segment->tick(), double(temp) / 60.0f);
|
||||
last_segment = nullptr;
|
||||
}
|
||||
if (tempo != previousTempo) {
|
||||
previousTempo = tempo;
|
||||
setTempo(tempo, measure);
|
||||
if (temp != previousTempo) {
|
||||
previousTempo = temp;
|
||||
setTempo(temp, measure);
|
||||
}
|
||||
readChar();
|
||||
tempoEdited = true;
|
||||
|
@ -235,7 +235,7 @@ bool GuitarPro4::readNote(int string, int staffIdx, Note* note)
|
|||
if (noteBits & NOTE_FINGERING) { // 0x80
|
||||
int leftFinger = readUChar();
|
||||
int rightFinger = readUChar();
|
||||
Fingering* f = new Fingering(score);
|
||||
Fingering* fi = new Fingering(score);
|
||||
QString finger;
|
||||
// if there is a valid left hand fingering
|
||||
if (leftFinger < 5) {
|
||||
|
@ -262,9 +262,9 @@ bool GuitarPro4::readNote(int string, int staffIdx, Note* note)
|
|||
else if (rightFinger == 4)
|
||||
finger = "O";
|
||||
}
|
||||
f->setPlainText(finger);
|
||||
note->add(f);
|
||||
f->reset();
|
||||
fi->setPlainText(finger);
|
||||
note->add(fi);
|
||||
fi->reset();
|
||||
}
|
||||
bool slur = false;
|
||||
uchar modMask2{ 0 };
|
||||
|
@ -583,9 +583,9 @@ void GuitarPro4::readInfo()
|
|||
// convertGP4SlideNum
|
||||
//---------------------------------------------------------
|
||||
|
||||
int GuitarPro4::convertGP4SlideNum(int slide)
|
||||
int GuitarPro4::convertGP4SlideNum(int sl)
|
||||
{
|
||||
switch (slide) {
|
||||
switch (sl) {
|
||||
case 1:
|
||||
return SHIFT_SLIDE;
|
||||
case 2:
|
||||
|
@ -599,7 +599,7 @@ int GuitarPro4::convertGP4SlideNum(int slide)
|
|||
case 255: // slide in from below
|
||||
return SLIDE_IN_BELOW;
|
||||
}
|
||||
return slide;
|
||||
return sl;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------
|
||||
|
@ -615,7 +615,7 @@ bool GuitarPro4::read(QFile* fp)
|
|||
readUChar(); // triplet feeling
|
||||
readLyrics();
|
||||
|
||||
int tempo = readInt();
|
||||
int temp = readInt();
|
||||
key = readInt();
|
||||
/*int octave =*/ readUChar(); // octave
|
||||
|
||||
|
@ -690,7 +690,7 @@ bool GuitarPro4::read(QFile* fp)
|
|||
|
||||
createMeasures();
|
||||
|
||||
setTempo(tempo, score->firstMeasure());
|
||||
setTempo(temp, score->firstMeasure());
|
||||
|
||||
for (int i = 0; i < staves; ++i) {
|
||||
int tuning[GP_MAX_STRING_NUMBER];
|
||||
|
@ -1063,7 +1063,7 @@ bool GuitarPro4::read(QFile* fp)
|
|||
}
|
||||
|
||||
if (bar == 1 && !mixChange)
|
||||
setTempo(tempo, score->firstMeasure());
|
||||
setTempo(temp, score->firstMeasure());
|
||||
}
|
||||
|
||||
for (auto n : slideList) {
|
||||
|
|
|
@ -452,7 +452,7 @@ bool GuitarPro5::readMixChange(Measure* measure)
|
|||
signed char tremolo = readChar();
|
||||
readDelphiString(); // tempo name
|
||||
|
||||
int tempo = readInt();
|
||||
int temp = readInt();
|
||||
bool editedTempo = false;
|
||||
if (volume >= 0)
|
||||
readChar();
|
||||
|
@ -467,14 +467,14 @@ bool GuitarPro5::readMixChange(Measure* measure)
|
|||
readChar();
|
||||
if (tremolo >= 0)
|
||||
readChar();
|
||||
if (tempo >= 0) {
|
||||
if (temp >= 0) {
|
||||
if (last_segment) {
|
||||
score->setTempo(last_segment->tick(), double(tempo) / 60.0);
|
||||
score->setTempo(last_segment->tick(), double(temp) / 60.0);
|
||||
last_segment = nullptr;
|
||||
}
|
||||
if (tempo != previousTempo) {
|
||||
previousTempo = tempo;
|
||||
setTempo(tempo, measure);
|
||||
if (temp != previousTempo) {
|
||||
previousTempo = temp;
|
||||
setTempo(temp, measure);
|
||||
editedTempo = true;
|
||||
}
|
||||
readChar();
|
||||
|
@ -1375,7 +1375,7 @@ bool GuitarPro5::readNote(int string, Note* note)
|
|||
if (noteBits & NOTE_FINGERING) {
|
||||
int leftFinger = readUChar();
|
||||
int rightFinger = readUChar();
|
||||
Fingering* f = new Fingering(score);
|
||||
Fingering* fi = new Fingering(score);
|
||||
QString finger;
|
||||
// if there is a valid left hand fingering
|
||||
if (leftFinger < 5) {
|
||||
|
@ -1402,9 +1402,9 @@ bool GuitarPro5::readNote(int string, Note* note)
|
|||
else if (rightFinger == 4)
|
||||
finger = "O";
|
||||
}
|
||||
f->setPlainText(finger);
|
||||
note->add(f);
|
||||
f->reset();
|
||||
fi->setPlainText(finger);
|
||||
note->add(fi);
|
||||
fi->reset();
|
||||
}
|
||||
|
||||
if (noteBits & 0x1) // Time independent duration
|
||||
|
|
|
@ -648,14 +648,14 @@ int GuitarPro6::findNumMeasures(GPPartInfo* partInfo)
|
|||
break;
|
||||
masterBar = masterBar.nextSibling();
|
||||
}
|
||||
QString bars = masterBar.lastChildElement("Bars").toElement().text();
|
||||
QString b = masterBar.lastChildElement("Bars").toElement().text();
|
||||
//work out the number of measures (add 1 as couning from 0, and divide by number of parts)
|
||||
int numMeasures = (bars.split(" ").last().toInt() + 1) / score->parts().length();
|
||||
int numMeasures = (b.split(" ").last().toInt() + 1) / score->parts().length();
|
||||
|
||||
if (numMeasures > bars.size()) {
|
||||
qDebug("GuitarPro6:findNumMeasures: bars %d < numMeasures %d\n", bars.size(), numMeasures);
|
||||
if (numMeasures > b.size()) {
|
||||
qDebug("GuitarPro6:findNumMeasures: bars %d < numMeasures %d\n", b.size(), numMeasures);
|
||||
// HACK (ws)
|
||||
numMeasures = bars.size();
|
||||
numMeasures = b.size();
|
||||
}
|
||||
return numMeasures;
|
||||
}
|
||||
|
@ -832,9 +832,9 @@ int GuitarPro6::readBeats(QString beats, GPPartInfo* partInfo, Measure* measure,
|
|||
bool startSlur = false;
|
||||
bool endSlur = false;
|
||||
for (auto currentBeat = currentBeatList.begin(); currentBeat != currentBeatList.end(); currentBeat++) {
|
||||
int slide = -1;
|
||||
int sl = -1;
|
||||
if (slides->contains(staffIdx * VOICES + voiceNum))
|
||||
slide = slides->take(staffIdx * VOICES + voiceNum);
|
||||
sl = slides->take(staffIdx * VOICES + voiceNum);
|
||||
|
||||
Fraction l;
|
||||
int dotted = 0;
|
||||
|
@ -1434,7 +1434,7 @@ int GuitarPro6::readBeats(QString beats, GPPartInfo* partInfo, Measure* measure,
|
|||
if (!leftFingeringNode.isNull() || !rightFingeringNode.isNull()) {
|
||||
QDomNode fingeringNode = leftFingeringNode.isNull() ? rightFingeringNode : leftFingeringNode;
|
||||
QString finger = fingeringNode.toElement().text();
|
||||
Fingering* f = new Fingering(score);
|
||||
Fingering* fi = new Fingering(score);
|
||||
if (!leftFingeringNode.isNull()) {
|
||||
if (!finger.compare("Open"))
|
||||
finger = "O";
|
||||
|
@ -1449,9 +1449,9 @@ int GuitarPro6::readBeats(QString beats, GPPartInfo* partInfo, Measure* measure,
|
|||
else if (!finger.compare("C"))
|
||||
finger = "4";
|
||||
}
|
||||
f->setPlainText(finger);
|
||||
note->add(f);
|
||||
f->reset();
|
||||
fi->setPlainText(finger);
|
||||
note->add(fi);
|
||||
fi->reset();
|
||||
}
|
||||
QDomNode arpeggioNode = currentNode.parentNode().firstChildElement("Arpeggio");
|
||||
if (!arpeggioNode.isNull()) {
|
||||
|
@ -1535,8 +1535,8 @@ int GuitarPro6::readBeats(QString beats, GPPartInfo* partInfo, Measure* measure,
|
|||
addVibrato(note, Vibrato::Type::GUITAR_VIBRATO_WIDE);
|
||||
}
|
||||
|
||||
if (cr && (cr->type() == ElementType::CHORD) && slide > 0)
|
||||
createSlide(slide, cr, staffIdx);
|
||||
if (cr && (cr->type() == ElementType::CHORD) && sl > 0)
|
||||
createSlide(sl, cr, staffIdx);
|
||||
note->setTpcFromPitch();
|
||||
|
||||
/* if the ottava is a continuation (need to end old one), or we don't
|
||||
|
@ -1620,9 +1620,9 @@ int GuitarPro6::readBeats(QString beats, GPPartInfo* partInfo, Measure* measure,
|
|||
}
|
||||
else if (currentNode.nodeName() == "Dynamic") {}
|
||||
else if (!currentNode.nodeName().compare("Chord")) {
|
||||
int key = currentNode.toElement().text().toInt();
|
||||
if (fretDiagrams[key])
|
||||
segment->add(fretDiagrams[key]);
|
||||
int k = currentNode.toElement().text().toInt();
|
||||
if (fretDiagrams[k])
|
||||
segment->add(fretDiagrams[k]);
|
||||
}
|
||||
else if (currentNode.nodeName() == "Timer") {
|
||||
//int time = currentNode.toElement().text().toInt();
|
||||
|
@ -2455,15 +2455,15 @@ void GuitarPro6::readGpif(QByteArray* data)
|
|||
// MasterBars node
|
||||
GPPartInfo partInfo;
|
||||
QDomNode masterBars = eachTrack.nextSibling();
|
||||
QDomNode bars = masterBars.nextSibling();
|
||||
QDomNode voices = bars.nextSibling();
|
||||
QDomNode b = masterBars.nextSibling();
|
||||
QDomNode voices = b.nextSibling();
|
||||
QDomNode beats = voices.nextSibling();
|
||||
QDomNode notes = beats.nextSibling();
|
||||
QDomNode rhythms = notes.nextSibling();
|
||||
|
||||
// set up the partInfo struct to contain information from the file
|
||||
partInfo.masterBars = masterBars.firstChild();
|
||||
partInfo.bars = bars.firstChild();
|
||||
partInfo.bars = b.firstChild();
|
||||
partInfo.voices = voices.firstChild();
|
||||
partInfo.beats = beats.firstChild();
|
||||
partInfo.notes = notes.firstChild();
|
||||
|
|
|
@ -755,10 +755,10 @@ void GuitarPro::readLyrics()
|
|||
// createSlide
|
||||
//---------------------------------------------------------
|
||||
|
||||
void GuitarPro::createSlide(int slide, ChordRest* cr, int staffIdx, Note* /*note*/)
|
||||
void GuitarPro::createSlide(int sl, ChordRest* cr, int staffIdx, Note* /*note*/)
|
||||
{
|
||||
// shift / legato slide
|
||||
if (slide == SHIFT_SLIDE || slide == LEGATO_SLIDE) {
|
||||
if (sl == SHIFT_SLIDE || sl == LEGATO_SLIDE) {
|
||||
Glissando* s = new Glissando(score);
|
||||
//s->setXmlText("");
|
||||
s->setGlissandoType(GlissandoType::STRAIGHT);
|
||||
|
@ -779,7 +779,7 @@ void GuitarPro::createSlide(int slide, ChordRest* cr, int staffIdx, Note* /*note
|
|||
s->setParent(prevChord->upNote());
|
||||
s->setText("");
|
||||
s->setGlissandoType(GlissandoType::STRAIGHT);
|
||||
if (slide == LEGATO_SLIDE)
|
||||
if (sl == LEGATO_SLIDE)
|
||||
createSlur(true, staffIdx, prevChord);
|
||||
}
|
||||
}
|
||||
|
@ -792,11 +792,11 @@ void GuitarPro::createSlide(int slide, ChordRest* cr, int staffIdx, Note* /*note
|
|||
s->setTick2(chord->segment()->tick());
|
||||
s->setTrack2(staffIdx);
|
||||
score->addElement(s);
|
||||
if (slide == LEGATO_SLIDE)
|
||||
if (sl == LEGATO_SLIDE)
|
||||
createSlur(false, staffIdx, cr);
|
||||
}
|
||||
// slide out downwards (fall)
|
||||
if (slide & SLIDE_OUT_DOWN) {
|
||||
if (sl & SLIDE_OUT_DOWN) {
|
||||
ChordLine* cl = new ChordLine(score);
|
||||
cl->setChordLineType(ChordLineType::FALL);
|
||||
cl->setStraight(true);
|
||||
|
@ -804,7 +804,7 @@ void GuitarPro::createSlide(int slide, ChordRest* cr, int staffIdx, Note* /*note
|
|||
cr->add(cl);
|
||||
}
|
||||
// slide out upwards (doit)
|
||||
if (slide & SLIDE_OUT_UP) {
|
||||
if (sl & SLIDE_OUT_UP) {
|
||||
ChordLine* cl = new ChordLine(score);
|
||||
cl->setChordLineType(ChordLineType::DOIT);
|
||||
cl->setStraight(true);
|
||||
|
@ -812,7 +812,7 @@ void GuitarPro::createSlide(int slide, ChordRest* cr, int staffIdx, Note* /*note
|
|||
cr->add(cl);
|
||||
}
|
||||
// slide in from below (plop)
|
||||
if (slide & SLIDE_IN_BELOW) {
|
||||
if (sl & SLIDE_IN_BELOW) {
|
||||
ChordLine* cl = new ChordLine(score);
|
||||
cl->setChordLineType(ChordLineType::PLOP);
|
||||
cl->setStraight(true);
|
||||
|
@ -820,7 +820,7 @@ void GuitarPro::createSlide(int slide, ChordRest* cr, int staffIdx, Note* /*note
|
|||
cr->add(cl);
|
||||
}
|
||||
// slide in from above (scoop)
|
||||
if (slide & SLIDE_IN_ABOVE) {
|
||||
if (sl & SLIDE_IN_ABOVE) {
|
||||
ChordLine* cl = new ChordLine(score);
|
||||
cl->setChordLineType(ChordLineType::SCOOP);
|
||||
cl->setStraight(true);
|
||||
|
@ -894,7 +894,7 @@ bool GuitarPro::readMixChange(Measure* measure)
|
|||
signed char reverb = readChar();
|
||||
signed char phase = readChar();
|
||||
signed char tremolo = readChar();
|
||||
int tempo = readInt();
|
||||
int temp = readInt();
|
||||
|
||||
if (volume >= 0)
|
||||
readChar();
|
||||
|
@ -908,10 +908,10 @@ bool GuitarPro::readMixChange(Measure* measure)
|
|||
readChar();
|
||||
if (tremolo >= 0)
|
||||
readChar();
|
||||
if (tempo >= 0) {
|
||||
if (tempo != previousTempo) {
|
||||
previousTempo = tempo;
|
||||
setTempo(tempo, measure);
|
||||
if (temp >= 0) {
|
||||
if (temp != previousTempo) {
|
||||
previousTempo = temp;
|
||||
setTempo(temp, measure);
|
||||
}
|
||||
readChar();
|
||||
}
|
||||
|
@ -1050,7 +1050,7 @@ bool GuitarPro1::read(QFile* fp)
|
|||
artist = readDelphiString();
|
||||
readDelphiString();
|
||||
|
||||
int tempo = readInt();
|
||||
int temp = readInt();
|
||||
/*uchar num =*/ readUChar(); // Shuffle rhythm feel
|
||||
|
||||
// int octave = 0;
|
||||
|
@ -1124,7 +1124,7 @@ bool GuitarPro1::read(QFile* fp)
|
|||
ts = nts;
|
||||
}
|
||||
|
||||
previousTempo = tempo;
|
||||
previousTempo = temp;
|
||||
Measure* measure = score->firstMeasure();
|
||||
bool mixChange = false;
|
||||
for (int bar = 0; bar < measures; ++bar, measure = measure->nextMeasure()) {
|
||||
|
@ -1242,7 +1242,7 @@ bool GuitarPro1::read(QFile* fp)
|
|||
}
|
||||
}
|
||||
if (bar == 1 && !mixChange)
|
||||
setTempo(tempo, score->firstMeasure());
|
||||
setTempo(temp, score->firstMeasure());
|
||||
}
|
||||
|
||||
return true;
|
||||
|
@ -1252,17 +1252,17 @@ bool GuitarPro1::read(QFile* fp)
|
|||
// setTempo
|
||||
//---------------------------------------------------------
|
||||
|
||||
void GuitarPro::setTempo(int tempo, Measure* measure)
|
||||
void GuitarPro::setTempo(int temp, Measure* measure)
|
||||
{
|
||||
if (!last_measure) {
|
||||
last_measure = measure;
|
||||
last_tempo = tempo;
|
||||
last_tempo = temp;
|
||||
}
|
||||
else if (last_measure == measure) {
|
||||
last_tempo = tempo;
|
||||
last_tempo = temp;
|
||||
}
|
||||
else {
|
||||
std::swap(last_tempo, tempo);
|
||||
std::swap(last_tempo, temp);
|
||||
std::swap(last_measure, measure);
|
||||
|
||||
Segment* segment = measure->getSegment(SegmentType::ChordRest, measure->tick());
|
||||
|
@ -1274,13 +1274,13 @@ void GuitarPro::setTempo(int tempo, Measure* measure)
|
|||
}
|
||||
|
||||
TempoText* tt = new TempoText(score);
|
||||
tt->setTempo(double(tempo) / 60.0);
|
||||
tt->setXmlText(QString("<sym>metNoteQuarterUp</sym> = %1").arg(tempo));
|
||||
tt->setTempo(double(temp) / 60.0);
|
||||
tt->setXmlText(QString("<sym>metNoteQuarterUp</sym> = %1").arg(temp));
|
||||
tt->setTrack(0);
|
||||
|
||||
segment->add(tt);
|
||||
score->setTempo(measure->tick(), tt->tempo());
|
||||
previousTempo = tempo;
|
||||
previousTempo = temp;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1436,7 +1436,7 @@ bool GuitarPro2::read(QFile* fp)
|
|||
|
||||
/*uchar num =*/ readUChar(); // Shuffle rhythm feel
|
||||
|
||||
int tempo = readInt();
|
||||
int temp = readInt();
|
||||
|
||||
// int octave = 0;
|
||||
/*int key =*/ readInt(); // key
|
||||
|
@ -1611,7 +1611,7 @@ bool GuitarPro2::read(QFile* fp)
|
|||
ch->updateInitList();
|
||||
}
|
||||
|
||||
previousTempo = tempo;
|
||||
previousTempo = temp;
|
||||
Measure* measure = score->firstMeasure();
|
||||
bool mixChange = false;
|
||||
for (int bar = 0; bar < measures; ++bar, measure = measure->nextMeasure()) {
|
||||
|
@ -1731,7 +1731,7 @@ bool GuitarPro2::read(QFile* fp)
|
|||
}
|
||||
}
|
||||
if (bar == 1 && !mixChange)
|
||||
setTempo(tempo, score->firstMeasure());
|
||||
setTempo(temp, score->firstMeasure());
|
||||
}
|
||||
|
||||
return true;
|
||||
|
@ -2087,7 +2087,7 @@ bool GuitarPro3::read(QFile* fp)
|
|||
|
||||
/*uchar num =*/ readUChar(); // Shuffle rhythm feel
|
||||
|
||||
int tempo = readInt();
|
||||
int temp = readInt();
|
||||
|
||||
// int octave = 0;
|
||||
key = readInt(); // key
|
||||
|
@ -2302,7 +2302,7 @@ bool GuitarPro3::read(QFile* fp)
|
|||
ch->updateInitList();
|
||||
}
|
||||
|
||||
previousTempo = tempo;
|
||||
previousTempo = temp;
|
||||
Measure* measure = score->firstMeasure();
|
||||
bool mixChange = false;
|
||||
for (int bar = 0; bar < measures; ++bar, measure = measure->nextMeasure()) {
|
||||
|
@ -2542,7 +2542,7 @@ bool GuitarPro3::read(QFile* fp)
|
|||
}
|
||||
}
|
||||
if (bar == 1 && !mixChange)
|
||||
setTempo(tempo, score->firstMeasure());
|
||||
setTempo(temp, score->firstMeasure());
|
||||
}
|
||||
for (auto n : slideList) {
|
||||
auto segment = n->chord()->segment();
|
||||
|
|
|
@ -728,9 +728,9 @@ void InspectorRest::tupletClicked()
|
|||
Rest* rest = toRest(inspector->element());
|
||||
if (rest == 0)
|
||||
return;
|
||||
Tuplet* tuplet = rest->tuplet();
|
||||
if (tuplet) {
|
||||
rest->score()->select(tuplet);
|
||||
Tuplet* t = rest->tuplet();
|
||||
if (t) {
|
||||
rest->score()->select(t);
|
||||
rest->score()->update();
|
||||
inspector->update();
|
||||
}
|
||||
|
@ -1055,17 +1055,17 @@ InspectorStaffText::InspectorStaffText(QWidget* parent)
|
|||
{
|
||||
s.setupUi(addWidget());
|
||||
|
||||
Element* e = inspector->element();
|
||||
Element* el = inspector->element();
|
||||
bool sameTypes = true;
|
||||
|
||||
for (const auto& ee : *inspector->el()) {
|
||||
if (e->isSystemText() != ee->isSystemText()) {
|
||||
if (el->isSystemText() != ee->isSystemText()) {
|
||||
sameTypes = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (sameTypes)
|
||||
s.title->setText(e->isSystemText() ? tr("System Text") : tr("Staff Text"));
|
||||
s.title->setText(el->isSystemText() ? tr("System Text") : tr("Staff Text"));
|
||||
|
||||
const std::vector<InspectorItem> il = {
|
||||
{ Pid::PLACEMENT, 0, s.placement, s.resetPlacement },
|
||||
|
@ -1118,17 +1118,17 @@ InspectorSlurTie::InspectorSlurTie(QWidget* parent)
|
|||
{
|
||||
s.setupUi(addWidget());
|
||||
|
||||
Element* e = inspector->element();
|
||||
Element* el = inspector->element();
|
||||
bool sameTypes = true;
|
||||
|
||||
for (const auto& ee : *inspector->el()) {
|
||||
if (ee->accessibleInfo() != e->accessibleInfo()) {
|
||||
if (ee->accessibleInfo() != el->accessibleInfo()) {
|
||||
sameTypes = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (sameTypes)
|
||||
s.title->setText(e->accessibleInfo());
|
||||
s.title->setText(el->accessibleInfo());
|
||||
|
||||
const std::vector<InspectorItem> iiList = {
|
||||
{ Pid::LINE_TYPE, 0, s.lineType, s.resetLineType },
|
||||
|
|
|
@ -131,9 +131,9 @@ void InspectorBarLine::presetDefaultClicked()
|
|||
score->startCmd();
|
||||
|
||||
BarLine* bl;
|
||||
for (Element* e : *inspector->el()) {
|
||||
if (e->isBarLine()) {
|
||||
bl = toBarLine(e);
|
||||
for (Element* el : *inspector->el()) {
|
||||
if (el->isBarLine()) {
|
||||
bl = toBarLine(el);
|
||||
bl->undoResetProperty(Pid::BARLINE_SPAN);
|
||||
bl->undoResetProperty(Pid::BARLINE_SPAN_FROM);
|
||||
bl->undoResetProperty(Pid::BARLINE_SPAN_TO);
|
||||
|
@ -153,9 +153,9 @@ void InspectorBarLine::presetTick1Clicked()
|
|||
score->startCmd();
|
||||
|
||||
BarLine* bl;
|
||||
for (Element* e : *inspector->el()) {
|
||||
if (e->isBarLine()) {
|
||||
bl = toBarLine(e);
|
||||
for (Element* el : *inspector->el()) {
|
||||
if (el->isBarLine()) {
|
||||
bl = toBarLine(el);
|
||||
bl->undoChangeProperty(Pid::BARLINE_SPAN, false);
|
||||
bl->undoChangeProperty(Pid::BARLINE_SPAN_FROM, BARLINE_SPAN_TICK1_FROM);
|
||||
bl->undoChangeProperty(Pid::BARLINE_SPAN_TO, BARLINE_SPAN_TICK1_TO);
|
||||
|
@ -175,9 +175,9 @@ void InspectorBarLine::presetTick2Clicked()
|
|||
score->startCmd();
|
||||
|
||||
BarLine* bl;
|
||||
for (Element* e : *inspector->el()) {
|
||||
if (e->isBarLine()) {
|
||||
bl = toBarLine(e);
|
||||
for (Element* el : *inspector->el()) {
|
||||
if (el->isBarLine()) {
|
||||
bl = toBarLine(el);
|
||||
bl->undoChangeProperty(Pid::BARLINE_SPAN, false);
|
||||
bl->undoChangeProperty(Pid::BARLINE_SPAN_FROM, BARLINE_SPAN_TICK2_FROM);
|
||||
bl->undoChangeProperty(Pid::BARLINE_SPAN_TO, BARLINE_SPAN_TICK2_TO);
|
||||
|
@ -197,9 +197,9 @@ void InspectorBarLine::presetShort1Clicked()
|
|||
score->startCmd();
|
||||
|
||||
BarLine* bl;
|
||||
for (Element* e : *inspector->el()) {
|
||||
if (e->isBarLine()) {
|
||||
bl = toBarLine(e);
|
||||
for (Element* el : *inspector->el()) {
|
||||
if (el->isBarLine()) {
|
||||
bl = toBarLine(el);
|
||||
bl->undoChangeProperty(Pid::BARLINE_SPAN, false);
|
||||
bl->undoChangeProperty(Pid::BARLINE_SPAN_FROM, BARLINE_SPAN_SHORT1_FROM);
|
||||
int shortDelta = bl->staff() ? (bl->staff()->lines(bl->tick()) - 5) * 2 : 0;
|
||||
|
@ -219,9 +219,9 @@ void InspectorBarLine::presetShort2Clicked()
|
|||
score->startCmd();
|
||||
|
||||
BarLine* bl;
|
||||
for (Element* e : *inspector->el()) {
|
||||
if (e->isBarLine()) {
|
||||
bl = toBarLine(e);
|
||||
for (Element* el : *inspector->el()) {
|
||||
if (el->isBarLine()) {
|
||||
bl = toBarLine(el);
|
||||
bl->undoChangeProperty(Pid::BARLINE_SPAN, false);
|
||||
bl->undoChangeProperty(Pid::BARLINE_SPAN_FROM, BARLINE_SPAN_SHORT2_FROM);
|
||||
int shortDelta = bl->staff() ? (bl->staff()->lines(bl->tick()) - 5) * 2 : 0;
|
||||
|
|
|
@ -76,8 +76,8 @@ InspectorHairpin::InspectorHairpin(QWidget* parent)
|
|||
void InspectorHairpin::updateLineType()
|
||||
{
|
||||
HairpinSegment* hs = toHairpinSegment(inspector->element());
|
||||
Hairpin* h = hs->hairpin();
|
||||
bool userDash = h->lineStyle() == Qt::CustomDashLine;
|
||||
Hairpin* hp = hs->hairpin();
|
||||
bool userDash = hp->lineStyle() == Qt::CustomDashLine;
|
||||
|
||||
l.dashLineLength->setVisible(userDash);
|
||||
l.dashGapLength->setVisible(userDash);
|
||||
|
|
|
@ -27,8 +27,8 @@ InspectorImage::InspectorImage(QWidget* parent)
|
|||
{
|
||||
b.setupUi(addWidget());
|
||||
|
||||
Element* e = inspector->element();
|
||||
bool inFrame = e->parent()->isHBox() || e->parent()->isVBox();
|
||||
Element* el = inspector->element();
|
||||
bool inFrame = el->parent()->isHBox() || el->parent()->isVBox();
|
||||
bool sameTypes = true;
|
||||
|
||||
for (const auto& ee : *inspector->el()) {
|
||||
|
|
|
@ -918,9 +918,9 @@ void InstrumentsWidget::on_instrumentGenreFilter_currentIndexChanged(int index)
|
|||
// filterInstrumentsByGenre
|
||||
//---------------------------------------------------------
|
||||
|
||||
void InstrumentsWidget::filterInstrumentsByGenre(QTreeWidget *instrumentList, QString genre)
|
||||
void InstrumentsWidget::filterInstrumentsByGenre(QTreeWidget *instrList, QString genre)
|
||||
{
|
||||
QTreeWidgetItemIterator iList(instrumentList);
|
||||
QTreeWidgetItemIterator iList(instrList);
|
||||
while (*iList) {
|
||||
(*iList)->setHidden(true);
|
||||
InstrumentTemplateListItem* itli = static_cast<InstrumentTemplateListItem*>(*iList);
|
||||
|
|
|
@ -190,9 +190,9 @@ void KeyCanvas::mouseReleaseEvent(QMouseEvent*)
|
|||
|
||||
void KeyCanvas::dragEnterEvent(QDragEnterEvent* event)
|
||||
{
|
||||
const QMimeData* data = event->mimeData();
|
||||
if (data->hasFormat(mimeSymbolFormat)) {
|
||||
QByteArray a = data->data(mimeSymbolFormat);
|
||||
const QMimeData* dta = event->mimeData();
|
||||
if (dta->hasFormat(mimeSymbolFormat)) {
|
||||
QByteArray a = dta->data(mimeSymbolFormat);
|
||||
|
||||
XmlReader e(a);
|
||||
|
||||
|
|
|
@ -199,8 +199,8 @@ void LayerManager:: accept()
|
|||
l.name = layers->item(i, 0)->text();
|
||||
l.tags = 1;
|
||||
QString ts = layers->item(i, 1)->text();
|
||||
QStringList tags = ts.split(",");
|
||||
foreach (QString tag, tags) {
|
||||
QStringList tgs = ts.split(",");
|
||||
foreach (QString tag, tgs) {
|
||||
for (int idx = 0; idx < 32; ++idx) {
|
||||
if (tag == score->layerTags()[idx]) {
|
||||
l.tags |= 1 << idx;
|
||||
|
|
|
@ -52,11 +52,11 @@ MetaEditDialog::MetaEditDialog(Score* s, QWidget* parent)
|
|||
QGridLayout* grid = static_cast<QGridLayout*>(scrollWidget->layout());
|
||||
while (i.hasNext()) {
|
||||
i.next();
|
||||
QLabel* label = new QLabel;
|
||||
label->setText(i.key());
|
||||
QLabel* l = new QLabel;
|
||||
l->setText(i.key());
|
||||
QLineEdit* text = new QLineEdit(i.value(), 0);
|
||||
connect(text, SIGNAL(textChanged(const QString&)), SLOT(setDirty()));
|
||||
grid->addWidget(label, idx, 0);
|
||||
grid->addWidget(l, idx, 0);
|
||||
grid->addWidget(text, idx, 1);
|
||||
++idx;
|
||||
}
|
||||
|
@ -77,10 +77,10 @@ void MetaEditDialog::newClicked()
|
|||
QGridLayout* grid = static_cast<QGridLayout*>(scrollWidget->layout());
|
||||
if (!s.isEmpty()) {
|
||||
int idx = grid->rowCount();
|
||||
QLabel* label = new QLabel;
|
||||
label->setText(s);
|
||||
QLabel* l = new QLabel;
|
||||
l->setText(s);
|
||||
QLineEdit* text = new QLineEdit;
|
||||
grid->addWidget(label, idx, 0);
|
||||
grid->addWidget(l, idx, 0);
|
||||
grid->addWidget(text, idx, 1);
|
||||
}
|
||||
dirty = true;
|
||||
|
@ -100,9 +100,9 @@ void MetaEditDialog::accept()
|
|||
QLayoutItem* labelItem = grid->itemAtPosition(i, 0);
|
||||
QLayoutItem* dataItem = grid->itemAtPosition(i, 1);
|
||||
if (labelItem && dataItem) {
|
||||
QLabel* label = static_cast<QLabel*>(labelItem->widget());
|
||||
QLabel* l = static_cast<QLabel*>(labelItem->widget());
|
||||
QLineEdit* le = static_cast<QLineEdit*>(dataItem->widget());
|
||||
m.insert(label->text(), le->text());
|
||||
m.insert(l->text(), le->text());
|
||||
}
|
||||
}
|
||||
score->undo(new ChangeMetaTags(score, m));
|
||||
|
|
|
@ -75,8 +75,8 @@ void MuseData::musicalAttribute(QString s, Part* part)
|
|||
TimeSig* ts = new TimeSig(score);
|
||||
Staff* staff = part->staff(0);
|
||||
ts->setTrack(staff->idx() * VOICES);
|
||||
Measure* measure = score->tick2measure(curTick);
|
||||
Segment* seg = measure->getSegment(SegmentType::TimeSig, curTick);
|
||||
Measure* mes = score->tick2measure(curTick);
|
||||
Segment* seg = mes->getSegment(SegmentType::TimeSig, curTick);
|
||||
seg->add(ts);
|
||||
}
|
||||
}
|
||||
|
@ -156,7 +156,7 @@ void MuseData::readChord(Part*, const QString& s)
|
|||
// openSlur
|
||||
//---------------------------------------------------------
|
||||
|
||||
void MuseData::openSlur(int idx, int tick, Staff* staff, int voice)
|
||||
void MuseData::openSlur(int idx, int tick, Staff* staff, int voc)
|
||||
{
|
||||
int staffIdx = staff->idx();
|
||||
if (slur[idx]) {
|
||||
|
@ -165,7 +165,7 @@ void MuseData::openSlur(int idx, int tick, Staff* staff, int voice)
|
|||
}
|
||||
slur[idx] = new Slur(score);
|
||||
slur[idx]->setTick(tick);
|
||||
slur[idx]->setTrack(staffIdx * VOICES + voice);
|
||||
slur[idx]->setTrack(staffIdx * VOICES + voc);
|
||||
score->addElement(slur[idx]);
|
||||
}
|
||||
|
||||
|
@ -173,12 +173,12 @@ void MuseData::openSlur(int idx, int tick, Staff* staff, int voice)
|
|||
// closeSlur
|
||||
//---------------------------------------------------------
|
||||
|
||||
void MuseData::closeSlur(int idx, int tick, Staff* staff, int voice)
|
||||
void MuseData::closeSlur(int idx, int tick, Staff* staff, int voc)
|
||||
{
|
||||
int staffIdx = staff->idx();
|
||||
if (slur[idx]) {
|
||||
slur[idx]->setTick2(tick);
|
||||
slur[idx]->setTrack2(staffIdx * VOICES + voice);
|
||||
slur[idx]->setTrack2(staffIdx * VOICES + voc);
|
||||
slur[idx] = 0;
|
||||
}
|
||||
else
|
||||
|
@ -526,20 +526,20 @@ Measure* MuseData::createMeasure()
|
|||
return 0;
|
||||
}
|
||||
}
|
||||
Measure* measure = new Measure(score);
|
||||
measure->setTick(curTick);
|
||||
Measure* mes = new Measure(score);
|
||||
mes->setTick(curTick);
|
||||
|
||||
#if 0
|
||||
foreach(Staff* s, score->staves()) {
|
||||
if (s->isTop()) {
|
||||
BarLine* barLine = new BarLine(score);
|
||||
barLine->setStaff(s);
|
||||
measure->setEndBarLine(barLine);
|
||||
mes->setEndBarLine(barLine);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
score->measures()->add(measure);
|
||||
return measure;
|
||||
score->measures()->add(mes);
|
||||
return mes;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------
|
||||
|
|
|
@ -2106,9 +2106,9 @@ void MuseScore::openRecentMenu()
|
|||
bool one = false;
|
||||
for (const QFileInfo& fi : recentScores()) {
|
||||
QAction* action = openRecent->addAction(fi.fileName().replace("&", "&&")); // show filename only
|
||||
QString data(fi.canonicalFilePath());
|
||||
action->setData(data);
|
||||
action->setToolTip(data);
|
||||
QString dta(fi.canonicalFilePath());
|
||||
action->setData(dta);
|
||||
action->setToolTip(dta);
|
||||
one = true;
|
||||
}
|
||||
if (one) {
|
||||
|
@ -2392,8 +2392,8 @@ void MuseScore::showMidiImportPanel()
|
|||
|
||||
void MuseScore::dragEnterEvent(QDragEnterEvent* event)
|
||||
{
|
||||
const QMimeData* data = event->mimeData();
|
||||
if (data->hasUrls()) {
|
||||
const QMimeData* dta = event->mimeData();
|
||||
if (dta->hasUrls()) {
|
||||
QList<QUrl>ul = event->mimeData()->urls();
|
||||
foreach(const QUrl& u, ul) {
|
||||
if (MScore::debugMode)
|
||||
|
@ -2413,8 +2413,8 @@ void MuseScore::dragEnterEvent(QDragEnterEvent* event)
|
|||
|
||||
void MuseScore::dropEvent(QDropEvent* event)
|
||||
{
|
||||
const QMimeData* data = event->mimeData();
|
||||
if (data->hasUrls()) {
|
||||
const QMimeData* dta = event->mimeData();
|
||||
if (dta->hasUrls()) {
|
||||
int view = -1;
|
||||
foreach(const QUrl& u, event->mimeData()->urls()) {
|
||||
if (u.scheme() == "file") {
|
||||
|
@ -2577,7 +2577,7 @@ bool MuseScore::midiinEnabled() const
|
|||
// return if midi remote command detected
|
||||
//---------------------------------------------------------
|
||||
|
||||
bool MuseScore::processMidiRemote(MidiRemoteType type, int data, int value)
|
||||
bool MuseScore::processMidiRemote(MidiRemoteType type, int dta, int value)
|
||||
{
|
||||
if (!preferences.getBool(PREF_IO_MIDI_USEREMOTECONTROL))
|
||||
return false;
|
||||
|
@ -2586,11 +2586,11 @@ bool MuseScore::processMidiRemote(MidiRemoteType type, int data, int value)
|
|||
// be triggered by an "On" event, so we need to check if this is one of those.
|
||||
if (!preferences.getBool(PREF_IO_MIDI_ADVANCEONRELEASE)
|
||||
|| type != preferences.midiRemote(RMIDI_REALTIME_ADVANCE).type
|
||||
|| data != preferences.midiRemote(RMIDI_REALTIME_ADVANCE).data)
|
||||
|| dta != preferences.midiRemote(RMIDI_REALTIME_ADVANCE).data)
|
||||
return false;
|
||||
}
|
||||
for (int i = 0; i < MIDI_REMOTES; ++i) {
|
||||
if (preferences.midiRemote(i).type == type && preferences.midiRemote(i).data == data) {
|
||||
if (preferences.midiRemote(i).type == type && preferences.midiRemote(i).data == dta) {
|
||||
if (cv == 0)
|
||||
return false;
|
||||
QAction* a = 0;
|
||||
|
@ -4803,11 +4803,11 @@ void MuseScore::networkFinished()
|
|||
qDebug("header <%s>", qPrintable(s));
|
||||
qDebug("name <%s>", qPrintable(name));
|
||||
|
||||
QByteArray data = reply->readAll();
|
||||
QByteArray dta = reply->readAll();
|
||||
QString tmpName = QDir::tempPath () + "/"+ name;
|
||||
QFile f(tmpName);
|
||||
f.open(QIODevice::WriteOnly);
|
||||
f.write(data);
|
||||
f.write(dta);
|
||||
f.close();
|
||||
|
||||
reply->deleteLater();
|
||||
|
@ -5952,7 +5952,6 @@ QFileInfoList MuseScore::recentScores() const
|
|||
for (const QString& s : _recentScores) {
|
||||
if (s.isEmpty())
|
||||
continue;
|
||||
QString data(s);
|
||||
QFileInfo fi(s);
|
||||
bool alreadyLoaded = false;
|
||||
QString fp = fi.canonicalFilePath();
|
||||
|
@ -6035,8 +6034,8 @@ bool MuseScore::saveMp3(Score* score, const QString& name)
|
|||
|
||||
MP3Exporter exporter;
|
||||
if (!exporter.loadLibrary(MP3Exporter::AskUser::MAYBE)) {
|
||||
QSettings settings;
|
||||
settings.setValue("/Export/lameMP3LibPath", "");
|
||||
QSettings set;
|
||||
set.setValue("/Export/lameMP3LibPath", "");
|
||||
if(!MScore::noGui)
|
||||
QMessageBox::warning(0,
|
||||
tr("Error Opening LAME library"),
|
||||
|
@ -6047,8 +6046,8 @@ bool MuseScore::saveMp3(Score* score, const QString& name)
|
|||
}
|
||||
|
||||
if (!exporter.validLibraryLoaded()) {
|
||||
QSettings settings;
|
||||
settings.setValue("/Export/lameMP3LibPath", "");
|
||||
QSettings set;
|
||||
set.setValue("/Export/lameMP3LibPath", "");
|
||||
if(!MScore::noGui)
|
||||
QMessageBox::warning(0,
|
||||
tr("Error Opening LAME library"),
|
||||
|
|
|
@ -1736,8 +1736,8 @@ void PaletteScrollArea::resizeEvent(QResizeEvent* re)
|
|||
|
||||
void Palette::dragEnterEvent(QDragEnterEvent* event)
|
||||
{
|
||||
const QMimeData* data = event->mimeData();
|
||||
if (data->hasUrls()) {
|
||||
const QMimeData* dta = event->mimeData();
|
||||
if (dta->hasUrls()) {
|
||||
QList<QUrl>ul = event->mimeData()->urls();
|
||||
QUrl u = ul.front();
|
||||
if (MScore::debugMode) {
|
||||
|
@ -1756,7 +1756,7 @@ void Palette::dragEnterEvent(QDragEnterEvent* event)
|
|||
}
|
||||
}
|
||||
}
|
||||
else if (data->hasFormat(mimeSymbolFormat)) {
|
||||
else if (dta->hasFormat(mimeSymbolFormat)) {
|
||||
event->accept();
|
||||
update();
|
||||
}
|
||||
|
@ -1820,8 +1820,8 @@ void Palette::dropEvent(QDropEvent* event)
|
|||
}
|
||||
}
|
||||
else if (datap->hasFormat(mimeSymbolFormat)) {
|
||||
QByteArray data(event->mimeData()->data(mimeSymbolFormat));
|
||||
XmlReader xml(data);
|
||||
QByteArray dta(event->mimeData()->data(mimeSymbolFormat));
|
||||
XmlReader xml(dta);
|
||||
QPointF dragOffset;
|
||||
Fraction duration;
|
||||
ElementType type = Element::readType(xml, &dragOffset, &duration);
|
||||
|
|
|
@ -472,9 +472,9 @@ void PianorollEditor::velocityChanged(int val)
|
|||
// keyPressed
|
||||
//---------------------------------------------------------
|
||||
|
||||
void PianorollEditor::keyPressed(int pitch)
|
||||
void PianorollEditor::keyPressed(int p)
|
||||
{
|
||||
seq->startNote(staff->part()->instrument()->channel(0)->channel, pitch, 80, 0, 0.0);
|
||||
seq->startNote(staff->part()->instrument()->channel(0)->channel, p, 80, 0, 0.0);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------
|
||||
|
@ -506,10 +506,10 @@ void PianorollEditor::heartBeat(Seq* s)
|
|||
// moveLocator
|
||||
//---------------------------------------------------------
|
||||
|
||||
void PianorollEditor::moveLocator(int i, const Pos& pos)
|
||||
void PianorollEditor::moveLocator(int i, const Pos& p)
|
||||
{
|
||||
if (locator[i].valid())
|
||||
score()->setPos(POS(i), pos.tick());
|
||||
score()->setPos(POS(i), p.tick());
|
||||
}
|
||||
|
||||
//---------------------------------------------------------
|
||||
|
@ -678,14 +678,14 @@ void PianorollEditor::showWaveView(bool val)
|
|||
// position in score has changed
|
||||
//---------------------------------------------------------
|
||||
|
||||
void PianorollEditor::posChanged(POS pos, unsigned tick)
|
||||
void PianorollEditor::posChanged(POS p, unsigned tick)
|
||||
{
|
||||
if (locator[int(pos)].tick() == unsigned(tick))
|
||||
if (locator[int(p)].tick() == unsigned(tick))
|
||||
return;
|
||||
setLocator(pos, tick);
|
||||
gv->moveLocator(int(pos));
|
||||
setLocator(p, tick);
|
||||
gv->moveLocator(int(p));
|
||||
if (waveView)
|
||||
waveView->moveLocator(int(pos));
|
||||
waveView->moveLocator(int(p));
|
||||
ruler->update();
|
||||
}
|
||||
|
||||
|
|
|
@ -505,11 +505,11 @@ void PianoView::setStaff(Staff* s, Pos* l)
|
|||
// addChord
|
||||
//---------------------------------------------------------
|
||||
|
||||
void PianoView::addChord(Chord* chord)
|
||||
void PianoView::addChord(Chord* crd)
|
||||
{
|
||||
for (Chord* c : chord->graceNotes())
|
||||
for (Chord* c : crd->graceNotes())
|
||||
addChord(c);
|
||||
for (Note* note : chord->notes()) {
|
||||
for (Note* note : crd->notes()) {
|
||||
if (note->tieBack())
|
||||
continue;
|
||||
for (NoteEvent& e : note->playEvents())
|
||||
|
|
|
@ -135,9 +135,9 @@ void SelectInstrument::on_instrumentGenreFilter_currentIndexChanged(int index)
|
|||
// filterInstrumentsByGenre
|
||||
//---------------------------------------------------------
|
||||
|
||||
void SelectInstrument::filterInstrumentsByGenre(QTreeWidget *instrumentList, QString genre)
|
||||
void SelectInstrument::filterInstrumentsByGenre(QTreeWidget *instrList, QString genre)
|
||||
{
|
||||
QTreeWidgetItemIterator iList(instrumentList);
|
||||
QTreeWidgetItemIterator iList(instrList);
|
||||
while (*iList) {
|
||||
(*iList)->setHidden(true);
|
||||
InstrumentTemplateListItem* itli = static_cast<InstrumentTemplateListItem*>(*iList);
|
||||
|
|
|
@ -1110,7 +1110,7 @@ void SvgPaintEngine::drawImage(const QRectF &r, const QImage &image,
|
|||
<< data.toBase64() << SVG_QUOTE << SVG_ELEMENT_END << endl;
|
||||
}
|
||||
|
||||
void SvgPaintEngine::updateState(const QPaintEngineState &state)
|
||||
void SvgPaintEngine::updateState(const QPaintEngineState &s)
|
||||
{
|
||||
// Always start fresh
|
||||
stateString.clear();
|
||||
|
@ -1121,20 +1121,20 @@ void SvgPaintEngine::updateState(const QPaintEngineState &state)
|
|||
stateStream << SVG_CLASS << getClass(_element) << SVG_QUOTE;
|
||||
|
||||
// Brush and Pen attributes
|
||||
stateStream << qbrushToSvg(state.brush());
|
||||
stateStream << qpenToSvg(state.pen());
|
||||
stateStream << qbrushToSvg(s.brush());
|
||||
stateStream << qpenToSvg(s.pen());
|
||||
|
||||
// TBD: "opacity" attribute: Is it ever used?
|
||||
// Or is opacity determined by fill-opacity & stroke-opacity instead?
|
||||
// PLUS: qFuzzyIsNull() is not officially supported in Qt.
|
||||
// Should probably use QFuzzyCompare() instead.
|
||||
if (!qFuzzyIsNull(state.opacity() - 1))
|
||||
stateStream << SVG_OPACITY << state.opacity() << SVG_QUOTE;
|
||||
if (!qFuzzyIsNull(s.opacity() - 1))
|
||||
stateStream << SVG_OPACITY << s.opacity() << SVG_QUOTE;
|
||||
|
||||
// Translations, SVG transform="translate()", are handled separately from
|
||||
// other transformations such as rotation. Qt translates everything, but
|
||||
// other transformations do occur, and must be handled here.
|
||||
QTransform t = state.transform();
|
||||
QTransform t = s.transform();
|
||||
|
||||
// Tablature Note Text:
|
||||
// m11 and m22 have floating point flotsam, for example: 1.000000629
|
||||
|
|
|
@ -135,8 +135,8 @@ void MuseScore::createNewWorkspace()
|
|||
Workspace::currentWorkspace->save();
|
||||
Workspace::currentWorkspace = Workspace::createNewWorkspace(s);
|
||||
preferences.setPreference(PREF_APP_WORKSPACE, Workspace::currentWorkspace->name());
|
||||
PaletteBox* paletteBox = mscore->getPaletteBox();
|
||||
paletteBox->updateWorkspaces();
|
||||
PaletteBox* pb = mscore->getPaletteBox();
|
||||
pb->updateWorkspaces();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------
|
||||
|
@ -174,13 +174,13 @@ void MuseScore::deleteWorkspace()
|
|||
QFile f(workspace->path());
|
||||
f.remove();
|
||||
delete workspace;
|
||||
PaletteBox* paletteBox = mscore->getPaletteBox();
|
||||
paletteBox->clear();
|
||||
PaletteBox* pb = mscore->getPaletteBox();
|
||||
pb->clear();
|
||||
Workspace::currentWorkspace = Workspace::workspaces().first();
|
||||
preferences.setPreference(PREF_APP_WORKSPACE, Workspace::currentWorkspace->name());
|
||||
changeWorkspace(Workspace::currentWorkspace);
|
||||
paletteBox = mscore->getPaletteBox();
|
||||
paletteBox->updateWorkspaces();
|
||||
pb = mscore->getPaletteBox();
|
||||
pb->updateWorkspaces();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------
|
||||
|
@ -193,8 +193,8 @@ void MuseScore::changeWorkspace(QAction* a)
|
|||
if (qApp->translate("Ms::Workspace", p->name().toUtf8()) == a->text()) {
|
||||
changeWorkspace(p);
|
||||
preferences.setPreference(PREF_APP_WORKSPACE, Workspace::currentWorkspace->name());
|
||||
PaletteBox* paletteBox = mscore->getPaletteBox();
|
||||
paletteBox->updateWorkspaces();
|
||||
PaletteBox* pb = mscore->getPaletteBox();
|
||||
pb->updateWorkspaces();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue