rename enum Dynamic::DynamicType to Dynamic::Type

This commit is contained in:
Joachim Schmitz 2014-06-24 16:03:04 +02:00
parent f3caba78f6
commit fe4fa356d1
4 changed files with 36 additions and 36 deletions

View file

@ -128,7 +128,7 @@ Dynamic::Dynamic(Score* s)
_velocity = -1;
_dynRange = DynamicRange::PART;
setTextStyleType(TextStyleType::DYNAMICS);
_dynamicType = DynamicType::OTHER;
_dynamicType = Type::OTHER;
}
Dynamic::Dynamic(const Dynamic& d)
@ -167,7 +167,7 @@ void Dynamic::write(Xml& xml) const
xml.tag("subtype", dynamicTypeName());
writeProperty(xml, P_ID::VELOCITY);
writeProperty(xml, P_ID::DYNAMIC_RANGE);
Text::writeProperties(xml, dynamicType() == DynamicType::OTHER);
Text::writeProperties(xml, dynamicType() == Type::OTHER);
xml.etag();
}
@ -241,13 +241,13 @@ void Dynamic::setDynamicType(const QString& tag)
int n = sizeof(dynList)/sizeof(*dynList);
for (int i = 0; i < n; ++i) {
if (dynList[i].tag == tag || dynList[i].text == tag) {
setDynamicType(DynamicType(i));
setDynamicType(Type(i));
setText(QString::fromUtf8(dynList[i].text));
return;
}
}
qDebug("setDynamicType: other <%s>", qPrintable(tag));
setDynamicType(DynamicType::OTHER);
setDynamicType(Type::OTHER);
setText(tag);
}
@ -277,7 +277,7 @@ void Dynamic::endEdit()
{
Text::endEdit();
if (text() != QString::fromUtf8(dynList[int(_dynamicType)].text))
_dynamicType = DynamicType::OTHER;
_dynamicType = Type::OTHER;
}
//---------------------------------------------------------
@ -372,7 +372,7 @@ bool Dynamic::setProperty(P_ID propertyId, const QVariant& v)
_velocity = v.toInt();
break;
case P_ID::SUBTYPE:
_dynamicType = DynamicType(v.toInt());
_dynamicType = Type(v.toInt());
break;
default:
if (!Text::setProperty(propertyId, v))

View file

@ -33,7 +33,7 @@ class Dynamic : public Text {
Q_PROPERTY(DynamicRange range READ dynRange WRITE undoSetDynRange)
public:
enum class DynamicType : char {
enum class Type : char {
OTHER,
PPPPPP,
PPPPP,
@ -66,7 +66,7 @@ class Dynamic : public Text {
};
private:
DynamicType _dynamicType;
Type _dynamicType;
mutable QPointF dragOffset;
int _velocity; // associated midi velocity 0-127
@ -82,10 +82,10 @@ class Dynamic : public Text {
Segment* segment() const { return (Segment*)parent(); }
Measure* measure() const { return (Measure*)parent()->parent(); }
void setDynamicType(DynamicType val) { _dynamicType = val; }
void setDynamicType(Type val) { _dynamicType = val; }
void setDynamicType(const QString&);
QString dynamicTypeName() const;
DynamicType dynamicType() const { return _dynamicType; }
Type dynamicType() const { return _dynamicType; }
virtual void layout() override;
virtual void write(Xml& xml) const override;

View file

@ -3140,38 +3140,38 @@ void ExportMusicXml::textLine(TextLine const* const tl, int staff, int tick)
void ExportMusicXml::dynamic(Dynamic const* const dyn, int staff)
{
QString t = dyn->text();
Dynamic::DynamicType st = dyn->dynamicType();
Dynamic::Type st = dyn->dynamicType();
directionTag(xml, attr, dyn);
xml.stag("direction-type");
if (st == Dynamic::DynamicType::P
|| st == Dynamic::DynamicType::PP
|| st == Dynamic::DynamicType::PPP
|| st == Dynamic::DynamicType::PPPP
|| st == Dynamic::DynamicType::PPPPP
|| st == Dynamic::DynamicType::PPPPPP
|| st == Dynamic::DynamicType::F
|| st == Dynamic::DynamicType::FF
|| st == Dynamic::DynamicType::FFF
|| st == Dynamic::DynamicType::FFFF
|| st == Dynamic::DynamicType::FFFFF
|| st == Dynamic::DynamicType::FFFFFF
|| st == Dynamic::DynamicType::MP
|| st == Dynamic::DynamicType::MF
|| st == Dynamic::DynamicType::SF
|| st == Dynamic::DynamicType::SFP
|| st == Dynamic::DynamicType::SFPP
|| st == Dynamic::DynamicType::FP
|| st == Dynamic::DynamicType::RF
|| st == Dynamic::DynamicType::RFZ
|| st == Dynamic::DynamicType::SFZ
|| st == Dynamic::DynamicType::SFFZ
|| st == Dynamic::DynamicType::FZ) {
if (st == Dynamic::Type::P
|| st == Dynamic::Type::PP
|| st == Dynamic::Type::PPP
|| st == Dynamic::Type::PPPP
|| st == Dynamic::Type::PPPPP
|| st == Dynamic::Type::PPPPPP
|| st == Dynamic::Type::F
|| st == Dynamic::Type::FF
|| st == Dynamic::Type::FFF
|| st == Dynamic::Type::FFFF
|| st == Dynamic::Type::FFFFF
|| st == Dynamic::Type::FFFFFF
|| st == Dynamic::Type::MP
|| st == Dynamic::Type::MF
|| st == Dynamic::Type::SF
|| st == Dynamic::Type::SFP
|| st == Dynamic::Type::SFPP
|| st == Dynamic::Type::FP
|| st == Dynamic::Type::RF
|| st == Dynamic::Type::RFZ
|| st == Dynamic::Type::SFZ
|| st == Dynamic::Type::SFFZ
|| st == Dynamic::Type::FZ) {
xml.stag("dynamics");
xml.tagE(dyn->dynamicTypeName());
xml.etag();
}
else if (st == Dynamic::DynamicType::M || st == Dynamic::DynamicType::Z) {
else if (st == Dynamic::Type::M || st == Dynamic::Type::Z) {
xml.stag("dynamics");
xml.tag("other-dynamics", dyn->dynamicTypeName());
xml.etag();

View file

@ -49,7 +49,7 @@ void TestDynamic::initTestCase()
void TestDynamic::test1()
{
Dynamic* dynamic = new Dynamic(score);
dynamic->setDynamicType(Dynamic::DynamicType(1));
dynamic->setDynamicType(Dynamic::Type(1));
dynamic->setPlacement(Placement::ABOVE);
Dynamic* d = static_cast<Dynamic*>(writeReadElement(dynamic));