From 8210fb81eefa1b643ac44206cb13c1e9b97df176 Mon Sep 17 00:00:00 2001 From: ws Date: Fri, 8 Mar 2013 12:55:12 +0100 Subject: [PATCH] more inspector cleanups; add measure property Measure Number Mode to allow adding/removing measure numbers on top of style rules --- libmscore/barline.cpp | 24 +++- libmscore/barline.h | 22 ++-- libmscore/measure.cpp | 49 ++++--- libmscore/measure.h | 23 +++- libmscore/property.cpp | 12 +- libmscore/property.h | 8 ++ libmscore/undo.cpp | 2 +- mscore/inspector.cpp | 141 ++++++++++---------- mscore/inspector_barline.ui | 72 ++++------- mscore/measureproperties.cpp | 5 + mscore/measureproperties.ui | 240 ++++++++++++++++++++--------------- mscore/musicxmlsupport.cpp | 6 +- 12 files changed, 340 insertions(+), 264 deletions(-) diff --git a/libmscore/barline.cpp b/libmscore/barline.cpp index 1e3832a63d30..42f8a570f51a 100644 --- a/libmscore/barline.cpp +++ b/libmscore/barline.cpp @@ -311,7 +311,7 @@ void BarLine::write(Xml& xml) const { xml.stag("BarLine"); xml.tag("subtype", barLineTypeName()); - if(customSubtype()) + if (_customSubtype) xml.tag("customSubtype", _customSubtype); // if any span value is different from staff's, output all values if ( (staff() && ( _span != staff()->barLineSpan() @@ -368,11 +368,11 @@ void BarLine::read(XmlReader& e) if (parent() && parent()->type() == SEGMENT) { Measure* m = static_cast(parent())->measure(); if (barLineType() != m->endBarLineType()) - setCustomSubtype(true); + _customSubtype = true; } } else if (tag == "customSubtype") - setCustomSubtype(e.readInt() != 0); + _customSubtype = e.readInt(); else if (tag == "span") { _span = e.readInt(); _spanFrom = e.intAttribute("from", _spanFrom); @@ -530,7 +530,7 @@ void BarLine::startEdit(MuseScoreView*, const QPointF&) void BarLine::endEdit() { - if(ctrlDrag) { // if single bar line edit + if (ctrlDrag) { // if single bar line edit ctrlDrag = false; _customSpan = true; // mark bar line as custom spanning int newSpan = _span; // copy edited span values @@ -920,6 +920,10 @@ QVariant BarLine::getProperty(P_ID id) const return int(_barLineType); case P_BARLINE_SPAN: return span(); + case P_BARLINE_SPAN_FROM: + return spanFrom(); + case P_BARLINE_SPAN_TO: + return spanTo(); default: break; } @@ -935,11 +939,17 @@ bool BarLine::setProperty(P_ID id, const QVariant& v) switch(id) { case P_SUBTYPE: _barLineType = BarLineType(v.toInt()); - setCustomSubtype(parent() && (static_cast(parent())->measure())->endBarLineType() != v.toInt()); + _customSubtype = parent() && (static_cast(parent())->measure())->endBarLineType() != v.toInt(); break; case P_BARLINE_SPAN: setSpan(v.toInt()); break; + case P_BARLINE_SPAN_FROM: + setSpanFrom(v.toInt()); + break; + case P_BARLINE_SPAN_TO: + setSpanTo(v.toInt()); + break; default: return Element::setProperty(id, v); } @@ -958,6 +968,10 @@ QVariant BarLine::propertyDefault(P_ID propertyId) const return false; case P_BARLINE_SPAN: return 1; + case P_BARLINE_SPAN_FROM: + return 0; + case P_BARLINE_SPAN_TO: + return DEFAULT_BARLINE_TO; default: break; } diff --git a/libmscore/barline.h b/libmscore/barline.h index f92e78da7fce..da36256f6753 100644 --- a/libmscore/barline.h +++ b/libmscore/barline.h @@ -79,16 +79,16 @@ class BarLine : public Element { virtual bool acceptDrop(MuseScoreView*, const QPointF&, Element*) const; virtual Element* drop(const DropData&); - void setCustomSpan(bool val) { _customSpan = val; } + void setCustomSpan(bool val) { _customSpan = val; } void setCustomSubtype(bool val) { _customSubtype = val; } - void setSpan(int val) { _span = val; } - void setSpanFrom(int val) { _spanFrom = val; } - void setSpanTo(int val) { _spanTo = val; } - bool customSpan() const { return _customSpan; } - bool customSubtype() const { return _customSubtype;} - int span() const { return _span; } - int spanFrom() const { return _spanFrom; } - int spanTo() const { return _spanTo; } + void setSpan(int val) { _span = val; } + void setSpanFrom(int val) { _spanFrom = val; } + void setSpanTo(int val) { _spanTo = val; } + bool customSpan() const { return _customSpan; } + bool customSubtype() const { return _customSubtype;} + int span() const { return _span; } + int spanFrom() const { return _spanFrom; } + int spanTo() const { return _spanTo; } virtual bool isEditable() const { return parent()->type() == SEGMENT; } virtual void startEdit(MuseScoreView*, const QPointF&); @@ -98,8 +98,8 @@ class BarLine : public Element { virtual void updateGrips(int*, QRectF*) const; int tick() const; - ElementList* el() { return &_el; } - const ElementList* el() const { return &_el; } + ElementList* el() { return &_el; } + const ElementList* el() const { return &_el; } QString barLineTypeName() const; void setBarLineType(const QString& s); diff --git a/libmscore/measure.cpp b/libmscore/measure.cpp index 3abc930a21a3..bf9c0cb3acb4 100644 --- a/libmscore/measure.cpp +++ b/libmscore/measure.cpp @@ -131,6 +131,7 @@ Measure::Measure(Score* s) _spannerBack = 0; _no = 0; _noOffset = 0; + _noMode = MeasureNumberMode::AUTO; _noText = 0; _userStretch = 1.0; // ::style->measureSpacing; _irregular = false; @@ -581,14 +582,20 @@ void Measure::layout2() bool smn = false; if (!_noText || _noText->generated()) { - if (score()->styleB(ST_showMeasureNumber) - && !_irregular - && (_no || score()->styleB(ST_showMeasureNumberOne))) { - if (score()->styleB(ST_measureNumberSystem)) - smn = system()->firstMeasure() == this; - else { - smn = (_no == 0 && score()->styleB(ST_showMeasureNumberOne)) || - ( ((_no+1) % score()->style(ST_measureNumberInterval).toInt()) == 0 ); + if (_noMode == MeasureNumberMode::SHOW) + smn = true; + else if (_noMode == MeasureNumberMode::HIDE) + smn = false; + else { + if (score()->styleB(ST_showMeasureNumber) + && !_irregular + && (_no || score()->styleB(ST_showMeasureNumberOne))) { + if (score()->styleB(ST_measureNumberSystem)) + smn = system()->firstMeasure() == this; + else { + smn = (_no == 0 && score()->styleB(ST_showMeasureNumberOne)) || + ( ((_no+1) % score()->style(ST_measureNumberInterval).toInt()) == 0 ); + } } } if (smn) { @@ -1897,7 +1904,6 @@ void Measure::read(XmlReader& e, int staffIdx) else if (barLine->barLineType() == START_REPEAT) segment = getSegment(Segment::SegStartRepeatBarLine, e.tick()); else { - // setEndBarLineType(barLine->barLineType(), false, barLine->visible(), barLine->color()); setEndBarLineType(barLine->barLineType(), false, true, Qt::black); if(!barLine->customSpan()) { Staff* staff = score()->staff(staffIdx); @@ -2616,7 +2622,7 @@ bool Measure::createEndBarLines() } // if just finished (span==0) a multi-staff span (spanTot>1) ending at the top of a staff (spanTo<=0) // scan this staff again, as it may have its own bar lines (mensurstich(-like) span) - if(spanTot > 1 && spanTo <= 0 && span == 0) + if (spanTot > 1 && spanTo <= 0 && span == 0) staffIdx--; } return changed; @@ -3676,13 +3682,12 @@ QVariant Measure::getProperty(P_ID propertyId) const switch(propertyId) { case P_TIMESIG_NOMINAL: return QVariant::fromValue(_timesig); - break; case P_TIMESIG_ACTUAL: return QVariant::fromValue(_len); - break; case P_REPEAT_FLAGS: return repeatFlags(); - break; + case P_MEASURE_NUMBER_MODE: + return int(measureNumberMode()); default: return MeasureBase::getProperty(propertyId); } @@ -3704,6 +3709,9 @@ bool Measure::setProperty(P_ID propertyId, const QVariant& value) case P_REPEAT_FLAGS: setRepeatFlags(value.toInt()); break; + case P_MEASURE_NUMBER_MODE: + setMeasureNumberMode(MeasureNumberMode(value.toInt())); + break; default: return MeasureBase::setProperty(propertyId, value); } @@ -3714,9 +3722,20 @@ bool Measure::setProperty(P_ID propertyId, const QVariant& value) // propertyDefault //--------------------------------------------------------- -QVariant Measure::propertyDefault(P_ID) const +QVariant Measure::propertyDefault(P_ID propertyId) const { - return QVariant(); + switch(propertyId) { + case P_TIMESIG_NOMINAL: + case P_TIMESIG_ACTUAL: + return QVariant(); + case P_REPEAT_FLAGS: + return 0; + case P_MEASURE_NUMBER_MODE: + return int(MeasureNumberMode::AUTO); + default: + break; + } + return MeasureBase::getProperty(propertyId); } //--------------------------------------------------------- diff --git a/libmscore/measure.h b/libmscore/measure.h index bd2d9e06cc38..23186659594e 100644 --- a/libmscore/measure.h +++ b/libmscore/measure.h @@ -74,6 +74,16 @@ enum { RepeatJump = 8 }; +//--------------------------------------------------------- +// MeasureNumberMode +//--------------------------------------------------------- + +enum class MeasureNumberMode : char { + AUTO, // show measure number depending on style + SHOW, // always show measure number + HIDE // dont show measure number + }; + //--------------------------------------------------------- // @@ Measure /// one measure in a system @@ -97,6 +107,7 @@ class Measure : public MeasureBase { int _no; ///< Measure number, counting from zero int _noOffset; ///< Offset to measure number + MeasureNumberMode _noMode; Text* _noText; ///< Measure number text object qreal _userStretch; @@ -108,9 +119,10 @@ class Measure : public MeasureBase { bool _breakMultiMeasureRest; ///< set by user bool _breakMMRest; ///< set by layout - bool _endBarLineGenerated; - bool _endBarLineVisible; BarLineType _endBarLineType; + bool _endBarLineGenerated; + bool _endBarLineVisible; + QColor _endBarLineColor; BarLineType _mmEndBarLineType; ///< bar line type if this measure is presented ///< as multi measure rest @@ -123,7 +135,6 @@ class Measure : public MeasureBase { int _playbackCount; // temp. value used in RepeatList // counts how many times this measure was already played - QColor _endBarLineColor; void push_back(Segment* e); void push_front(Segment* e); @@ -161,6 +172,10 @@ class Measure : public MeasureBase { void setIrregular(bool val) { _irregular = val; } int noOffset() const { return _noOffset; } Text* noText() const { return _noText; } + + MeasureNumberMode measureNumberMode() const { return _noMode; } + void setMeasureNumberMode(MeasureNumberMode v) { _noMode = v; } + void setNo(int n) { _no = n; } void setNoOffset(int n) { _noOffset = n; } virtual qreal distanceUp(int i) const; @@ -231,8 +246,10 @@ class Measure : public MeasureBase { Segment* findSegment(Segment::SegmentType st, int t); bool createEndBarLines(); + void setEndBarLineType(BarLineType val, bool g, bool visible = true, QColor color = Qt::black); BarLineType endBarLineType() const { return _endBarLineType; } + void setMmEndBarLineType(BarLineType v) { _mmEndBarLineType = v; } bool setStartRepeatBarLine(bool); bool endBarLineGenerated() const { return _endBarLineGenerated; } diff --git a/libmscore/property.cpp b/libmscore/property.cpp index 639f3600b091..6c5f4433bd89 100644 --- a/libmscore/property.cpp +++ b/libmscore/property.cpp @@ -56,9 +56,11 @@ static const PropertyData propertyList[] = { { P_DISTRIBUTE, false, "distribute", T_BOOL }, { P_MIRROR_HEAD, false, "mirror", T_DIRECTION_H }, { P_DOT_POSITION, false, "dotPosition", T_DIRECTION }, - { P_TUNING, false, "tuning", T_REAL }, - { P_PAUSE, false, "pause", T_REAL }, - { P_BARLINE_SPAN, false, "", T_INT }, + { P_TUNING, false, "tuning", T_REAL }, + { P_PAUSE, false, "pause", T_REAL }, + { P_BARLINE_SPAN, false, "", T_INT }, + { P_BARLINE_SPAN_FROM, false, 0, T_INT }, + { P_BARLINE_SPAN_TO, false, 0, T_INT }, { P_USER_OFF, false, 0, T_POINT }, { P_FRET, false, "fret", T_INT }, @@ -138,6 +140,10 @@ static const PropertyData propertyList[] = { { P_ARP_USER_LEN2, false, 0, T_REAL }, { P_REPEAT_FLAGS, false, 0, T_INT }, + { P_END_BARLINE_TYPE, false, 0, T_INT }, + { P_END_BARLINE_VISIBLE, false, 0, T_BOOL }, + { P_END_BARLINE_COLOR, false, 0, T_COLOR }, + { P_MEASURE_NUMBER_MODE, false, 0, T_INT }, { P_GLISS_TYPE, false, 0, T_INT }, { P_GLISS_TEXT, false, 0, T_STRING }, diff --git a/libmscore/property.h b/libmscore/property.h index a959e643bfc6..6087acafae0e 100644 --- a/libmscore/property.h +++ b/libmscore/property.h @@ -52,6 +52,8 @@ enum P_ID { P_TUNING, P_PAUSE, P_BARLINE_SPAN, + P_BARLINE_SPAN_FROM, + P_BARLINE_SPAN_TO, P_USER_OFF, P_FRET, P_STRING, @@ -126,7 +128,13 @@ enum P_ID { P_MARKER_TYPE, P_ARP_USER_LEN1, P_ARP_USER_LEN2, + P_REPEAT_FLAGS, + P_END_BARLINE_TYPE, + P_END_BARLINE_VISIBLE, + P_END_BARLINE_COLOR, + P_MEASURE_NUMBER_MODE, + P_GLISS_TYPE, P_GLISS_TEXT, P_GLISS_SHOW_TEXT, diff --git a/libmscore/undo.cpp b/libmscore/undo.cpp index 86e8aad5d1d5..c95058cb26c1 100644 --- a/libmscore/undo.cpp +++ b/libmscore/undo.cpp @@ -1991,7 +1991,7 @@ void ChangeSingleBarLineSpan::flip() spanTo = nspanTo; barLine->layout(); // update bbox // re-create bar lines for other staves, if span of this bar line decreased - if(barLine->parent() && barLine->parent()->type() == Element::SEGMENT) + if (barLine->parent() && barLine->parent()->type() == Element::SEGMENT) (static_cast(barLine->parent()))->measure()->createEndBarLines(); barLine->score()->addRefresh(barLine->abbox()); // new area of this bar line needs redraw } diff --git a/mscore/inspector.cpp b/mscore/inspector.cpp index cc132abfe67d..3296d3d91cbb 100644 --- a/mscore/inspector.cpp +++ b/mscore/inspector.cpp @@ -230,10 +230,10 @@ InspectorElement::InspectorElement(QWidget* parent) b.setupUi(addWidget()); iList = { - { P_COLOR, 0, false, b.color, b.resetColor }, - { P_VISIBLE, 0, false, b.visible, b.resetVisible }, - { P_USER_OFF, 0, false, b.offsetX, b.resetX }, - { P_USER_OFF, 1, false, b.offsetY, b.resetY } + { P_COLOR, 0, 0, b.color, b.resetColor }, + { P_VISIBLE, 0, 0, b.visible, b.resetVisible }, + { P_USER_OFF, 0, 0, b.offsetX, b.resetX }, + { P_USER_OFF, 1, 0, b.offsetY, b.resetY } }; mapSignals(); @@ -249,13 +249,13 @@ InspectorVBox::InspectorVBox(QWidget* parent) vb.setupUi(addWidget()); iList = { - { P_TOP_GAP, 0, false, vb.topGap, vb.resetTopGap }, - { P_BOTTOM_GAP, 0, false, vb.bottomGap, vb.resetBottomGap }, - { P_LEFT_MARGIN, 0, false, vb.leftMargin, vb.resetLeftMargin }, - { P_RIGHT_MARGIN, 0, false, vb.rightMargin, vb.resetRightMargin }, - { P_TOP_MARGIN, 0, false, vb.topMargin, vb.resetTopMargin }, - { P_BOTTOM_MARGIN, 0, false, vb.bottomMargin, vb.resetBottomMargin }, - { P_BOX_HEIGHT, 0, false, vb.height, 0 } + { P_TOP_GAP, 0, 0, vb.topGap, vb.resetTopGap }, + { P_BOTTOM_GAP, 0, 0, vb.bottomGap, vb.resetBottomGap }, + { P_LEFT_MARGIN, 0, 0, vb.leftMargin, vb.resetLeftMargin }, + { P_RIGHT_MARGIN, 0, 0, vb.rightMargin, vb.resetRightMargin }, + { P_TOP_MARGIN, 0, 0, vb.topMargin, vb.resetTopMargin }, + { P_BOTTOM_MARGIN, 0, 0, vb.bottomMargin, vb.resetBottomMargin }, + { P_BOX_HEIGHT, 0, 0, vb.height, 0 } }; mapSignals(); } @@ -270,9 +270,9 @@ InspectorHBox::InspectorHBox(QWidget* parent) hb.setupUi(addWidget()); iList = { - { P_TOP_GAP, 0, false, hb.leftGap, hb.resetLeftGap }, - { P_BOTTOM_GAP, 0, false, hb.rightGap, hb.resetRightGap }, - { P_BOX_WIDTH, 0, false, hb.width, 0 } + { P_TOP_GAP, 0, 0, hb.leftGap, hb.resetLeftGap }, + { P_BOTTOM_GAP, 0, 0, hb.rightGap, hb.resetRightGap }, + { P_BOX_WIDTH, 0, 0, hb.width, 0 } }; mapSignals(); @@ -289,12 +289,12 @@ InspectorArticulation::InspectorArticulation(QWidget* parent) ar.setupUi(addWidget()); iList = { - { P_COLOR, 0, false, e.color, e.resetColor }, - { P_VISIBLE, 0, false, e.visible, e.resetVisible }, - { P_USER_OFF, 0, false, e.offsetX, e.resetX }, - { P_USER_OFF, 1, false, e.offsetY, e.resetY }, - { P_ARTICULATION_ANCHOR, 0, false, ar.anchor, ar.resetAnchor }, - { P_DIRECTION, 0, false, ar.direction, ar.resetDirection } + { P_COLOR, 0, 0, e.color, e.resetColor }, + { P_VISIBLE, 0, 0, e.visible, e.resetVisible }, + { P_USER_OFF, 0, 0, e.offsetX, e.resetX }, + { P_USER_OFF, 1, 0, e.offsetY, e.resetY }, + { P_ARTICULATION_ANCHOR, 0, 0, ar.anchor, ar.resetAnchor }, + { P_DIRECTION, 0, 0, ar.direction, ar.resetDirection } }; mapSignals(); } @@ -326,13 +326,13 @@ InspectorRest::InspectorRest(QWidget* parent) r.setupUi(addWidget()); iList = { - { P_COLOR, 0, false, e.color, e.resetColor }, - { P_VISIBLE, 0, false, e.visible, e.resetVisible }, - { P_USER_OFF, 0, false, e.offsetX, e.resetX }, - { P_USER_OFF, 1, false, e.offsetY, e.resetY }, - { P_SMALL, 0, false, r.small, r.resetSmall }, - { P_LEADING_SPACE, 0, true, s.leadingSpace, s.resetLeadingSpace }, - { P_TRAILING_SPACE, 0, true, s.trailingSpace, s.resetTrailingSpace } + { P_COLOR, 0, 0, e.color, e.resetColor }, + { P_VISIBLE, 0, 0, e.visible, e.resetVisible }, + { P_USER_OFF, 0, 0, e.offsetX, e.resetX }, + { P_USER_OFF, 1, 0, e.offsetY, e.resetY }, + { P_SMALL, 0, 0, r.small, r.resetSmall }, + { P_LEADING_SPACE, 0, 1, s.leadingSpace, s.resetLeadingSpace }, + { P_TRAILING_SPACE, 0, 1, s.trailingSpace, s.resetTrailingSpace } }; mapSignals(); } @@ -349,13 +349,13 @@ InspectorTimeSig::InspectorTimeSig(QWidget* parent) t.setupUi(addWidget()); iList = { - { P_COLOR, 0, false, e.color, e.resetColor }, - { P_VISIBLE, 0, false, e.visible, e.resetVisible }, - { P_USER_OFF, 0, false, e.offsetX, e.resetX }, - { P_USER_OFF, 1, false, e.offsetY, e.resetY }, - { P_LEADING_SPACE, 0, true, s.leadingSpace, s.resetLeadingSpace }, - { P_TRAILING_SPACE, 0, true, s.trailingSpace, s.resetTrailingSpace }, - { P_SHOW_COURTESY, 0, false, t.showCourtesy, t.resetShowCourtesy } + { P_COLOR, 0, 0, e.color, e.resetColor }, + { P_VISIBLE, 0, 0, e.visible, e.resetVisible }, + { P_USER_OFF, 0, 0, e.offsetX, e.resetX }, + { P_USER_OFF, 1, 0, e.offsetY, e.resetY }, + { P_LEADING_SPACE, 0, 1, s.leadingSpace, s.resetLeadingSpace }, + { P_TRAILING_SPACE, 0, 1, s.trailingSpace, s.resetTrailingSpace }, + { P_SHOW_COURTESY, 0, 0, t.showCourtesy, t.resetShowCourtesy } }; mapSignals(); } @@ -372,14 +372,14 @@ InspectorKeySig::InspectorKeySig(QWidget* parent) k.setupUi(addWidget()); iList = { - { P_COLOR, 0, false, e.color, e.resetColor }, - { P_VISIBLE, 0, false, e.visible, e.resetVisible }, - { P_USER_OFF, 0, false, e.offsetX, e.resetX }, - { P_USER_OFF, 1, false, e.offsetY, e.resetY }, - { P_LEADING_SPACE, 0, true, s.leadingSpace, s.resetLeadingSpace }, - { P_TRAILING_SPACE, 0, true, s.trailingSpace, s.resetTrailingSpace }, - { P_SHOW_COURTESY, 0, false, k.showCourtesy, k.resetShowCourtesy }, - { P_SHOW_NATURALS, 0, false, k.showNaturals, k.resetShowNaturals } + { P_COLOR, 0, 0, e.color, e.resetColor }, + { P_VISIBLE, 0, 0, e.visible, e.resetVisible }, + { P_USER_OFF, 0, 0, e.offsetX, e.resetX }, + { P_USER_OFF, 1, 0, e.offsetY, e.resetY }, + { P_LEADING_SPACE, 0, 1, s.leadingSpace, s.resetLeadingSpace }, + { P_TRAILING_SPACE, 0, 1, s.trailingSpace, s.resetTrailingSpace }, + { P_SHOW_COURTESY, 0, 0, k.showCourtesy, k.resetShowCourtesy }, + { P_SHOW_NATURALS, 0, 0, k.showNaturals, k.resetShowNaturals } }; mapSignals(); } @@ -396,13 +396,13 @@ InspectorClef::InspectorClef(QWidget* parent) c.setupUi(addWidget()); iList = { - { P_COLOR, 0, false, e.color, e.resetColor }, - { P_VISIBLE, 0, false, e.visible, e.resetVisible }, - { P_USER_OFF, 0, false, e.offsetX, e.resetX }, - { P_USER_OFF, 1, false, e.offsetY, e.resetY }, - { P_LEADING_SPACE, 0, true, s.leadingSpace, s.resetLeadingSpace }, - { P_TRAILING_SPACE, 0, true, s.trailingSpace, s.resetTrailingSpace }, - { P_SHOW_COURTESY, 0, false, c.showCourtesy, c.resetShowCourtesy } + { P_COLOR, 0, 0, e.color, e.resetColor }, + { P_VISIBLE, 0, 0, e.visible, e.resetVisible }, + { P_USER_OFF, 0, 0, e.offsetX, e.resetX }, + { P_USER_OFF, 1, 0, e.offsetY, e.resetY }, + { P_LEADING_SPACE, 0, 1, s.leadingSpace, s.resetLeadingSpace }, + { P_TRAILING_SPACE, 0, 1, s.trailingSpace, s.resetTrailingSpace }, + { P_SHOW_COURTESY, 0, 0, c.showCourtesy, c.resetShowCourtesy } }; mapSignals(); } @@ -411,6 +411,24 @@ InspectorClef::InspectorClef(QWidget* parent) // InspectorBarLine //--------------------------------------------------------- +InspectorBarLine::InspectorBarLine(QWidget* parent) + : InspectorBase(parent) + { + e.setupUi(addWidget()); + b.setupUi(addWidget()); + + iList = { + { P_COLOR, 0, 0, e.color, e.resetColor }, + { P_VISIBLE, 0, 0, e.visible, e.resetVisible }, + { P_USER_OFF, 0, 0, e.offsetX, e.resetX }, + { P_USER_OFF, 1, 0, e.offsetY, e.resetY }, + { P_SUBTYPE, 0, 0, b.type, b.resetType } + }; + mapSignals(); + } + +#if 0 + #define BARLINE_TYPE_DEFAULT -1 QString InspectorBarLine::builtinSpanNames[BARLINE_BUILTIN_SPANS] = @@ -426,25 +444,6 @@ int InspectorBarLine::builtinSpans[BARLINE_BUILTIN_SPANS][3] = { 1, 2, 0}, // short 1 (To depends on staff num. of lines) { 1, 1, 0} // short 2 (To depends on staff num. of lines) }; - -InspectorBarLine::InspectorBarLine(QWidget* parent) - : InspectorBase(parent) - { - e.setupUi(addWidget()); - b.setupUi(addWidget()); - - iList = { - { P_COLOR, 0, 0, e.color, e.resetColor }, - { P_VISIBLE, 0, 0, e.visible, e.resetVisible }, - { P_USER_OFF, 0, 0, e.offsetX, e.resetX }, - { P_USER_OFF, 1, 0, e.offsetY, e.resetY }, - { P_SUBTYPE, 0, 0, b.type, b.resetType }, - { P_BARLINE_SPAN, 0, 0, b.span, b.resetSpan }, - }; - mapSignals(); - } - -#if 0 //--------------------------------------------------------- // setElement //--------------------------------------------------------- @@ -522,18 +521,18 @@ void InspectorBarLine::apply() // type int currType = type->itemData(type->currentIndex()).toInt(); - if(currType == BARLINE_TYPE_DEFAULT) + if (currType == BARLINE_TYPE_DEFAULT) currType = measureBarLineType; if (currType != bl->barLineType()) score->undoChangeProperty(bl, P_SUBTYPE, currType); // if value reverted to measure default, update combo box - if(!bl->customSubtype()) + if (!bl->customSubtype()) type->setCurrentIndex(0); // span: determine span, spanFrom and spanTo values for current combo box item int currSpan = span->currentIndex(); int spanStaves, spanFrom, spanTo; - if(currSpan == 0) { // staff default selected + if (currSpan == 0) { // staff default selected if(bl->staff()) { // if there is a staff Staff* st = bl->staff(); // use its span values as selected values spanStaves = st->barLineSpan(); diff --git a/mscore/inspector_barline.ui b/mscore/inspector_barline.ui index fb7d62037d75..75247fa26e2b 100644 --- a/mscore/inspector_barline.ui +++ b/mscore/inspector_barline.ui @@ -7,7 +7,7 @@ 0 0 274 - 97 + 120 @@ -54,45 +54,26 @@ 0 - - - - - Staff default - - - - - Tick - - - - - Tick alt. - - + + - Short + Normal - Short alt. + Double - - - - - Measure default + Start Repeat - Normal + End Repeat @@ -102,44 +83,29 @@ - Dotted + End - Double + End-Start Repeat - End + Dotted - - - - Span: - - - - - - - reset value - - - ... - - - - :/data/icons-dark/resetproperty.png:/data/icons-dark/resetproperty.png - - - + + + 0 + 0 + + Type: @@ -157,6 +123,12 @@ :/data/icons-dark/resetproperty.png:/data/icons-dark/resetproperty.png + + + 14 + 14 + + diff --git a/mscore/measureproperties.cpp b/mscore/measureproperties.cpp index 3b4d2cef8de1..dc7c5665530a 100644 --- a/mscore/measureproperties.cpp +++ b/mscore/measureproperties.cpp @@ -83,6 +83,7 @@ void MeasureProperties::setMeasure(Measure* _m) count->setValue(n); count->setEnabled(m->repeatFlags() & RepeatEnd); layoutStretch->setValue(m->userStretch()); + measureNumberMode->setCurrentIndex(int(m->measureNumberMode())); measureNumberOffset->setValue(m->noOffset()); Score* score = m->score(); @@ -197,12 +198,14 @@ void MeasureProperties::apply() if (ms->visible() != v || ms->slashStyle() != s) score->undo(new ChangeMStaffProperties(ms, v, s)); } + int mode = measureNumberMode->currentIndex(); if (isIrregular() != m->irregular() || breakMultiMeasureRest->isChecked() != m->breakMultiMeasureRest() || repeatCount() != m->repeatCount() || layoutStretch->value() != m->userStretch() || measureNumberOffset->value() != m->noOffset() || m->len() != len() + || int(m->measureNumberMode()) != mode ) { score->undo(new ChangeMeasureProperties( m, @@ -212,6 +215,8 @@ void MeasureProperties::apply() measureNumberOffset->value(), isIrregular()) ); + if (int(m->measureNumberMode()) != mode) + score->undoChangeProperty(m, P_MEASURE_NUMBER_MODE, mode); if (m->len() != len()) { m->adjustToLen(len()); score->select(m, SELECT_RANGE, 0); diff --git a/mscore/measureproperties.ui b/mscore/measureproperties.ui index 44bf92377cf8..541dd506f365 100644 --- a/mscore/measureproperties.ui +++ b/mscore/measureproperties.ui @@ -10,7 +10,7 @@ 0 0 637 - 439 + 410 @@ -297,7 +297,10 @@ false - + + -1 + + do not count @@ -307,109 +310,151 @@ - + break multi measure rest - - - - QLayout::SetDefaultConstraint + + + + + 0 + 0 + - - QFormLayout::FieldsStayAtSizeHint + + Repeat Count: - - - - - 0 - 0 - - - - add to measure number - - - - - - - - 0 - 0 - - - - -9999 - - - 9999 - - - - - - - - 0 - 0 - - - - layout stretch - - - - - - - - 0 - 0 - - - - 0.900000000000000 - - - 0.200000000000000 - - + + + + + + + 0 + 0 + + + + 1 + + + 9999 + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 0 + 0 + + + + Layout Stretch: + + + + + + + + 0 + 0 + + + + 0.900000000000000 + + + 0.200000000000000 + + + + + + + + 0 + 0 + + + + Add to Measure Number + + + + + + + + 0 + 0 + + + + -9999 + + + 9999 + + + + + + + Measure Number Mode: + + + + + + + + AUTO + - - - - - 0 - 0 - - - - repeat count: - - + + + always show + - - - - - 0 - 0 - - - - 1 - - - 9999 - - + + + always hide + - + + + + + + Qt::Horizontal + + + + 40 + 20 + + + @@ -460,13 +505,6 @@ - - - Awl::DenominatorSpinBox - QSpinBox -
awl/denomspinbox.h
-
-
diff --git a/mscore/musicxmlsupport.cpp b/mscore/musicxmlsupport.cpp index 8f7dae89c156..1d6061b07c0b 100644 --- a/mscore/musicxmlsupport.cpp +++ b/mscore/musicxmlsupport.cpp @@ -151,10 +151,8 @@ void ValidatorMessageHandler::handleMessage(QtMsgType type, const QString& descr int contentColumn; if (!desc.setContent(description, false, &contentError, &contentLine, &contentColumn)) { - qDebug(qPrintable(QString("ValidatorMessageHandler: could not parse validation error line %1 column %2: %3") - .arg(contentLine) - .arg(contentColumn) - .arg(contentError))); + qDebug("ValidatorMessageHandler: could not parse validation error line %d column %d: %s", + contentLine, contentColumn, qPrintable(contentError)); return; } QDomElement e = desc.documentElement();