diff --git a/all.h b/all.h index 49e60b48d5cb4..956dd0708586c 100644 --- a/all.h +++ b/all.h @@ -224,12 +224,6 @@ #define Q_ASSERT(a) #endif -#if (defined (_MSCVER) || defined (_MSC_VER)) - // Undefined problematic #def'd macros in Microsoft headers - #undef STRING_NONE - #undef small -#endif - #endif // __cplusplus #endif diff --git a/importexport/musicxml/exportxml.cpp b/importexport/musicxml/exportxml.cpp index b8cd3d091428a..bc920a4a57b63 100644 --- a/importexport/musicxml/exportxml.cpp +++ b/importexport/musicxml/exportxml.cpp @@ -3178,7 +3178,7 @@ static int tremoloCorrection(const Note* const note) static bool isSmallNote(const Note* const note) { - return note->small() || note->chord()->small(); + return note->isSmall() || note->chord()->isSmall(); } //--------------------------------------------------------- @@ -3601,7 +3601,7 @@ void ExportMusicXml::rest(Rest* rest, int staff, const std::vector* ll) if (d.type() != TDuration::DurationType::V_MEASURE) { QString s = d.name(); int dots = rest->dots(); - if (rest->small()) + if (rest->isSmall()) _xml.tag("type size=\"cue\"", s); else _xml.tag("type", s); diff --git a/importexport/musicxml/importmxmlpass2.cpp b/importexport/musicxml/importmxmlpass2.cpp index 394f1cf0f955d..52fb7df5309e0 100644 --- a/importexport/musicxml/importmxmlpass2.cpp +++ b/importexport/musicxml/importmxmlpass2.cpp @@ -2248,7 +2248,7 @@ static void markUserAccidentals(const int firstStaff, static void coerceGraceCue(Chord* mainChord, Chord* graceChord) { - if (mainChord->small()) + if (mainChord->isSmall()) graceChord->setSmall(true); bool anyPlays = false; for (auto n : mainChord->notes()) { @@ -4949,7 +4949,7 @@ static TDuration determineDuration(const bool rest, const QString& type, const i static Chord* findOrCreateChord(Score* score, Measure* m, const Fraction& tick, const int track, const int move, const TDuration duration, const Fraction dura, - Beam::Mode bm, bool small) + Beam::Mode bm, bool isSmall) { //qDebug("findOrCreateChord tick %d track %d dur ticks %d ticks %s bm %hhd", // tick, track, duration.ticks(), qPrintable(dura.print()), bm); @@ -4965,7 +4965,7 @@ static Chord* findOrCreateChord(Score* score, Measure* m, c->setTrack(track); // Chord is initialized with the smallness of its first note. // If a non-small note is added later, this is handled in handleSmallness. - c->setSmall(small); + c->setSmall(isSmall); setChordRestDuration(c, duration, dura); Segment* s = m->getSegment(SegmentType::ChordRest, tick); @@ -5009,14 +5009,14 @@ NoteType graceNoteType(const TDuration duration, const bool slash) */ static Chord* createGraceChord(Score* score, const int track, - const TDuration duration, const bool slash, const bool small) + const TDuration duration, const bool slash, const bool isSmall) { Chord* c = new Chord(score); c->setNoteType(graceNoteType(duration, slash)); c->setTrack(track); // Chord is initialized with the smallness of its first note. // If a non-small note is added later, this is handled in handleSmallness. - c->setSmall(small); + c->setSmall(isSmall); // note grace notes have no durations, use default fraction 0/1 setChordRestDuration(c, duration, Fraction()); return c; @@ -5058,11 +5058,11 @@ static void handleDisplayStep(ChordRest* cr, int step, int octave, const Fractio static void handleSmallness(bool cueOrSmall, Note* note, Chord* c) { if (cueOrSmall) { - note->setSmall(!c->small()); // Avoid redundant smallness + note->setSmall(!c->isSmall()); // Avoid redundant smallness } else { note->setSmall(false); - if (c->small()) { + if (c->isSmall()) { // What was a small chord becomes small notes in a non-small chord c->setSmall(false); for (Note* otherNote : c->notes()) { @@ -5329,7 +5329,7 @@ Note* MusicXMLParserPass2::note(const QString& partId, bool chord = false; bool cue = false; - bool small = false; + bool isSmall = false; bool grace = false; bool rest = false; int staff = 1; @@ -5416,7 +5416,7 @@ Note* MusicXMLParserPass2::note(const QString& partId, else if (_e.name() == "stem") stem(stemDir, noStem); else if (_e.name() == "type") { - small = (_e.attributes().value("size") == "cue" || _e.attributes().value("size") == "grace-cue"); + isSmall = (_e.attributes().value("size") == "cue" || _e.attributes().value("size") == "grace-cue"); type = _e.readElementText(); } else if (_e.name() == "voice") @@ -5521,14 +5521,14 @@ Note* MusicXMLParserPass2::note(const QString& partId, c = findOrCreateChord(_score, measure, noteStartTime, msTrack + msVoice, msMove, - duration, dura, bm, small || cue); + duration, dura, bm, isSmall || cue); } else { // grace note // TODO: check if explicit stem direction should also be set for grace notes // (the DOM parser does that, but seems to have no effect on the autotester) if (!chord || gcl.isEmpty()) { - c = createGraceChord(_score, msTrack + msVoice, duration, graceSlash, small || cue); + c = createGraceChord(_score, msTrack + msVoice, duration, graceSlash, isSmall || cue); // TODO FIX // the setStaffMove() below results in identical behaviour as 2.0: // grace note will be at the wrong staff with the wrong pitch, @@ -5570,7 +5570,7 @@ Note* MusicXMLParserPass2::note(const QString& partId, } else cr->setBeamMode(Beam::Mode::NONE); - cr->setSmall(small); + cr->setSmall(isSmall); if (noteColor != QColor::Invalid) cr->setColor(noteColor); cr->setVisible(printObject); @@ -5578,7 +5578,7 @@ Note* MusicXMLParserPass2::note(const QString& partId, } } else { - handleSmallness(cue || small, note, c); + handleSmallness(cue || isSmall, note, c); note->setPlay(!cue); // cue notes don't play note->setHeadGroup(headGroup); if (noteColor != QColor::Invalid) diff --git a/libmscore/accidental.cpp b/libmscore/accidental.cpp index ad6ce2be0c9ef..0d4d18a4f53e7 100644 --- a/libmscore/accidental.cpp +++ b/libmscore/accidental.cpp @@ -252,7 +252,7 @@ void Accidental::read(XmlReader& e) _role = r; } else if (tag == "small") - _small = e.readInt(); + m_isSmall = e.readInt(); else if (Element::readProperties(e)) ; else @@ -365,7 +365,7 @@ void Accidental::layout() } qreal m = parent() ? parent()->mag() : 1.0; - if (_small) + if (m_isSmall) m *= score()->styleD(Sid::smallNoteMag); setMag(m); @@ -572,7 +572,7 @@ QVariant Accidental::getProperty(Pid propertyId) const { switch (propertyId) { case Pid::ACCIDENTAL_TYPE: return int(_accidentalType); - case Pid::SMALL: return _small; + case Pid::SMALL: return m_isSmall; case Pid::ACCIDENTAL_BRACKET: return int(bracket()); case Pid::ROLE: return int(role()); default: @@ -607,7 +607,7 @@ bool Accidental::setProperty(Pid propertyId, const QVariant& v) setAccidentalType(AccidentalType(v.toInt())); break; case Pid::SMALL: - _small = v.toBool(); + m_isSmall = v.toBool(); break; case Pid::ACCIDENTAL_BRACKET: _bracket = AccidentalBracket(v.toInt()); diff --git a/libmscore/accidental.h b/libmscore/accidental.h index 0b153bb5c5379..689589fb4ee91 100644 --- a/libmscore/accidental.h +++ b/libmscore/accidental.h @@ -65,13 +65,13 @@ struct SymElement { //--------------------------------------------------------- // @@ Accidental // @P role enum (Accidental.AUTO, .USER) (read only) -// @P small bool +// @P isSmall bool //--------------------------------------------------------- class Accidental final : public Element { QList el; AccidentalType _accidentalType { AccidentalType::NONE }; - bool _small { false }; + bool m_isSmall { false }; AccidentalBracket _bracket { AccidentalBracket::NONE }; AccidentalRole _role { AccidentalRole::AUTO }; @@ -108,8 +108,8 @@ class Accidental final : public Element { void setRole(AccidentalRole r) { _role = r; } - bool small() const { return _small; } - void setSmall(bool val) { _small = val; } + bool isSmall() const { return m_isSmall; } + void setSmall(bool val) { m_isSmall = val; } void undoSetSmall(bool val); diff --git a/libmscore/beam.cpp b/libmscore/beam.cpp index e820e784bce0e..2bd601cf34fae 100644 --- a/libmscore/beam.cpp +++ b/libmscore/beam.cpp @@ -366,7 +366,7 @@ void Beam::layout1() int staffIdx = -1; for (ChordRest* cr : qAsConst(_elements)) { - qreal m = cr->small() ? score()->styleD(Sid::smallNoteMag) : 1.0; + qreal m = cr->isSmall() ? score()->styleD(Sid::smallNoteMag) : 1.0; mag = qMax(mag, m); if (cr->isChord()) { c2 = toChord(cr); @@ -1503,11 +1503,11 @@ void Beam::computeStemLen(const std::vector& cl, qreal& py1, int bea qreal firstStemLenPoints = bm.l * _spStaff4; const qreal sgn = (firstStemLenPoints < 0 ? -1.0 : 1.0); const QPointF p1 = cl[0]->stemPosBeam(); - bool small = true; + bool isSmall = true; for (const ChordRest* cr : cl) { if (cr->isChord()) { - if (!cr->small()) - small = false; + if (!cr->isSmall()) + isSmall = false; const qreal minAbsLen = toChord(cr)->minAbsStemLength(); @@ -1524,7 +1524,7 @@ void Beam::computeStemLen(const std::vector& cl, qreal& py1, int bea } py1 += (dy + bm.l) * _spStaff4; - if (small && !staff()->isTabStaff(Fraction(0,1))) { + if (isSmall && !staff()->isTabStaff(Fraction(0,1))) { const qreal offset = (beamLevels == 4) ? _beamDist/2.0 : 0.0; if (bm.l > 0) diff --git a/libmscore/chord.cpp b/libmscore/chord.cpp index 243a1d6eb9833..259e5856ae29d 100644 --- a/libmscore/chord.cpp +++ b/libmscore/chord.cpp @@ -1275,9 +1275,9 @@ void Chord::setScore(Score* s) // Adjustment to the length of the stem in order to accommodate hooks // This function replaces this bit of code: // switch (hookIdx) { -// case 3: normalStemLen += small() ? .5 : 0.75; break; //32nd notes -// case 4: normalStemLen += small() ? 1.0 : 1.5; break; //64th notes -// case 5: normalStemLen += small() ? 1.5 : 2.25; break; //128th notes +// case 3: normalStemLen += isSmall() ? .5 : 0.75; break; //32nd notes +// case 4: normalStemLen += isSmall() ? 1.0 : 1.5; break; //64th notes +// case 5: normalStemLen += isSmall() ? 1.5 : 2.25; break; //128th notes // } // which was not sufficient for two reasons: // 1. It only lengthened the stem for 3, 4, or 5 hooks. @@ -1285,39 +1285,39 @@ void Chord::setScore(Score* s) // This provides a way to take a number of factors into account. Further tweaking may be in order. //----------------------------------------------------------------------------- -qreal hookAdjustment(QString font, int hooks, bool up, bool small) +qreal hookAdjustment(QString font, int hooks, bool up, bool isSmall) { bool fallback = MScore::useFallbackFont && (hooks > 5); if (font == "Emmentaler" && !fallback) { if (up) { if (hooks > 2) - return (hooks - 2) * (small ? .75 : 1); + return (hooks - 2) * (isSmall ? .75 : 1); } else { if (hooks == 3) - return (small ? .75 : 1); + return (isSmall ? .75 : 1); else if (hooks > 3) - return (hooks - 2) * (small ? .5 : .75); + return (hooks - 2) * (isSmall ? .5 : .75); } } else if (font == "Gonville" && !fallback) { if (up) { if (hooks > 2) - return (hooks - 2) * (small ? .5 : .75); + return (hooks - 2) * (isSmall ? .5 : .75); } else { if (hooks > 1) - return (hooks - 1) * (small ? .5 : .75); + return (hooks - 1) * (isSmall ? .5 : .75); } } else if (font == "MuseJazz") { if (hooks > 2) - return (hooks - 2) * (small ? .75 : 1); + return (hooks - 2) * (isSmall ? .75 : 1); } else { if (hooks > 2) - return (hooks - 2) * (small ? .5 : .75); + return (hooks - 2) * (isSmall ? .5 : .75); } return 0; } @@ -1369,12 +1369,12 @@ qreal Chord::defaultStemLength() const qreal shortest = score()->styleS(Sid::shortestStem).val(); if (hookIdx) { if (up()) - shortest = qMax(shortest, small() ? 2.0 : 3.0); + shortest = qMax(shortest, isSmall() ? 2.0 : 3.0); else - shortest = qMax(shortest, small() ? 2.25 : 3.5); + shortest = qMax(shortest, isSmall() ? 2.25 : 3.5); } - qreal normalStemLen = small() ? 2.5 : 3.5; + qreal normalStemLen = isSmall() ? 2.5 : 3.5; if (hookIdx && tab == 0) { if (up() && durationType().dots()) { // @@ -2769,7 +2769,7 @@ QVariant Chord::getProperty(Pid propertyId) const { switch (propertyId) { case Pid::NO_STEM: return noStem(); - case Pid::SMALL: return small(); + case Pid::SMALL: return isSmall(); case Pid::STEM_DIRECTION: return QVariant::fromValue(stemDirection()); default: return ChordRest::getProperty(propertyId); @@ -2982,7 +2982,7 @@ void Chord::removeMarkings(bool keepTremolo) qreal Chord::chordMag() const { qreal m = 1.0; - if (small()) + if (isSmall()) m *= score()->styleD(Sid::smallNoteMag); if (_noteType != NoteType::NORMAL) m *= score()->styleD(Sid::graceNoteMag); @@ -3445,7 +3445,7 @@ void Chord::layoutArticulations() return; const Staff* st = staff(); const StaffType* staffType = st->staffTypeForElement(this); - qreal mag = (staffType->small() ? score()->styleD(Sid::smallStaffMag) : 1.0) * staffType->userMag(); + qreal mag = (staffType->isSmall() ? score()->styleD(Sid::smallStaffMag) : 1.0) * staffType->userMag(); qreal _spatium = score()->spatium() * mag; qreal _spStaff = _spatium * staffType->lineDistance().val(); diff --git a/libmscore/chordrest.cpp b/libmscore/chordrest.cpp index 58766c85a89ae..5844a8dd1c2f8 100644 --- a/libmscore/chordrest.cpp +++ b/libmscore/chordrest.cpp @@ -63,7 +63,7 @@ ChordRest::ChordRest(Score* s) _tabDur = 0; _up = true; _beamMode = Beam::Mode::AUTO; - _small = false; + m_isSmall = false; _crossMeasure = CrossMeasure::UNKNOWN; } @@ -78,7 +78,7 @@ ChordRest::ChordRest(const ChordRest& cr, bool link) _beamMode = cr._beamMode; _up = cr._up; - _small = cr._small; + m_isSmall = cr.m_isSmall; _melismaEnds = cr._melismaEnds; _crossMeasure = cr._crossMeasure; @@ -268,7 +268,7 @@ bool ChordRest::readProperties(XmlReader& e) e.skipCurrentElement(); } else if (tag == "small") - _small = e.readInt(); + m_isSmall = e.readInt(); else if (tag == "duration") setTicks(e.readFraction()); else if (tag == "ticklen") { // obsolete (version < 1.12) @@ -387,7 +387,7 @@ void ChordRest::readAddConnector(ConnectorInfoReader* info, bool pasteMode) void ChordRest::setSmall(bool val) { - _small = val; + m_isSmall = val; } //--------------------------------------------------------- @@ -845,7 +845,7 @@ void ChordRest::localSpatiumChanged(qreal oldValue, qreal newValue) QVariant ChordRest::getProperty(Pid propertyId) const { switch (propertyId) { - case Pid::SMALL: return QVariant(small()); + case Pid::SMALL: return QVariant(isSmall()); case Pid::BEAM_MODE: return int(beamMode()); case Pid::STAFF_MOVE: return staffMove(); case Pid::DURATION_TYPE: return QVariant::fromValue(actualDurationType()); diff --git a/libmscore/chordrest.h b/libmscore/chordrest.h index 2e38b9a13b93c..19297eb70994e 100644 --- a/libmscore/chordrest.h +++ b/libmscore/chordrest.h @@ -60,7 +60,7 @@ class ChordRest : public DurationElement { Beam* _beam; Beam::Mode _beamMode; bool _up; // actual stem direction - bool _small; + bool m_isSmall; std::set _melismaEnds; // lyrics ending on this ChordRest, used for spacing // CrossMeasure: combine 2 tied notes if across a bar line and can be combined in a single duration @@ -109,7 +109,7 @@ class ChordRest : public DurationElement { void setUp(bool val) { _up = val; } - bool small() const { return _small; } + bool isSmall() const { return m_isSmall; } void setSmall(bool val); void undoSetSmall(bool val); diff --git a/libmscore/clef.cpp b/libmscore/clef.cpp index f7f8b001329d3..819845a27e047 100644 --- a/libmscore/clef.cpp +++ b/libmscore/clef.cpp @@ -100,7 +100,7 @@ Clef::Clef(Score* s) qreal Clef::mag() const { qreal mag = staff() ? staff()->mag(tick()) : 1.0; - if (_small) + if (m_isSmall) mag *= score()->styleD(Sid::smallClefMag); return mag; } @@ -273,8 +273,8 @@ Element* Clef::drop(EditData& data) void Clef::setSmall(bool val) { - if (val != _small) { - _small = val; + if (val != m_isSmall) { + m_isSmall = val; } } @@ -462,7 +462,7 @@ QVariant Clef::getProperty(Pid propertyId) const case Pid::CLEF_TYPE_CONCERT: return int(_clefTypes._concertClef); case Pid::CLEF_TYPE_TRANSPOSING: return int(_clefTypes._transposingClef); case Pid::SHOW_COURTESY: return showCourtesy(); - case Pid::SMALL: return small(); + case Pid::SMALL: return isSmall(); default: return Element::getProperty(propertyId); } diff --git a/libmscore/clef.h b/libmscore/clef.h index bd431e1015d51..6888d457fc71d 100644 --- a/libmscore/clef.h +++ b/libmscore/clef.h @@ -126,13 +126,13 @@ class ClefInfo { /// Graphic representation of a clef. // // @P showCourtesy bool show/hide courtesy clef when applicable -// @P small bool small, mid-staff clef (read only, set by layout) +// @P isSmall bool small, mid-staff clef (read only, set by layout) //--------------------------------------------------------- class Clef final : public Element { SymId symId; bool _showCourtesy = true; - bool _small = false; + bool m_isSmall = false; bool _forInstrumentChange = false; ClefTypeList _clefTypes { ClefType::INVALID }; @@ -155,7 +155,7 @@ class Clef final : public Element { bool isEditable() const override { return false; } - bool small() const { return _small; } + bool isSmall() const { return m_isSmall; } void setSmall(bool val); bool showCourtesy() const { return _showCourtesy; } diff --git a/libmscore/cmd.cpp b/libmscore/cmd.cpp index e6bb9aebde9ff..e24f791f10399 100644 --- a/libmscore/cmd.cpp +++ b/libmscore/cmd.cpp @@ -3191,7 +3191,7 @@ void Score::cmdSlashFill() p.segment = s; p.staffIdx = staffIdx; p.line = line; - p.fret = FRET_NONE; + p.fret = INVALID_FRET_INDEX; _is.setRest(false); // needed for tab nv = noteValForPosition(p, AccidentalType::NONE, error); } diff --git a/libmscore/edit.cpp b/libmscore/edit.cpp index faaff2c009e98..43dbacfdf219d 100644 --- a/libmscore/edit.cpp +++ b/libmscore/edit.cpp @@ -4003,7 +4003,7 @@ void Score::undoChangeClef(Staff* ostaff, Element* e, ClefType ct, bool forInstr Clef* gclef = 0; Fraction tick = e->tick(); Fraction rtick = e->rtick(); - bool small = (st == SegmentType::Clef); + bool isSmall = (st == SegmentType::Clef); for (Staff* staff : ostaff->staffList()) { // if (staff->staffType(tick)->group() != ClefInfo::staffGroup(ct)) // continue; @@ -4086,7 +4086,7 @@ void Score::undoChangeClef(Staff* ostaff, Element* e, ClefType ct, bool forInstr if (forInstrumentChange) { clef->setForInstrumentChange(true); } - clef->setSmall(small); + clef->setSmall(isSmall); } } diff --git a/libmscore/layout.cpp b/libmscore/layout.cpp index 12c1f498d5c96..3c49514bc5b61 100644 --- a/libmscore/layout.cpp +++ b/libmscore/layout.cpp @@ -389,7 +389,7 @@ void Score::layoutChords1(Segment* segment, int staffIdx) // that notes must be one same line with same tpc // noteheads must be unmirrored and of same group // and chords must be same size (or else sharing code won't work) - if (n->headGroup() != p->headGroup() || n->tpc() != p->tpc() || n->mirror() || p->mirror() || nchord->small() != pchord->small()) { + if (n->headGroup() != p->headGroup() || n->tpc() != p->tpc() || n->mirror() || p->mirror() || nchord->isSmall() != pchord->isSmall()) { shareHeads = false; } else { @@ -402,7 +402,7 @@ void Score::layoutChords1(Segment* segment, int staffIdx) // thus user can force notes to be shared despite differing number of dots or either being stemless // by setting one of the notehead types to match the other or by making one notehead invisible // TODO: consider adding a style option, staff properties, or note property to control sharing - if ((nchord->dots() != pchord->dots() || !nchord->stem() || !pchord->stem() || nHeadType != pHeadType || n->small() || p->small()) && + if ((nchord->dots() != pchord->dots() || !nchord->stem() || !pchord->stem() || nHeadType != pHeadType || n->isSmall() || p->isSmall()) && ((n->headType() == NoteHead::Type::HEAD_AUTO && p->headType() == NoteHead::Type::HEAD_AUTO) || nHeadType != pHeadType) && (n->visible() == p->visible())) { shareHeads = false; @@ -3077,7 +3077,7 @@ void Score::getNextMeasure(LayoutContext& lc) if (!cr) continue; qreal m = staff->mag(&segment); - if (cr->small()) + if (cr->isSmall()) m *= score()->styleD(Sid::smallNoteMag); if (cr->isChord()) { diff --git a/libmscore/mscore.h b/libmscore/mscore.h index c1971eb1f36a4..dae808db69c3f 100644 --- a/libmscore/mscore.h +++ b/libmscore/mscore.h @@ -101,8 +101,8 @@ static const char mimeStaffListFormat[] = "application/musescore/stafflist"; static const int VISUAL_STRING_NONE = -100; // no ordinal for the visual repres. of string (topmost in TAB // varies according to visual order and presence of bass strings) -static const int STRING_NONE = -1; // no ordinal for a physical string (0 = topmost in instrument) -static const int FRET_NONE = -1; // no ordinal for a fret +static const int INVALID_STRING_INDEX = -1; // no ordinal for a physical string (0 = topmost in instrument) +static const int INVALID_FRET_INDEX = -1; // no ordinal for a fret //--------------------------------------------------------- // BracketType diff --git a/libmscore/note.cpp b/libmscore/note.cpp index 83a57b7f332b0..479662d7cc9a0 100644 --- a/libmscore/note.cpp +++ b/libmscore/note.cpp @@ -632,7 +632,7 @@ Note::Note(const Note& n, bool link) _headType = n._headType; _mirror = n._mirror; _userMirror = n._userMirror; - _small = n._small; + m_isSmall = n.m_isSmall; _userDotPosition = n._userDotPosition; _fixed = n._fixed; _fixedLine = n._fixedLine; @@ -988,7 +988,7 @@ qreal Note::noteheadCenterX() const qreal Note::tabHeadWidth(const StaffType* tab) const { qreal val; - if (tab && _fret != FRET_NONE && _string != STRING_NONE) { + if (tab && _fret != INVALID_FRET_INDEX && _string != INVALID_STRING_INDEX) { QFont f = tab->fretFont(); f.setPointSizeF(tab->fretFontSize()); QFontMetricsF fm(f, MScore::paintDevice()); @@ -1017,7 +1017,7 @@ qreal Note::headHeight() const qreal Note::tabHeadHeight(const StaffType* tab) const { - if (tab && _fret != FRET_NONE && _string != STRING_NONE) + if (tab && _fret != INVALID_FRET_INDEX && _string != INVALID_STRING_INDEX) return tab->fretBoxH() * magS(); return headHeight(); } @@ -2338,7 +2338,7 @@ void Note::reset() qreal Note::mag() const { qreal m = chord()->mag(); - if (_small) + if (m_isSmall) m *= score()->styleD(Sid::smallNoteMag); return m; } @@ -2349,7 +2349,7 @@ qreal Note::mag() const void Note::setSmall(bool val) { - _small = val; + m_isSmall = val; } //--------------------------------------------------------- @@ -2779,7 +2779,7 @@ QVariant Note::getProperty(Pid propertyId) const case Pid::TPC2: return _tpc[1]; case Pid::SMALL: - return small(); + return isSmall(); case Pid::MIRROR_HEAD: return int(userMirror()); case Pid::DOT_POSITION: diff --git a/libmscore/note.h b/libmscore/note.h index 32860a990bfc6..b44440fb0dc27 100644 --- a/libmscore/note.h +++ b/libmscore/note.h @@ -187,8 +187,8 @@ struct NoteVal { int pitch { -1 }; int tpc1 { Tpc::TPC_INVALID }; int tpc2 { Tpc::TPC_INVALID }; - int fret { FRET_NONE }; - int string { STRING_NONE }; + int fret { INVALID_FRET_INDEX }; + int string { INVALID_STRING_INDEX }; NoteHead::Group headGroup { NoteHead::Group::HEAD_NORMAL }; NoteVal() {} @@ -217,7 +217,7 @@ static const int INVALID_LINE = -10000; // @P pitch int midi pitch // @P play bool play note // @P ppitch int actual played midi pitch (honoring ottavas) (read only) -// @P small bool small notehead +// @P isSmall bool small notehead // @P string int string number in tablature // @P subchannel int midi subchannel (for midi articulation) (read only) // @P tieBack Tie note backward tie (null if none, read only) @@ -249,7 +249,7 @@ class Note final : public Element { ///< two or more notes on the same string bool dragMode { false }; bool _mirror { false }; ///< True if note is mirrored at stem. - bool _small { false }; + bool m_isSmall { false }; bool _play { true }; // note is not played if false mutable bool _mark { false }; // for use in sequencer bool _fixed { false }; // for slash notation @@ -409,7 +409,7 @@ class Note final : public Element { bool mirror() const { return _mirror; } void setMirror(bool val) { _mirror = val; } - bool small() const { return _small; } + bool isSmall() const { return m_isSmall; } void setSmall(bool val); bool play() const { return _play; } diff --git a/libmscore/noteentry.cpp b/libmscore/noteentry.cpp index 12bd3699a7b3e..844215e4ab522 100644 --- a/libmscore/noteentry.cpp +++ b/libmscore/noteentry.cpp @@ -81,7 +81,7 @@ NoteVal Score::noteValForPosition(Position pos, AccidentalType at, bool &error) } // build a default NoteVal for that string nval.string = line; - if (pos.fret != FRET_NONE) // if a fret is given, use it + if (pos.fret != INVALID_FRET_INDEX) // if a fret is given, use it nval.fret = pos.fret; else { // if no fret, use 0 as default _is.setString(line); diff --git a/libmscore/rest.cpp b/libmscore/rest.cpp index 3ae5d95be6b41..033b68d058bf7 100644 --- a/libmscore/rest.cpp +++ b/libmscore/rest.cpp @@ -790,7 +790,7 @@ void Rest::reset() qreal Rest::mag() const { qreal m = staff() ? staff()->mag(this) : 1.0; - if (small()) + if (isSmall()) m *= score()->styleD(Sid::smallNoteMag); return m; } @@ -868,7 +868,7 @@ qreal Rest::rightEdge() const bool Rest::accent() { - return (voice() >= 2 && small()); + return (voice() >= 2 && isSmall()); } //--------------------------------------------------------- diff --git a/libmscore/score.cpp b/libmscore/score.cpp index 157e64b79586d..7548562632d2e 100644 --- a/libmscore/score.cpp +++ b/libmscore/score.cpp @@ -1074,7 +1074,7 @@ bool Score::getPosition(Position* pos, const QPointF& p, int voice) const if (measure == 0) return false; - pos->fret = FRET_NONE; + pos->fret = INVALID_FRET_INDEX; // // search staff // @@ -3383,7 +3383,7 @@ void Score::collectNoteMatch(void* data, Element* e) return; if (p->pitch != -1 && p->pitch != n->pitch()) return; - if (p->string != STRING_NONE && p->string != n->string()) + if (p->string != INVALID_STRING_INDEX && p->string != n->string()) return; if (p->tpc != Tpc::TPC_INVALID && p->tpc != n->tpc()) return; diff --git a/libmscore/score.h b/libmscore/score.h index 063fd58f64898..0547577d3f58a 100644 --- a/libmscore/score.h +++ b/libmscore/score.h @@ -207,7 +207,7 @@ struct Position { Segment* segment { 0 }; int staffIdx { -1 }; int line { 0 }; - int fret { FRET_NONE }; + int fret { INVALID_FRET_INDEX }; QPointF pos; }; diff --git a/libmscore/select.h b/libmscore/select.h index acc398778f600..009d2089e959b 100644 --- a/libmscore/select.h +++ b/libmscore/select.h @@ -54,7 +54,7 @@ struct ElementPattern { struct NotePattern { QList el; int pitch = -1; - int string = STRING_NONE; + int string = INVALID_STRING_INDEX; int tpc = Tpc::TPC_INVALID; NoteHead::Group notehead = NoteHead::Group::HEAD_INVALID; TDuration durationType = TDuration(); diff --git a/libmscore/staff.cpp b/libmscore/staff.cpp index 497b5d9033cc1..4f0253a9c5da3 100644 --- a/libmscore/staff.cpp +++ b/libmscore/staff.cpp @@ -829,7 +829,7 @@ qreal Staff::spatium(const Element* e) const qreal Staff::mag(const StaffType* stt) const { - return (stt->small() ? score()->styleD(Sid::smallStaffMag) : 1.0) * stt->userMag(); + return (stt->isSmall() ? score()->styleD(Sid::smallStaffMag) : 1.0) * stt->userMag(); } qreal Staff::mag(const Fraction& tick) const @@ -1333,7 +1333,7 @@ QVariant Staff::getProperty(Pid id) const { switch (id) { case Pid::SMALL: - return staffType(Fraction(0,1))->small(); + return staffType(Fraction(0,1))->isSmall(); case Pid::MAG: return staffType(Fraction(0,1))->userMag(); case Pid::STAFF_INVISIBLE: diff --git a/libmscore/stafftype.cpp b/libmscore/stafftype.cpp index 4f7df9bcfc67a..eec52d0f3890b 100644 --- a/libmscore/stafftype.cpp +++ b/libmscore/stafftype.cpp @@ -634,7 +634,7 @@ static const QString unknownFret = QString("?"); QString StaffType::fretString(int fret, int string, bool ghost) const { - if (fret == FRET_NONE) + if (fret == INVALID_FRET_INDEX) return unknownFret; if (ghost) return _fretFonts[_fretFontIdx].ghostChar; @@ -1385,7 +1385,7 @@ void StaffType::initStaffTypes() qreal StaffType::spatium(Score* score) const { - return score->spatium() * (small() ? score->styleD(Sid::smallStaffMag) : 1.0) * userMag(); + return score->spatium() * (isSmall() ? score->styleD(Sid::smallStaffMag) : 1.0) * userMag(); } } // namespace Ms diff --git a/libmscore/stafftype.h b/libmscore/stafftype.h index ebb8577212707..d55059de3a204 100644 --- a/libmscore/stafftype.h +++ b/libmscore/stafftype.h @@ -297,7 +297,7 @@ class StaffType { void setShowBarlines(bool val) { _showBarlines = val; } bool showBarlines() const { return _showBarlines; } qreal userMag() const { return _userMag; } - bool small() const { return _small; } + bool isSmall() const { return _small; } bool invisible() const { return _invisible; } const QColor& color() const { return _color; } void setUserMag(qreal val) { _userMag = val; } diff --git a/libmscore/stafftypechange.cpp b/libmscore/stafftypechange.cpp index 68addcdd95101..602f6f35c0dd2 100644 --- a/libmscore/stafftypechange.cpp +++ b/libmscore/stafftypechange.cpp @@ -161,7 +161,7 @@ QVariant StaffTypeChange::getProperty(Pid propertyId) const case Pid::MAG: return _staffType->userMag(); case Pid::SMALL: - return _staffType->small(); + return _staffType->isSmall(); case Pid::STAFF_INVISIBLE: return _staffType->invisible(); case Pid::STAFF_COLOR: diff --git a/libmscore/stringdata.cpp b/libmscore/stringdata.cpp index 2aeb7d0778c1d..02ee5ce51c6f9 100644 --- a/libmscore/stringdata.cpp +++ b/libmscore/stringdata.cpp @@ -131,7 +131,7 @@ int StringData::getPitch(int string, int fret, Staff* staff, const Fraction& tic // fret // Returns the fret corresponding to the pitch / string combination // at given tick of given staff. -// Returns FRET_NONE if not possible +// Returns INVALID_FRET_INDEX if not possible //--------------------------------------------------------- int StringData::fret(int pitch, int string, Staff* staff, const Fraction& tick) const @@ -196,11 +196,11 @@ void StringData::fretChords(Chord * chord) const minFret = INT32_MAX; maxFret = INT32_MIN; foreach(Note* note, sortedNotes) { - if (note->string() != STRING_NONE) + if (note->string() != INVALID_STRING_INDEX) bUsed[note->string()]++; - if (note->fret() != FRET_NONE && note->fret() < minFret) + if (note->fret() != INVALID_FRET_INDEX && note->fret() < minFret) minFret = note->fret(); - if (note->fret() != FRET_NONE && note->fret() > maxFret) + if (note->fret() != INVALID_FRET_INDEX && note->fret() > maxFret) maxFret = note->fret(); } @@ -210,7 +210,7 @@ void StringData::fretChords(Chord * chord) const nFret = nNewFret = note->fret(); note->setFretConflict(false); // assume no conflicts on this note // if no fretting (any invalid fretting has been erased by sortChordNotes() ) - if (nString == STRING_NONE /*|| nFret == FRET_NONE || getPitch(nString, nFret) != note->pitch()*/) { + if (nString == INVALID_STRING_INDEX /*|| nFret == INVALID_FRET_INDEX || getPitch(nString, nFret) != note->pitch()*/) { // get a new fretting if (!convertPitch(note->pitch(), pitchOffset, &nNewString, &nNewFret) ) { // no way to fit this note in this tab: @@ -234,7 +234,7 @@ void StringData::fretChords(Chord * chord) const // attempt to find a suitable string, from topmost for (nTempString=0; nTempString < strings(); nTempString++) { if (bUsed[nTempString] < 1 - && (nTempFret=fret(note->pitch(), nTempString, pitchOffset)) != FRET_NONE) { + && (nTempFret=fret(note->pitch(), nTempString, pitchOffset)) != INVALID_FRET_INDEX) { bUsed[nNewString]--; // free previous string bUsed[nTempString]++; // and occupy new string nNewFret = nTempFret; @@ -387,17 +387,17 @@ int StringData::getPitch(int string, int fret, int pitchOffset) const //--------------------------------------------------------- // fret // Returns the fret corresponding to the pitch / string / pitchOffset combination. -// returns FRET_NONE if not possible +// returns INVALID_FRET_INDEX if not possible //--------------------------------------------------------- int StringData::fret(int pitch, int string, int pitchOffset) const { int strings = stringTable.size(); if (strings < 1) // no strings at all! - return FRET_NONE; + return INVALID_FRET_INDEX; if (string < 0 || string >= strings) // no such a string - return FRET_NONE; + return INVALID_FRET_INDEX; pitch += pitchOffset; @@ -408,7 +408,7 @@ int StringData::fret(int pitch, int string, int pitchOffset) const // fret number is invalid or string cannot be fretted if (fret < 0 || fret >= _frets || (fret > 0 && strg.open)) - return FRET_NONE; + return INVALID_FRET_INDEX ; return fret; } @@ -432,10 +432,10 @@ void StringData::sortChordNotes(QMap& sortedNotes, const Chord *cho fret = note->fret(); // if note not fretted yet or current fretting no longer valid, // use most convenient string as key - if (string <= STRING_NONE || fret <= FRET_NONE + if (string <= INVALID_STRING_INDEX || fret <= INVALID_FRET_INDEX || getPitch(string, fret, pitchOffset) != note->pitch()) { - note->setString(STRING_NONE); - note->setFret(FRET_NONE); + note->setString(INVALID_STRING_INDEX); + note->setFret(INVALID_FRET_INDEX); convertPitch(note->pitch(), pitchOffset, &string, &fret); } key = string * 100000; diff --git a/libmscore/tuplet.cpp b/libmscore/tuplet.cpp index b2bc5cbeb1dad..60bd7a5f72d10 100644 --- a/libmscore/tuplet.cpp +++ b/libmscore/tuplet.cpp @@ -199,14 +199,14 @@ void Tuplet::layout() else _number->setXmlText(QString("%1:%2").arg(_ratio.numerator()).arg(_ratio.denominator())); - bool small = true; + bool isSmall = true; for (const DurationElement* e : _elements) { - if (e->isChordRest() && !toChordRest(e)->small()) { - small = false; + if (e->isChordRest() && !toChordRest(e)->isSmall()) { + isSmall = false; break; } } - _number->setMag(small ? score()->styleD(Sid::smallNoteMag) : 1.0); + _number->setMag(isSmall ? score()->styleD(Sid::smallNoteMag) : 1.0); } else { diff --git a/mscore/debugger/accidental.ui b/mscore/debugger/accidental.ui index 59f94e857d6c3..f17273ee384db 100644 --- a/mscore/debugger/accidental.ui +++ b/mscore/debugger/accidental.ui @@ -60,7 +60,7 @@ - + small diff --git a/mscore/debugger/clef.ui b/mscore/debugger/clef.ui index 05f7b1dfb8773..0b69291b7fbed 100644 --- a/mscore/debugger/clef.ui +++ b/mscore/debugger/clef.ui @@ -17,7 +17,16 @@ 6 - + + 9 + + + 9 + + + 9 + + 9 @@ -37,7 +46,16 @@ 6 - + + 0 + + + 0 + + + 0 + + 0 @@ -175,7 +193,7 @@ - + small diff --git a/mscore/debugger/debugger.cpp b/mscore/debugger/debugger.cpp index 5a49a0049efee..fd04f96c06084 100644 --- a/mscore/debugger/debugger.cpp +++ b/mscore/debugger/debugger.cpp @@ -2531,7 +2531,7 @@ void AccidentalView::setElement(Element* e) //TODO acc.hasBracket->setChecked(s->hasBracket()); acc.accAuto->setChecked(s->role() == AccidentalRole::AUTO); acc.accUser->setChecked(s->role() == AccidentalRole::USER); - acc.small->setChecked(s->small()); + acc.isSmall->setChecked(s->isSmall()); } //--------------------------------------------------------- @@ -2555,7 +2555,7 @@ void ClefView::setElement(Element* e) clef.clefType->setValue(int(c->clefType())); clef.showCourtesy->setChecked(c->showCourtesy()); - clef.small->setChecked(c->small()); + clef.isSmall->setChecked(c->isSmall()); clef.concertClef->setValue(int(c->concertClef())); clef.transposingClef->setValue(int(c->transposingClef())); diff --git a/mscore/editstaff.cpp b/mscore/editstaff.cpp index daa2d846aa99b..c91fd56744cd3 100644 --- a/mscore/editstaff.cpp +++ b/mscore/editstaff.cpp @@ -100,7 +100,7 @@ void EditStaff::setStaff(Staff* s, const Fraction& tick) Score* score = part->score(); staff = new Staff(score); StaffType* stt = staff->setStaffType(Fraction(0,1), *orgStaff->staffType(Fraction(0,1))); - stt->setSmall(orgStaff->staffType(Fraction(0,1))->small()); + stt->setSmall(orgStaff->staffType(Fraction(0,1))->isSmall()); stt->setInvisible(orgStaff->staffType(Fraction(0,1))->invisible()); staff->setUserDist(orgStaff->userDist()); stt->setColor(orgStaff->staffType(Fraction(0,1))->color()); @@ -127,7 +127,7 @@ void EditStaff::setStaff(Staff* s, const Fraction& tick) // set dlg controls spinExtraDistance->setValue(s->userDist() / score->spatium()); invisible->setChecked(staff->invisible(Fraction(0,1))); - small->setChecked(stt->small()); + isSmall->setChecked(stt->isSmall()); color->setColor(stt->color()); partName->setText(part->partName()); cutaway->setChecked(staff->cutaway()); @@ -407,7 +407,7 @@ void EditStaff::apply() orgStaff->undoChangeProperty(Pid::MAG, mag->value() / 100.0); orgStaff->undoChangeProperty(Pid::STAFF_COLOR, color->color()); - orgStaff->undoChangeProperty(Pid::SMALL, small->isChecked()); + orgStaff->undoChangeProperty(Pid::SMALL, isSmall->isChecked()); if (inv != orgStaff->invisible(Fraction(0,1)) || clefType != orgStaff->defaultClefType() diff --git a/mscore/editstaff.ui b/mscore/editstaff.ui index 93f3556850ad8..d9ef25005d0b5 100644 --- a/mscore/editstaff.ui +++ b/mscore/editstaff.ui @@ -61,7 +61,7 @@ - + 0 @@ -1007,7 +1007,7 @@ showTimesig showBarlines hideSystemBarLine - small + isSmall invisible color cutaway diff --git a/mscore/inspector/inspector.cpp b/mscore/inspector/inspector.cpp index b951f235d578d..0e916147d1276 100644 --- a/mscore/inspector/inspector.cpp +++ b/mscore/inspector/inspector.cpp @@ -514,7 +514,7 @@ InspectorStaffTypeChange::InspectorStaffTypeChange(QWidget* parent) iList = { { Pid::STAFF_YOFFSET, 0, sl.yoffset, sl.resetYoffset }, - { Pid::SMALL, 0, sl.small, sl.resetSmall }, + { Pid::SMALL, 0, sl.isSmall, sl.resetSmall }, { Pid::MAG, 0, sl.scale, sl.resetScale }, { Pid::STAFF_LINES, 0, sl.lines, sl.resetLines }, { Pid::STEP_OFFSET, 0, sl.stepOffset, sl.resetStepOffset }, @@ -751,7 +751,7 @@ InspectorRest::InspectorRest(QWidget* parent) const std::vector iiList = { { Pid::LEADING_SPACE, 1, s.leadingSpace, s.resetLeadingSpace }, - { Pid::SMALL, 0, r.small, r.resetSmall }, + { Pid::SMALL, 0, r.isSmall, r.resetSmall }, }; const std::vector ppList = { { s.title, s.panel }, @@ -1046,7 +1046,7 @@ InspectorAccidental::InspectorAccidental(QWidget* parent) a.setupUi(addWidget()); const std::vector iiList = { - { Pid::SMALL, 0, a.small, a.resetSmall }, + { Pid::SMALL, 0, a.isSmall, a.resetSmall }, { Pid::ACCIDENTAL_BRACKET, 0, a.bracket, a.resetBracket } }; a.bracket->clear(); diff --git a/mscore/inspector/inspectorNote.cpp b/mscore/inspector/inspectorNote.cpp index d7ced7840bcd8..207f14550be17 100644 --- a/mscore/inspector/inspectorNote.cpp +++ b/mscore/inspector/inspectorNote.cpp @@ -92,7 +92,7 @@ InspectorNote::InspectorNote(QWidget* parent) } const std::vector iiList = { - { Pid::SMALL, 0, n.small, n.resetSmall }, + { Pid::SMALL, 0, n.isSmall, n.resetSmall }, { Pid::HEAD_SCHEME, 0, n.noteHeadScheme, n.resetNoteHeadScheme }, { Pid::HEAD_GROUP, 0, n.noteHeadGroup, n.resetNoteHeadGroup }, { Pid::HEAD_TYPE, 0, n.noteHeadType, n.resetNoteHeadType }, @@ -105,7 +105,7 @@ InspectorNote::InspectorNote(QWidget* parent) { Pid::FIXED_LINE, 0, n.fixedLine, n.resetFixedLine }, { Pid::OFFSET, 1, c.offset, c.resetOffset }, - { Pid::SMALL, 1, c.small, c.resetSmall }, + { Pid::SMALL, 1, c.isSmall, c.resetSmall }, { Pid::NO_STEM, 1, c.stemless, c.resetStemless }, { Pid::STEM_DIRECTION, 1, c.stemDirection, c.resetStemDirection }, diff --git a/mscore/inspector/inspector_accidental.ui b/mscore/inspector/inspector_accidental.ui index f606656fcf7d7..0665f97869a17 100644 --- a/mscore/inspector/inspector_accidental.ui +++ b/mscore/inspector/inspector_accidental.ui @@ -103,7 +103,7 @@ - + Qt::TabFocus @@ -153,7 +153,7 @@ title - small + isSmall bracket diff --git a/mscore/inspector/inspector_chord.ui b/mscore/inspector/inspector_chord.ui index 0f03f77f83d15..a7891ac4d0807 100644 --- a/mscore/inspector/inspector_chord.ui +++ b/mscore/inspector/inspector_chord.ui @@ -152,7 +152,7 @@ - + Qt::TabFocus @@ -275,7 +275,7 @@ title - small + isSmall stemless stemDirection diff --git a/mscore/inspector/inspector_note.ui b/mscore/inspector/inspector_note.ui index 533464670801f..0f491751c06a5 100644 --- a/mscore/inspector/inspector_note.ui +++ b/mscore/inspector/inspector_note.ui @@ -84,10 +84,16 @@ QSizePolicy::MinimumExpanding + + + 0 + 0 + + - + Qt::TabFocus @@ -698,7 +704,7 @@ title - small + isSmall noteHeadScheme noteHeadGroup noteHeadType diff --git a/mscore/inspector/inspector_rest.ui b/mscore/inspector/inspector_rest.ui index de08ba00f6e6d..4a29d23c6910f 100644 --- a/mscore/inspector/inspector_rest.ui +++ b/mscore/inspector/inspector_rest.ui @@ -80,7 +80,7 @@ 3 - + Qt::TabFocus @@ -117,7 +117,7 @@ title - small + isSmall diff --git a/mscore/inspector/inspector_stafftypechange.ui b/mscore/inspector/inspector_stafftypechange.ui index 350a6ebb5adb0..4f92cc3de731c 100644 --- a/mscore/inspector/inspector_stafftypechange.ui +++ b/mscore/inspector/inspector_stafftypechange.ui @@ -161,7 +161,7 @@ - + Small @@ -553,23 +553,23 @@ - - Awl::ColorLabel - QPushButton -
awl/colorlabel.h
- 1 -
Ms::ResetButton QWidget
inspector/resetButton.h
1
+ + Awl::ColorLabel + QPushButton +
awl/colorlabel.h
+ 1 +
title yoffset - small + isSmall scale lines lineDistance diff --git a/mscore/propertymenu.cpp b/mscore/propertymenu.cpp index 204a4fdf09cad..722651569daaf 100644 --- a/mscore/propertymenu.cpp +++ b/mscore/propertymenu.cpp @@ -368,7 +368,7 @@ void ScoreView::elementPropertyAction(const QString& cmd, Element* e) editTimeSigProperties(toTimeSig(e)); } else if (cmd == "smallNote") - e->undoChangeProperty(Pid::SMALL, !toNote(e)->small()); + e->undoChangeProperty(Pid::SMALL, !toNote(e)->isSmall()); else if (cmd == "clef-courtesy") { Clef* clef = toClef(e); bool show = !clef->showCourtesy(); diff --git a/mtest/libmscore/note/tst_note.cpp b/mtest/libmscore/note/tst_note.cpp index ba09887798e77..a3f4ee118de7d 100644 --- a/mtest/libmscore/note/tst_note.cpp +++ b/mtest/libmscore/note/tst_note.cpp @@ -93,7 +93,7 @@ void TestNote::note() // small note->setSmall(true); n = static_cast(writeReadElement(note)); - QVERIFY(n->small()); + QVERIFY(n->isSmall()); delete n; // mirror @@ -209,12 +209,12 @@ void TestNote::note() // small note->setProperty(Pid::SMALL, false); n = static_cast(writeReadElement(note)); - QVERIFY(!n->small()); + QVERIFY(!n->isSmall()); delete n; note->setProperty(Pid::SMALL, true); n = static_cast(writeReadElement(note)); - QVERIFY(n->small()); + QVERIFY(n->isSmall()); delete n; // mirror