Skip to content

Commit

Permalink
replace playGlissando and playArticulation by existing play property
Browse files Browse the repository at this point in the history
  • Loading branch information
lasconic committed Jun 23, 2015
1 parent a2de43c commit f6959ac
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 21 deletions.
10 changes: 5 additions & 5 deletions libmscore/articulation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ void Articulation::read(XmlReader& e)
setProperty(P_ID::DIRECTION, Ms::getProperty(P_ID::DIRECTION, e));
else if ( tag == "ornamentStyle")
setProperty(P_ID::ORNAMENT_STYLE, Ms::getProperty(P_ID::ORNAMENT_STYLE, e));
else if ( tag == "playArticulation")
else if ( tag == "play")
setPlayArticulation(e.readBool());
else if (tag == "timeStretch")
_timeStretch = e.readDouble();
Expand Down Expand Up @@ -303,7 +303,7 @@ void Articulation::write(Xml& xml) const
xml.tag("subtype", subtypeName());
if (_timeStretch != 1.0)
xml.tag("timeStretch", _timeStretch);
writeProperty(xml, P_ID::PLAY_ARTICULATION);
writeProperty(xml, P_ID::PLAY);
writeProperty(xml, P_ID::ORNAMENT_STYLE);
Element::writeProperties(xml);
if (anchorStyle == PropertyStyle::UNSTYLED)
Expand Down Expand Up @@ -559,7 +559,7 @@ QVariant Articulation::getProperty(P_ID propertyId) const
case P_ID::ARTICULATION_ANCHOR: return int(anchor());
case P_ID::TIME_STRETCH: return timeStretch();
case P_ID::ORNAMENT_STYLE: return int(ornamentStyle());
case P_ID::PLAY_ARTICULATION: return bool(playArticulation());
case P_ID::PLAY: return bool(playArticulation());
default:
return Element::getProperty(propertyId);
}
Expand All @@ -580,7 +580,7 @@ bool Articulation::setProperty(P_ID propertyId, const QVariant& v)
anchorStyle = PropertyStyle::UNSTYLED;
setAnchor(ArticulationAnchor(v.toInt()));
break;
case P_ID::PLAY_ARTICULATION:
case P_ID::PLAY:
setPlayArticulation(v.toBool());
break;
case P_ID::ORNAMENT_STYLE:
Expand Down Expand Up @@ -632,7 +632,7 @@ QVariant Articulation::propertyDefault(P_ID propertyId) const
case P_ID::ORNAMENT_STYLE:
//return int(score()->style()->ornamentStyle(_ornamentStyle));
return int(MScore::OrnamentStyle::DEFAULT);
case P_ID::PLAY_ARTICULATION:
case P_ID::PLAY:
return true;
default:
break;
Expand Down
16 changes: 8 additions & 8 deletions libmscore/glissando.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ QVariant GlissandoSegment::getProperty(P_ID id) const
case P_ID::GLISS_TEXT:
case P_ID::GLISS_SHOW_TEXT:
case P_ID::GLISSANDO_STYLE:
case P_ID::PLAY_GLISSANDO:
case P_ID::PLAY:
return glissando()->getProperty(id);
default:
return LineSegment::getProperty(id);
Expand All @@ -141,7 +141,7 @@ bool GlissandoSegment::setProperty(P_ID id, const QVariant& v)
case P_ID::GLISS_TEXT:
case P_ID::GLISS_SHOW_TEXT:
case P_ID::GLISSANDO_STYLE:
case P_ID::PLAY_GLISSANDO:
case P_ID::PLAY:
return glissando()->setProperty(id, v);
default:
return LineSegment::setProperty(id, v);
Expand All @@ -159,7 +159,7 @@ QVariant GlissandoSegment::propertyDefault(P_ID id) const
case P_ID::GLISS_TEXT:
case P_ID::GLISS_SHOW_TEXT:
case P_ID::GLISSANDO_STYLE:
case P_ID::PLAY_GLISSANDO:
case P_ID::PLAY:
return glissando()->propertyDefault(id);
default:
return LineSegment::propertyDefault(id);
Expand Down Expand Up @@ -382,7 +382,7 @@ void Glissando::write(Xml& xml) const
if (_showText && !_text.isEmpty())
xml.tag("text", _text);
xml.tag("subtype", int(_glissandoType));
writeProperty(xml, P_ID::PLAY_GLISSANDO);
writeProperty(xml, P_ID::PLAY);
writeProperty(xml, P_ID::GLISSANDO_STYLE);
SLine::writeProperties(xml);
xml.etag();
Expand All @@ -409,7 +409,7 @@ void Glissando::read(XmlReader& e)
_glissandoType = Type(e.readInt());
else if (tag == "glissandoStyle") {
setProperty(P_ID::GLISSANDO_STYLE, Ms::getProperty(P_ID::GLISSANDO_STYLE, e));
} else if ( tag == "playGlissando") {
} else if ( tag == "play") {
setPlayGlissando(e.readBool());
}
else if (!SLine::readProperties(e))
Expand Down Expand Up @@ -740,7 +740,7 @@ QVariant Glissando::getProperty(P_ID propertyId) const
return showText();
case P_ID::GLISSANDO_STYLE:
return int(glissandoStyle());
case P_ID::PLAY_GLISSANDO:
case P_ID::PLAY:
return bool(playGlissando());
default:
break;
Expand All @@ -767,7 +767,7 @@ bool Glissando::setProperty(P_ID propertyId, const QVariant& v)
case P_ID::GLISSANDO_STYLE:
setGlissandoStyle(MScore::GlissandoStyle(v.toInt()));
break;
case P_ID::PLAY_GLISSANDO:
case P_ID::PLAY:
setPlayGlissando(v.toBool());
break;
default:
Expand All @@ -794,7 +794,7 @@ QVariant Glissando::propertyDefault(P_ID propertyId) const
return true;
case P_ID::GLISSANDO_STYLE:
return int(MScore::GlissandoStyle::CHROMATIC);
case P_ID::PLAY_GLISSANDO:
case P_ID::PLAY:
return true;
default:
break;
Expand Down
4 changes: 1 addition & 3 deletions libmscore/property.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,6 @@ static const PropertyData propertyList[] = {

{ P_ID::TIME_STRETCH, false, 0, P_TYPE::REAL },
{ P_ID::ORNAMENT_STYLE, false, "ornamentStyle", P_TYPE::ORNAMENT_STYLE},
{ P_ID::PLAY_ARTICULATION, false, "playArticulation", P_TYPE::BOOL},

{ P_ID::TIMESIG, false, 0, P_TYPE::FRACTION },
{ P_ID::TIMESIG_GLOBAL, false, 0, P_TYPE::FRACTION },
Expand Down Expand Up @@ -203,8 +202,8 @@ static const PropertyData propertyList[] = {
{ P_ID::NO_OFFSET, false, "noOffset", P_TYPE::INT },
{ P_ID::IRREGULAR, true, "irregular", P_TYPE::BOOL },
{ P_ID::ANCHOR, false, "anchor", P_TYPE::INT },
{ P_ID::SLUR_UOFF1, false, "o1", P_TYPE::POINT },

{ P_ID::SLUR_UOFF1, false, "o1", P_TYPE::POINT },
{ P_ID::SLUR_UOFF2, false, "o2", P_TYPE::POINT },
{ P_ID::SLUR_UOFF3, false, "o3", P_TYPE::POINT },
{ P_ID::SLUR_UOFF4, false, "o4", P_TYPE::POINT },
Expand All @@ -229,7 +228,6 @@ static const PropertyData propertyList[] = {
{ P_ID::TRACK, false, 0, P_TYPE::INT },

{ P_ID::GLISSANDO_STYLE, false, "glissandoStyle", P_TYPE::GLISSANDO_STYLE},
{ P_ID::PLAY_GLISSANDO, false, "playGlissando", P_TYPE::BOOL},
{ P_ID::END, false, "", P_TYPE::INT }
};

Expand Down
2 changes: 0 additions & 2 deletions libmscore/property.h
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,6 @@ enum class P_ID : unsigned char {

TIME_STRETCH,
ORNAMENT_STYLE,
PLAY_ARTICULATION,
TIMESIG,
TIMESIG_GLOBAL,
TIMESIG_STRETCH,
Expand Down Expand Up @@ -223,7 +222,6 @@ enum class P_ID : unsigned char {
TRACK,

GLISSANDO_STYLE,
PLAY_GLISSANDO,
END
};

Expand Down
2 changes: 1 addition & 1 deletion mscore/inspector/inspector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,7 @@ InspectorArticulation::InspectorArticulation(QWidget* parent)
{ P_ID::DIRECTION, 0, 0, ar.direction, ar.resetDirection },
{ P_ID::TIME_STRETCH, 0, 0, ar.timeStretch, ar.resetTimeStretch },
{ P_ID::ORNAMENT_STYLE, 0, 0, ar.ornamentStyle, ar.resetOrnamentStyle },
{ P_ID::PLAY_ARTICULATION, 0, 0, ar.playArticulation, ar.resetPlayArticulation}
{ P_ID::PLAY, 0, 0, ar.playArticulation, ar.resetPlayArticulation}
};
mapSignals();
}
Expand Down
2 changes: 1 addition & 1 deletion mscore/inspector/inspectorGlissando.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ InspectorGlissando::InspectorGlissando(QWidget* parent)
{ P_ID::GLISS_TEXT, 0, false, g.text, g.resetText },
{ P_ID::GLISS_SHOW_TEXT, 0, false, g.showText, g.resetShowText },
{ P_ID::GLISSANDO_STYLE, 0, false, g.glissandoStyle, g.resetGlissandoStyle},
{ P_ID::PLAY_GLISSANDO, 0, 0, g.playGlissando, g.resetPlayGlissando}
{ P_ID::PLAY, 0, 0, g.playGlissando, g.resetPlayGlissando}
};

mapSignals();
Expand Down
2 changes: 1 addition & 1 deletion mtest/libmscore/midi/testGlissando.mscx
Original file line number Diff line number Diff line change
Expand Up @@ -1055,7 +1055,7 @@
<Glissando id="35">
<text>gliss.</text>
<subtype>1</subtype>
<playGlissando>false</playGlissando>
<play>0</play>
<diagonal>1</diagonal>
<lineWidth>0.15</lineWidth>
<anchor>3</anchor>
Expand Down

0 comments on commit f6959ac

Please sign in to comment.