move Direction and DirectionH into MScore

needed to make them available to the plugin framework
This commit is contained in:
Joachim Schmitz 2014-06-26 10:53:57 +02:00
parent 6712629c34
commit e95d169d5c
45 changed files with 371 additions and 368 deletions

View file

@ -24,9 +24,9 @@
namespace Ms {
static const NoteHead::Group NOTEHEADGROUP_DEFAULT = NoteHead::Group::HEAD_NORMAL;
static const NoteHead::Type NOTEHEADTYPE_DEFAULT = NoteHead::Type::HEAD_AUTO;
static const DirectionH DIR_DEFAULT = DirectionH::DH_AUTO;
static const NoteHead::Group NOTEHEADGROUP_DEFAULT = NoteHead::Group::HEAD_NORMAL;
static const NoteHead::Type NOTEHEADTYPE_DEFAULT = NoteHead::Type::HEAD_AUTO;
static const MScore::DirectionH DIR_DEFAULT = MScore::DirectionH::AUTO;
static const bool HASLINE_DEFAULT = true;
static const qreal LINEWIDTH_DEFAULT = 0.12;
#if 0 // yet(?) unused
@ -342,7 +342,7 @@ void Ambitus::layout()
bool collision =
(_topAccid.ipos().y() + _topAccid.bbox().y() + _topAccid.height()
> _bottomAccid.ipos().y() + _bottomAccid.bbox().y() )
&& _dir != DirectionH::DH_RIGHT;
&& _dir != MScore::DirectionH::RIGHT;
if (collision) {
// displace bottom accidental (also attempting to 'undercut' flats)
xAccidOffBottom = xAccidOffTop +
@ -353,14 +353,14 @@ void Ambitus::layout()
}
switch (_dir) {
case DirectionH::DH_AUTO: // note heads one above the other
case MScore::DirectionH::AUTO: // note heads one above the other
// left align note heads and right align accidentals 'hanging' on the left
_topPos.setX(0.0);
_bottomPos.setX(0.0);
_topAccid.rxpos() = - xAccidOffTop;
_bottomAccid.rxpos() = - xAccidOffBottom;
break;
case DirectionH::DH_LEFT: // top note head at the left of bottom note head
case MScore::DirectionH::LEFT: // top note head at the left of bottom note head
// place top note head at left margin; bottom note head at right of top head;
// top accid. 'hanging' on left of top head and bottom accid. 'hanging' at left of bottom head
_topPos.setX(0.0);
@ -368,7 +368,7 @@ void Ambitus::layout()
_topAccid.rxpos() = - xAccidOffTop;
_bottomAccid.rxpos() = collision ? - xAccidOffBottom : headWdt - xAccidOffBottom;
break;
case DirectionH::DH_RIGHT: // top note head at the right of bottom note head
case MScore::DirectionH::RIGHT: // top note head at the right of bottom note head
// bottom note head at left margin; top note head at right of bottomnote head
// top accid. 'hanging' on left of top head and bottom accid. 'hanging' at left of bottom head
_bottomPos.setX(0.0);
@ -642,7 +642,7 @@ bool Ambitus::setProperty(P_ID propertyId, const QVariant& v)
setNoteHeadType( NoteHead::Type(v.toInt()) );
break;
case P_ID::MIRROR_HEAD:
setDirection(DirectionH(v.toInt()) );
setDirection(MScore::DirectionH(v.toInt()) );
break;
case P_ID::GHOST: // recycled property = _hasLine
setHasLine(v.toBool());

View file

@ -30,7 +30,7 @@ class Ambitus : public Element {
NoteHead::Group _noteHeadGroup;
NoteHead::Type _noteHeadType;
DirectionH _dir;
MScore::DirectionH _dir;
bool _hasLine;
qreal _lineWidth; // in spatium
Accidental _topAccid, _bottomAccid;
@ -53,7 +53,7 @@ class Ambitus : public Element {
virtual Element::Type type() const { return Element::Type::AMBITUS; }
NoteHead::Group noteHeadGroup() const { return _noteHeadGroup;}
NoteHead::Type noteHeadType() const { return _noteHeadType; }
DirectionH direction() const { return _dir; }
MScore::DirectionH direction() const { return _dir; }
bool hasLine() const { return _hasLine; }
qreal lineWidth() const { return _lineWidth; }
int topOctave() const { return _topPitch / 12;}
@ -65,7 +65,7 @@ class Ambitus : public Element {
void setNoteHeadGroup(NoteHead::Group val) { _noteHeadGroup = val; }
void setNoteHeadType (NoteHead::Type val) { _noteHeadType = val; }
void setDirection (DirectionH val) { _dir = val; }
void setDirection (MScore::DirectionH val) { _dir = val; }
void setHasLine (bool val) { _hasLine = val; }
void setLineWidth (qreal val) { _lineWidth = val; }
void setTopPitch (int val);

View file

@ -183,7 +183,7 @@ ArticulationInfo Articulation::articulationList[int(ArticulationType::ARTICULATI
Articulation::Articulation(Score* s)
: Element(s)
{
_direction = Direction::AUTO;
_direction = MScore::Direction::AUTO;
_up = true;
setFlags(ElementFlag::MOVABLE | ElementFlag::SELECTABLE);
setArticulationType(ArticulationType::Fermata);
@ -313,7 +313,7 @@ void Articulation::setSubtype(const QString& s)
for (i = 0; i < n; ++i) {
if (s == al[i].name) {
_up = al[i].up;
_direction = (_up ? Direction::UP : Direction::DOWN);
_direction = (_up ? MScore::Direction::UP : MScore::Direction::DOWN);
st = int(al[i].type);
break;
}
@ -416,11 +416,11 @@ void Articulation::layout()
// setDirection
//---------------------------------------------------------
void Articulation::setDirection(Direction d)
void Articulation::setDirection(MScore::Direction d)
{
_direction = d;
if (d != Direction::AUTO)
_up = (d == Direction::UP);
if (d != MScore::Direction::AUTO)
_up = (d == MScore::Direction::UP);
}
//---------------------------------------------------------
@ -429,8 +429,8 @@ void Articulation::setDirection(Direction d)
void Articulation::reset()
{
if (_direction != Direction::AUTO)
score()->undoChangeProperty(this, P_ID::DIRECTION, int(Direction::AUTO));
if (_direction != MScore::Direction::AUTO)
score()->undoChangeProperty(this, P_ID::DIRECTION, int(MScore::Direction::AUTO));
ArticulationAnchor a = score()->style()->articulationAnchor(int(articulationType()));
if (_anchor != a)
score()->undoChangeProperty(this, P_ID::ARTICULATION_ANCHOR, int(a));
@ -473,7 +473,7 @@ bool Articulation::setProperty(P_ID propertyId, const QVariant& v)
score()->addRefresh(canvasBoundingRect());
switch (propertyId) {
case P_ID::DIRECTION:
setDirection(Direction(v.toInt()));
setDirection(MScore::Direction(v.toInt()));
break;
case P_ID::ARTICULATION_ANCHOR:
anchorStyle = PropertyStyle::UNSTYLED;
@ -507,7 +507,7 @@ QVariant Articulation::propertyDefault(P_ID propertyId) const
{
switch(propertyId) {
case P_ID::DIRECTION:
return int(Direction::AUTO);
return int(MScore::Direction::AUTO);
case P_ID::ARTICULATION_ANCHOR:
return int(score()->style()->articulationAnchor(int(_articulationType)));

View file

@ -64,7 +64,7 @@ class Articulation : public Element {
Q_OBJECT
ArticulationType _articulationType;
Direction _direction;
MScore::Direction _direction;
QString _channelName;
ArticulationAnchor _anchor;
@ -111,8 +111,8 @@ class Articulation : public Element {
bool up() const { return _up; }
void setUp(bool val) { _up = val; }
void setDirection(Direction d);
Direction direction() const { return _direction; }
void setDirection(MScore::Direction d);
MScore::Direction direction() const { return _direction; }
ChordRest* chordRest() const;

View file

@ -913,11 +913,11 @@ void BarLine::layout()
foreach(Element* e, _el) {
e->layout();
if (e->type() == Element::Type::ARTICULATION) {
Articulation* a = static_cast<Articulation*>(e);
Direction dir = a->direction();
qreal distance = 0.5 * spatium();
qreal x = width() * .5;
if (dir == Direction::DOWN) {
Articulation* a = static_cast<Articulation*>(e);
MScore::Direction dir = a->direction();
qreal distance = 0.5 * spatium();
qreal x = width() * .5;
if (dir == MScore::Direction::DOWN) {
qreal botY = y2 + distance;
a->setPos(QPointF(x, botY));
}

View file

@ -37,8 +37,8 @@ namespace Ms {
//---------------------------------------------------------
// BeamFragment
// position of primary beam
// idx 0 - MScore::AUTO or Direction::DOWN
// 1 - Direction::UP
// idx 0 - MScore::Direction::AUTO or MScore::Direction::DOWN
// 1 - MScore::Direction::UP
//---------------------------------------------------------
struct BeamFragment {
@ -54,7 +54,7 @@ Beam::Beam(Score* s)
: Element(s)
{
setFlags(ElementFlag::SELECTABLE);
_direction = Direction::AUTO;
_direction = MScore::Direction::AUTO;
_up = true;
_distribute = false;
_userModified[0] = false;
@ -280,8 +280,8 @@ void Beam::layout1()
}
}
else if (staff()->isDrumStaff()) {
if (_direction != Direction::AUTO) {
_up = _direction == Direction::UP;
if (_direction != MScore::Direction::AUTO) {
_up = _direction == MScore::Direction::UP;
}
else {
foreach (ChordRest* cr, _elements) {
@ -328,14 +328,14 @@ void Beam::layout1()
//
// determine beam stem direction
//
if (_direction != Direction::AUTO) {
_up = _direction == Direction::UP;
if (_direction != MScore::Direction::AUTO) {
_up = _direction == MScore::Direction::UP;
}
else {
if (c1) {
Measure* m = c1->measure();
if (c1->stemDirection() != Direction::AUTO)
_up = c1->stemDirection() == Direction::UP;
if (c1->stemDirection() != MScore::Direction::AUTO)
_up = c1->stemDirection() == MScore::Direction::UP;
else if (m->hasVoices(c1->staffIdx()))
_up = !(c1->voice() % 2);
else if (!twoBeamedNotes()) {
@ -351,7 +351,7 @@ void Beam::layout1()
}
cross = minMove < maxMove;
// int idx = (_direction == Direction::AUTO || _direction == Direction::DOWN) ? 0 : 1;
// int idx = (_direction == MScore::Direction::AUTO || _direction == MScore::Direction::DOWN) ? 0 : 1;
slope = 0.0;
foreach(ChordRest* cr, _elements)
@ -394,8 +394,8 @@ void Beam::layoutGraceNotes()
//
// determine beam stem direction
//
if (_direction != Direction::AUTO)
_up = _direction == Direction::UP;
if (_direction != MScore::Direction::AUTO)
_up = _direction == MScore::Direction::UP;
else {
ChordRest* cr = _elements[0];
@ -406,7 +406,7 @@ void Beam::layoutGraceNotes()
_up = true;
}
int idx = (_direction == Direction::AUTO || _direction == Direction::DOWN) ? 0 : 1;
int idx = (_direction == MScore::Direction::AUTO || _direction == MScore::Direction::DOWN) ? 0 : 1;
slope = 0.0;
if (!_userModified[idx]) {
@ -514,7 +514,7 @@ inline qreal absLimit(qreal val, qreal limit)
bool Beam::hasNoSlope()
{
int idx = (_direction == Direction::AUTO || _direction == Direction::DOWN) ? 0 : 1;
int idx = (_direction == MScore::Direction::AUTO || _direction == MScore::Direction::DOWN) ? 0 : 1;
return _noSlope && !_userModified[idx];
}
@ -1410,7 +1410,7 @@ void Beam::layout2(QList<ChordRest*>crl, SpannerSegmentType, int frag)
}
BeamFragment* f = fragments[frag];
int dIdx = (_direction == Direction::AUTO || _direction == Direction::DOWN) ? 0 : 1;
int dIdx = (_direction == MScore::Direction::AUTO || _direction == MScore::Direction::DOWN) ? 0 : 1;
qreal& py1 = f->py1[dIdx];
qreal& py2 = f->py2[dIdx];
@ -1773,7 +1773,7 @@ void Beam::layout2(QList<ChordRest*>crl, SpannerSegmentType, int frag)
void Beam::spatiumChanged(qreal oldValue, qreal newValue)
{
int idx = (_direction == Direction::AUTO || _direction == Direction::DOWN) ? 0 : 1;
int idx = (_direction == MScore::Direction::AUTO || _direction == MScore::Direction::DOWN) ? 0 : 1;
if (_userModified[idx]) {
qreal diff = newValue / oldValue;
foreach(BeamFragment* f, fragments) {
@ -1800,7 +1800,7 @@ void Beam::write(Xml& xml) const
writeProperty(xml, P_ID::GROW_LEFT);
writeProperty(xml, P_ID::GROW_RIGHT);
int idx = (_direction == Direction::AUTO || _direction == Direction::DOWN) ? 0 : 1;
int idx = (_direction == MScore::Direction::AUTO || _direction == MScore::Direction::DOWN) ? 0 : 1;
if (_userModified[idx]) {
qreal _spatium = spatium();
foreach(BeamFragment* f, fragments) {
@ -1855,7 +1855,7 @@ void Beam::read(XmlReader& e)
if (fragments.isEmpty())
fragments.append(new BeamFragment);
BeamFragment* f = fragments.back();
int idx = (_direction == Direction::AUTO || _direction == Direction::DOWN) ? 0 : 1;
int idx = (_direction == MScore::Direction::AUTO || _direction == MScore::Direction::DOWN) ? 0 : 1;
_userModified[idx] = true;
f->py1[idx] = e.readDouble() * _spatium;
}
@ -1863,13 +1863,13 @@ void Beam::read(XmlReader& e)
if (fragments.isEmpty())
fragments.append(new BeamFragment);
BeamFragment* f = fragments.back();
int idx = (_direction == Direction::AUTO || _direction == Direction::DOWN) ? 0 : 1;
int idx = (_direction == MScore::Direction::AUTO || _direction == MScore::Direction::DOWN) ? 0 : 1;
_userModified[idx] = true;
f->py2[idx] = e.readDouble() * _spatium;
}
else if (tag == "Fragment") {
BeamFragment* f = new BeamFragment;
int idx = (_direction == Direction::AUTO || _direction == Direction::DOWN) ? 0 : 1;
int idx = (_direction == MScore::Direction::AUTO || _direction == MScore::Direction::DOWN) ? 0 : 1;
_userModified[idx] = true;
qreal _spatium = spatium();
@ -1899,7 +1899,7 @@ void Beam::read(XmlReader& e)
void Beam::editDrag(const EditData& ed)
{
int idx = (_direction == Direction::AUTO || _direction == Direction::DOWN) ? 0 : 1;
int idx = (_direction == MScore::Direction::AUTO || _direction == MScore::Direction::DOWN) ? 0 : 1;
qreal dy = ed.delta.y();
BeamFragment* f = fragments[editFragment];
if (ed.curGrip == 0)
@ -1926,7 +1926,7 @@ void Beam::updateGrips(int* grips, int* defaultGrip, QRectF* grip) const
{
*grips = 2;
*defaultGrip = 1;
int idx = (_direction == Direction::AUTO || _direction == Direction::DOWN) ? 0 : 1;
int idx = (_direction == MScore::Direction::AUTO || _direction == MScore::Direction::DOWN) ? 0 : 1;
BeamFragment* f = fragments[editFragment];
Chord* c1 = nullptr;
@ -1953,11 +1953,11 @@ void Beam::updateGrips(int* grips, int* defaultGrip, QRectF* grip) const
// setBeamDirection
//---------------------------------------------------------
void Beam::setBeamDirection(Direction d)
void Beam::setBeamDirection(MScore::Direction d)
{
_direction = d;
if (d != Direction::AUTO)
_up = d == Direction::UP;
if (d != MScore::Direction::AUTO)
_up = d == MScore::Direction::UP;
}
//---------------------------------------------------------
@ -1976,8 +1976,8 @@ void Beam::reset()
score()->undoChangeProperty(this, P_ID::BEAM_POS, QVariant(beamPos()));
score()->undoChangeProperty(this, P_ID::USER_MODIFIED, false);
}
if (beamDirection() != Direction::AUTO)
score()->undoChangeProperty(this, P_ID::STEM_DIRECTION, int(Direction::AUTO));
if (beamDirection() != MScore::Direction::AUTO)
score()->undoChangeProperty(this, P_ID::STEM_DIRECTION, int(MScore::Direction::AUTO));
if (noSlopeStyle == PropertyStyle::UNSTYLED)
score()->undoChangeProperty(this, P_ID::BEAM_NO_SLOPE, propertyDefault(P_ID::BEAM_NO_SLOPE), PropertyStyle::STYLED);
@ -1994,7 +1994,7 @@ void Beam::startEdit(MuseScoreView*, const QPointF& p)
QPointF pt(p - pagePos());
qreal ydiff = 100000000.0;
int idx = (_direction == Direction::AUTO || _direction == Direction::DOWN) ? 0 : 1;
int idx = (_direction == MScore::Direction::AUTO || _direction == MScore::Direction::DOWN) ? 0 : 1;
int i = 0;
editFragment = 0;
foreach (BeamFragment* f, fragments) {
@ -2056,7 +2056,7 @@ QPointF Beam::beamPos() const
if (fragments.isEmpty())
return QPointF(0.0, 0.0);
BeamFragment* f = fragments.back();
int idx = (_direction == Direction::AUTO || _direction == Direction::DOWN) ? 0 : 1;
int idx = (_direction == MScore::Direction::AUTO || _direction == MScore::Direction::DOWN) ? 0 : 1;
qreal _spatium = spatium();
return QPointF(f->py1[idx] / _spatium, f->py2[idx] / _spatium);
}
@ -2070,7 +2070,7 @@ void Beam::setBeamPos(const QPointF& bp)
if (fragments.isEmpty())
fragments.append(new BeamFragment);
BeamFragment* f = fragments.back();
int idx = (_direction == Direction::AUTO || _direction == Direction::DOWN) ? 0 : 1;
int idx = (_direction == MScore::Direction::AUTO || _direction == MScore::Direction::DOWN) ? 0 : 1;
_userModified[idx] = true;
setGenerated(false);
qreal _spatium = spatium();
@ -2084,7 +2084,7 @@ void Beam::setBeamPos(const QPointF& bp)
bool Beam::userModified() const
{
int idx = (_direction == Direction::AUTO || _direction == Direction::DOWN) ? 0 : 1;
int idx = (_direction == MScore::Direction::AUTO || _direction == MScore::Direction::DOWN) ? 0 : 1;
return _userModified[idx];
}
@ -2094,7 +2094,7 @@ bool Beam::userModified() const
void Beam::setUserModified(bool val)
{
int idx = (_direction == Direction::AUTO || _direction == Direction::DOWN) ? 0 : 1;
int idx = (_direction == MScore::Direction::AUTO || _direction == MScore::Direction::DOWN) ? 0 : 1;
_userModified[idx] = val;
}
@ -2125,7 +2125,7 @@ bool Beam::setProperty(P_ID propertyId, const QVariant& v)
{
switch(propertyId) {
case P_ID::STEM_DIRECTION:
setBeamDirection(Direction(v.toInt()));
setBeamDirection(MScore::Direction(v.toInt()));
break;
case P_ID::DISTRIBUTE:
setDistribute(v.toBool());
@ -2164,7 +2164,7 @@ bool Beam::setProperty(P_ID propertyId, const QVariant& v)
QVariant Beam::propertyDefault(P_ID id) const
{
switch(id) {
case P_ID::STEM_DIRECTION: return int(Direction::AUTO);
case P_ID::STEM_DIRECTION: return int(MScore::Direction::AUTO);
case P_ID::DISTRIBUTE: return false;
case P_ID::GROW_LEFT: return 1.0;
case P_ID::GROW_RIGHT: return 1.0;

View file

@ -36,7 +36,7 @@ class Beam : public Element {
QList<ChordRest*> _elements; // must be sorted by tick
QList<QLineF*> beamSegments;
Direction _direction;
MScore::Direction _direction;
bool _up;
bool _distribute; // equal spacing of elements
@ -115,8 +115,8 @@ class Beam : public Element {
bool noSlope() const { return _noSlope; }
void setNoSlope(bool val) { _noSlope = val; }
void setBeamDirection(Direction d);
Direction beamDirection() const { return _direction; }
void setBeamDirection(MScore::Direction d);
MScore::Direction beamDirection() const { return _direction; }
virtual QPainterPath shape() const override;
virtual bool contains(const QPointF& p) const override;

View file

@ -188,7 +188,7 @@ Chord::Chord(Score* s)
_ledgerLines = 0;
_stem = 0;
_hook = 0;
_stemDirection = Direction::AUTO;
_stemDirection = MScore::Direction::AUTO;
_arpeggio = 0;
_tremolo = 0;
_glissando = 0;
@ -826,8 +826,8 @@ void Chord::computeUp()
}
// PITCHED STAVES (or TAB with stems through staves)
if (_stemDirection != Direction::AUTO) {
_up = _stemDirection == Direction::UP;
if (_stemDirection != MScore::Direction::AUTO) {
_up = _stemDirection == MScore::Direction::UP;
}
else if (_noteType != NoteType::NORMAL) {
//
@ -955,9 +955,9 @@ void Chord::write(Xml& xml) const
if (_hook && (!_hook->visible() || !_hook->userOff().isNull() || (_hook->color() != MScore::defaultColor)))
_hook->write(xml);
switch(_stemDirection) {
case Direction::UP: xml.tag("StemDirection", QVariant("up")); break;
case Direction::DOWN: xml.tag("StemDirection", QVariant("down")); break;
case Direction::AUTO: break;
case MScore::Direction::UP: xml.tag("StemDirection", QVariant("up")); break;
case MScore::Direction::DOWN: xml.tag("StemDirection", QVariant("down")); break;
case MScore::Direction::AUTO: break;
}
for (Note* n : _notes)
n->write(xml);
@ -1050,11 +1050,11 @@ void Chord::read(XmlReader& e)
else if (tag == "StemDirection") {
QString val(e.readElementText());
if (val == "up")
_stemDirection = Direction::UP;
_stemDirection = MScore::Direction::UP;
else if (val == "down")
_stemDirection = Direction::DOWN;
_stemDirection = MScore::Direction::DOWN;
else
_stemDirection = Direction(val.toInt());
_stemDirection = MScore::Direction(val.toInt());
}
else if (tag == "noStem")
_noStem = e.readInt();
@ -2456,7 +2456,7 @@ QVariant Chord::propertyDefault(P_ID propertyId) const
switch(propertyId) {
case P_ID::NO_STEM: return false;
case P_ID::SMALL: return false;
case P_ID::STEM_DIRECTION: return int(Direction::AUTO);
case P_ID::STEM_DIRECTION: return int(MScore::Direction::AUTO);
default:
return ChordRest::getProperty(propertyId);
}
@ -2478,7 +2478,7 @@ bool Chord::setProperty(P_ID propertyId, const QVariant& v)
score()->setLayoutAll(true);
break;
case P_ID::STEM_DIRECTION:
setStemDirection(Direction(v.toInt()));
setStemDirection(MScore::Direction(v.toInt()));
score()->setLayoutAll(true);
break;
default:
@ -2629,10 +2629,10 @@ QPointF Chord::layoutArticulation(Articulation* a)
staffBotY = qMax(staffBotY, qreal(chordBotY)); // bottom is bottom between staff bottom and chord bottom
//
// determine Direction
// determine MScore::Direction
//
if (a->direction() != Direction::AUTO) {
a->setUp(a->direction() == Direction::UP);
if (a->direction() != MScore::Direction::AUTO) {
a->setUp(a->direction() == MScore::Direction::UP);
}
else {
if (measure()->hasVoices(a->staffIdx())) {
@ -2677,7 +2677,7 @@ QPointF Chord::layoutArticulation(Articulation* a)
void Chord::reset()
{
score()->undoChangeProperty(this, P_ID::STEM_DIRECTION, int(Direction::AUTO));
score()->undoChangeProperty(this, P_ID::STEM_DIRECTION, int(MScore::Direction::AUTO));
score()->undoChangeProperty(this, P_ID::BEAM_MODE, int(Beam::Mode::AUTO));
score()->createPlayEvents(this);
ChordRest::reset();

View file

@ -71,24 +71,24 @@ class Chord : public ChordRest {
Q_PROPERTY(QQmlListProperty<Ms::Lyrics> lyrics READ qmlLyrics)
Q_PROPERTY(QQmlListProperty<Ms::Chord> graceNotes READ qmlGraceNotes)
QList<Note*> _notes; // sorted to decreasing line step
LedgerLine* _ledgerLines; // single linked list
QList<Note*> _notes; // sorted to decreasing line step
LedgerLine* _ledgerLines; // single linked list
Stem* _stem;
Hook* _hook;
StemSlash* _stemSlash; // for acciacatura
Stem* _stem;
Hook* _hook;
StemSlash* _stemSlash; // for acciacatura
Arpeggio* _arpeggio;
Tremolo* _tremolo;
Glissando* _glissando;
ElementList _el; ///< chordline, slur
QList<Chord*> _graceNotes;
int _graceIndex; ///< if this is a grace note, index in parent list
Arpeggio* _arpeggio;
Tremolo* _tremolo;
Glissando* _glissando;
ElementList _el; ///< chordline, slur
QList<Chord*> _graceNotes;
int _graceIndex; ///< if this is a grace note, index in parent list
Direction _stemDirection;
NoteType _noteType; ///< mark grace notes: acciaccatura and appoggiatura
bool _noStem;
PlayEventType _playEventType; ///< play events were modified by user
MScore::Direction _stemDirection;
NoteType _noteType; ///< mark grace notes: acciaccatura and appoggiatura
bool _noStem;
PlayEventType _playEventType; ///< play events were modified by user
virtual qreal upPos() const;
virtual qreal downPos() const;
@ -109,7 +109,7 @@ class Chord : public ChordRest {
virtual Chord* linkedClone();
virtual void setScore(Score* s);
virtual Element::Type type() const { return Element::Type::CHORD; }
virtual Element::Type type() const { return Element::Type::CHORD; }
virtual qreal mag() const;
virtual void write(Xml& xml) const;
@ -117,10 +117,10 @@ class Chord : public ChordRest {
virtual void setSelected(bool f);
virtual Element* drop(const DropData&);
void setStemDirection(Direction d) { _stemDirection = d; }
Direction stemDirection() const { return _stemDirection; }
void setStemDirection(MScore::Direction d) { _stemDirection = d; }
MScore::Direction stemDirection() const { return _stemDirection; }
LedgerLine* ledgerLines() { return _ledgerLines; }
LedgerLine* ledgerLines() { return _ledgerLines; }
void layoutStem1();
void layoutHook1(); // create hook if required

View file

@ -491,10 +491,10 @@ void ChordRest::layoutArticulations()
for (int i = 0; i < n; ++i) {
Articulation* a = _articulations.at(i);
//
// determine Direction
// determine MScore::Direction
//
if (a->direction() != Direction::AUTO) {
a->setUp(a->direction() == Direction::UP);
if (a->direction() != MScore::Direction::AUTO) {
a->setUp(a->direction() == MScore::Direction::UP);
}
else {
if (a->anchor() == ArticulationAnchor::CHORD)
@ -755,7 +755,7 @@ Element* ChordRest::drop(const DropData& data)
NoteVal nval;
nval.pitch = note->pitch();
nval.headGroup = note->headGroup();
score()->setNoteRest(segment(), track(), nval, data.duration, Direction::AUTO);
score()->setNoteRest(segment(), track(), nval, data.duration, MScore::Direction::AUTO);
delete e;
}
break;

View file

@ -449,7 +449,7 @@ void Score::setGraceNote(Chord* ch, int pitch, NoteType type, int len)
//---------------------------------------------------------
Segment* Score::setNoteRest(Segment* segment, int track, NoteVal nval, Fraction sd,
Direction stemDirection)
MScore::Direction stemDirection)
{
Q_ASSERT(segment->segmentType() == Segment::Type::ChordRest);
@ -1850,11 +1850,11 @@ void Score::cmdMirrorNoteHead()
if (note->staff() && note->staff()->isTabStaff())
note->score()->undoChangeProperty(e, P_ID::GHOST, true);
else {
DirectionH d = note->userMirror();
if (d == DirectionH::DH_AUTO)
d = note->chord()->up() ? DirectionH::DH_RIGHT : DirectionH::DH_LEFT;
MScore::DirectionH d = note->userMirror();
if (d == MScore::DirectionH::AUTO)
d = note->chord()->up() ? MScore::DirectionH::RIGHT : MScore::DirectionH::LEFT;
else
d = d == DirectionH::DH_LEFT ? DirectionH::DH_RIGHT : DirectionH::DH_LEFT;
d = d == MScore::DirectionH::LEFT ? MScore::DirectionH::RIGHT : MScore::DirectionH::LEFT;
undoChangeUserMirror(note, d);
}
}
@ -1925,12 +1925,12 @@ void Score::cmdDoubleDuration()
// cmdMoveRest
//---------------------------------------------------------
void Score::cmdMoveRest(Rest* rest, Direction dir)
void Score::cmdMoveRest(Rest* rest, MScore::Direction dir)
{
QPointF pos(rest->userOff());
if (dir == Direction::UP)
if (dir == MScore::Direction::UP)
pos.ry() -= spatium();
else if (dir == Direction::DOWN)
else if (dir == MScore::Direction::DOWN)
pos.ry() += spatium();
undoChangeProperty(rest, P_ID::USER_OFF, pos);
setLayoutAll(rest->beam() != nullptr); // layout all if rest is beamed
@ -1940,12 +1940,12 @@ void Score::cmdMoveRest(Rest* rest, Direction dir)
// cmdMoveLyrics
//---------------------------------------------------------
void Score::cmdMoveLyrics(Lyrics* lyrics, Direction dir)
void Score::cmdMoveLyrics(Lyrics* lyrics, MScore::Direction dir)
{
ChordRest* cr = lyrics->chordRest();
QList<Lyrics*>& ll = cr->lyricsList();
int no = lyrics->no();
if (dir == Direction::UP) {
if (dir == MScore::Direction::UP) {
if (no) {
if (ll[no-1] == 0) {
ll[no-1] = ll[no];
@ -1986,9 +1986,9 @@ void Score::cmd(const QAction* a)
if (el && (el->type() == Element::Type::ARTICULATION || el->isText()))
undoMove(el, el->userOff() + QPointF(0.0, -MScore::nudgeStep * el->spatium()));
else if (el && el->type() == Element::Type::REST)
cmdMoveRest(static_cast<Rest*>(el), Direction::UP);
cmdMoveRest(static_cast<Rest*>(el), MScore::Direction::UP);
else if (el && el->type() == Element::Type::LYRICS)
cmdMoveLyrics(static_cast<Lyrics*>(el), Direction::UP);
cmdMoveLyrics(static_cast<Lyrics*>(el), MScore::Direction::UP);
else
upDown(true, UpDownMode::CHROMATIC);
}
@ -1996,9 +1996,9 @@ void Score::cmd(const QAction* a)
if (el && (el->type() == Element::Type::ARTICULATION || el->isText()))
undoMove(el, el->userOff() + QPointF(0.0, MScore::nudgeStep * el->spatium()));
else if (el && el->type() == Element::Type::REST)
cmdMoveRest(static_cast<Rest*>(el), Direction::DOWN);
cmdMoveRest(static_cast<Rest*>(el), MScore::Direction::DOWN);
else if (el && el->type() == Element::Type::LYRICS)
cmdMoveLyrics(static_cast<Lyrics*>(el), Direction::DOWN);
cmdMoveLyrics(static_cast<Lyrics*>(el), MScore::Direction::DOWN);
else
upDown(false, UpDownMode::CHROMATIC);
}

View file

@ -81,7 +81,7 @@ void Drumset::load(XmlReader& e)
else if (tag == "name")
_drum[pitch].name = e.readElementText();
else if (tag == "stem")
_drum[pitch].stemDirection = Direction(e.readInt());
_drum[pitch].stemDirection = MScore::Direction(e.readInt());
else if (tag == "shortcut") {
bool isNum;
QString val(e.readElementText());
@ -153,33 +153,33 @@ void initDrumset()
smDrumset->drum(i).line = 0;
smDrumset->drum(i).shortcut = 0;
smDrumset->drum(i).voice = 0;
smDrumset->drum(i).stemDirection = Direction::UP;
smDrumset->drum(i).stemDirection = MScore::Direction::UP;
}
smDrumset->drum(35) = DrumInstrument(QT_TRANSLATE_NOOP("drumset", "Acoustic Bass Drum"), NoteHead::Group::HEAD_NORMAL, 7, Direction::DOWN, 1);
smDrumset->drum(36) = DrumInstrument(QT_TRANSLATE_NOOP("drumset", "Bass Drum"), NoteHead::Group::HEAD_NORMAL, 7, Direction::DOWN, 1, Qt::Key_C);
smDrumset->drum(37) = DrumInstrument(QT_TRANSLATE_NOOP("drumset", "Side Stick"), NoteHead::Group::HEAD_CROSS, 3, Direction::UP);
smDrumset->drum(38) = DrumInstrument(QT_TRANSLATE_NOOP("drumset", "Snare (Acoustic)"), NoteHead::Group::HEAD_NORMAL, 3, Direction::UP);
smDrumset->drum(40) = DrumInstrument(QT_TRANSLATE_NOOP("drumset", "Snare (Electric)"), NoteHead::Group::HEAD_NORMAL, 3, Direction::UP);
smDrumset->drum(41) = DrumInstrument(QT_TRANSLATE_NOOP("drumset", "Tom 5"), NoteHead::Group::HEAD_NORMAL, 5, Direction::UP);
smDrumset->drum(42) = DrumInstrument(QT_TRANSLATE_NOOP("drumset", "Hi-Hat Closed"), NoteHead::Group::HEAD_CROSS, -1, Direction::UP);
smDrumset->drum(43) = DrumInstrument(QT_TRANSLATE_NOOP("drumset", "Tom 4"), NoteHead::Group::HEAD_NORMAL, 5, Direction::DOWN, 1);
smDrumset->drum(44) = DrumInstrument(QT_TRANSLATE_NOOP("drumset", "Hi-Hat Pedal"), NoteHead::Group::HEAD_CROSS, 9, Direction::DOWN, 1);
smDrumset->drum(45) = DrumInstrument(QT_TRANSLATE_NOOP("drumset", "Tom 3"), NoteHead::Group::HEAD_NORMAL, 2, Direction::UP);
smDrumset->drum(46) = DrumInstrument(QT_TRANSLATE_NOOP("drumset", "Hi-Hat Open"), NoteHead::Group::HEAD_CROSS, 1, Direction::UP);
smDrumset->drum(47) = DrumInstrument(QT_TRANSLATE_NOOP("drumset", "Tom 2"), NoteHead::Group::HEAD_NORMAL, 1, Direction::UP);
smDrumset->drum(48) = DrumInstrument(QT_TRANSLATE_NOOP("drumset", "Tom 1"), NoteHead::Group::HEAD_NORMAL, 0, Direction::UP);
smDrumset->drum(49) = DrumInstrument(QT_TRANSLATE_NOOP("drumset", "Crash 1"), NoteHead::Group::HEAD_CROSS, -2, Direction::UP);
smDrumset->drum(50) = DrumInstrument(QT_TRANSLATE_NOOP("drumset", "Tom"), NoteHead::Group::HEAD_NORMAL, 0, Direction::UP);
smDrumset->drum(51) = DrumInstrument(QT_TRANSLATE_NOOP("drumset", "Ride"), NoteHead::Group::HEAD_CROSS, 0, Direction::UP, 0, Qt::Key_D);
smDrumset->drum(52) = DrumInstrument(QT_TRANSLATE_NOOP("drumset", "China"), NoteHead::Group::HEAD_CROSS, -3, Direction::UP);
smDrumset->drum(53) = DrumInstrument(QT_TRANSLATE_NOOP("drumset", "Ride (Bell)"), NoteHead::Group::HEAD_DIAMOND, 0, Direction::UP);
smDrumset->drum(54) = DrumInstrument(QT_TRANSLATE_NOOP("drumset", "Tambourine"), NoteHead::Group::HEAD_DIAMOND, 2, Direction::UP);
smDrumset->drum(55) = DrumInstrument(QT_TRANSLATE_NOOP("drumset", "Ride (Bell)"), NoteHead::Group::HEAD_CROSS, -3, Direction::UP);
smDrumset->drum(56) = DrumInstrument(QT_TRANSLATE_NOOP("drumset", "Ride (Bell)"), NoteHead::Group::HEAD_TRIANGLE, 1, Direction::UP);
smDrumset->drum(57) = DrumInstrument(QT_TRANSLATE_NOOP("drumset", "Ride (Bell)"), NoteHead::Group::HEAD_CROSS, -3, Direction::UP);
smDrumset->drum(59) = DrumInstrument(QT_TRANSLATE_NOOP("drumset", "Ride (Bell)"), NoteHead::Group::HEAD_CROSS, 2, Direction::UP);
smDrumset->drum(63) = DrumInstrument(QT_TRANSLATE_NOOP("drumset", "open high conga"), NoteHead::Group::HEAD_CROSS, 4, Direction::UP);
smDrumset->drum(64) = DrumInstrument(QT_TRANSLATE_NOOP("drumset", "low conga"), NoteHead::Group::HEAD_CROSS, 6, Direction::UP);
smDrumset->drum(35) = DrumInstrument(QT_TRANSLATE_NOOP("drumset", "Acoustic Bass Drum"), NoteHead::Group::HEAD_NORMAL, 7, MScore::Direction::DOWN, 1);
smDrumset->drum(36) = DrumInstrument(QT_TRANSLATE_NOOP("drumset", "Bass Drum"), NoteHead::Group::HEAD_NORMAL, 7, MScore::Direction::DOWN, 1, Qt::Key_C);
smDrumset->drum(37) = DrumInstrument(QT_TRANSLATE_NOOP("drumset", "Side Stick"), NoteHead::Group::HEAD_CROSS, 3, MScore::Direction::UP);
smDrumset->drum(38) = DrumInstrument(QT_TRANSLATE_NOOP("drumset", "Snare (Acoustic)"), NoteHead::Group::HEAD_NORMAL, 3, MScore::Direction::UP);
smDrumset->drum(40) = DrumInstrument(QT_TRANSLATE_NOOP("drumset", "Snare (Electric)"), NoteHead::Group::HEAD_NORMAL, 3, MScore::Direction::UP);
smDrumset->drum(41) = DrumInstrument(QT_TRANSLATE_NOOP("drumset", "Tom 5"), NoteHead::Group::HEAD_NORMAL, 5, MScore::Direction::UP);
smDrumset->drum(42) = DrumInstrument(QT_TRANSLATE_NOOP("drumset", "Hi-Hat Closed"), NoteHead::Group::HEAD_CROSS, -1, MScore::Direction::UP);
smDrumset->drum(43) = DrumInstrument(QT_TRANSLATE_NOOP("drumset", "Tom 4"), NoteHead::Group::HEAD_NORMAL, 5, MScore::Direction::DOWN, 1);
smDrumset->drum(44) = DrumInstrument(QT_TRANSLATE_NOOP("drumset", "Hi-Hat Pedal"), NoteHead::Group::HEAD_CROSS, 9, MScore::Direction::DOWN, 1);
smDrumset->drum(45) = DrumInstrument(QT_TRANSLATE_NOOP("drumset", "Tom 3"), NoteHead::Group::HEAD_NORMAL, 2, MScore::Direction::UP);
smDrumset->drum(46) = DrumInstrument(QT_TRANSLATE_NOOP("drumset", "Hi-Hat Open"), NoteHead::Group::HEAD_CROSS, 1, MScore::Direction::UP);
smDrumset->drum(47) = DrumInstrument(QT_TRANSLATE_NOOP("drumset", "Tom 2"), NoteHead::Group::HEAD_NORMAL, 1, MScore::Direction::UP);
smDrumset->drum(48) = DrumInstrument(QT_TRANSLATE_NOOP("drumset", "Tom 1"), NoteHead::Group::HEAD_NORMAL, 0, MScore::Direction::UP);
smDrumset->drum(49) = DrumInstrument(QT_TRANSLATE_NOOP("drumset", "Crash 1"), NoteHead::Group::HEAD_CROSS, -2, MScore::Direction::UP);
smDrumset->drum(50) = DrumInstrument(QT_TRANSLATE_NOOP("drumset", "Tom"), NoteHead::Group::HEAD_NORMAL, 0, MScore::Direction::UP);
smDrumset->drum(51) = DrumInstrument(QT_TRANSLATE_NOOP("drumset", "Ride"), NoteHead::Group::HEAD_CROSS, 0, MScore::Direction::UP, 0, Qt::Key_D);
smDrumset->drum(52) = DrumInstrument(QT_TRANSLATE_NOOP("drumset", "China"), NoteHead::Group::HEAD_CROSS, -3, MScore::Direction::UP);
smDrumset->drum(53) = DrumInstrument(QT_TRANSLATE_NOOP("drumset", "Ride (Bell)"), NoteHead::Group::HEAD_DIAMOND, 0, MScore::Direction::UP);
smDrumset->drum(54) = DrumInstrument(QT_TRANSLATE_NOOP("drumset", "Tambourine"), NoteHead::Group::HEAD_DIAMOND, 2, MScore::Direction::UP);
smDrumset->drum(55) = DrumInstrument(QT_TRANSLATE_NOOP("drumset", "Ride (Bell)"), NoteHead::Group::HEAD_CROSS, -3, MScore::Direction::UP);
smDrumset->drum(56) = DrumInstrument(QT_TRANSLATE_NOOP("drumset", "Ride (Bell)"), NoteHead::Group::HEAD_TRIANGLE, 1, MScore::Direction::UP);
smDrumset->drum(57) = DrumInstrument(QT_TRANSLATE_NOOP("drumset", "Ride (Bell)"), NoteHead::Group::HEAD_CROSS, -3, MScore::Direction::UP);
smDrumset->drum(59) = DrumInstrument(QT_TRANSLATE_NOOP("drumset", "Ride (Bell)"), NoteHead::Group::HEAD_CROSS, 2, MScore::Direction::UP);
smDrumset->drum(63) = DrumInstrument(QT_TRANSLATE_NOOP("drumset", "open high conga"), NoteHead::Group::HEAD_CROSS, 4, MScore::Direction::UP);
smDrumset->drum(64) = DrumInstrument(QT_TRANSLATE_NOOP("drumset", "low conga"), NoteHead::Group::HEAD_CROSS, 6, MScore::Direction::UP);
}
}

View file

@ -28,12 +28,12 @@ struct DrumInstrument {
QString name;
NoteHead::Group notehead; ///< notehead symbol set
int line; ///< place notehead onto this line
Direction stemDirection;
MScore::Direction stemDirection;
int voice;
char shortcut; ///< accelerator key (CDEFGAB)
DrumInstrument() {}
DrumInstrument(const char* s, NoteHead::Group nh, int l, Direction d,
DrumInstrument(const char* s, NoteHead::Group nh, int l, MScore::Direction d,
int v = 0, char sc = 0)
: name(s), notehead(nh), line(l), stemDirection(d), voice(v), shortcut(sc) {}
};
@ -54,7 +54,7 @@ class Drumset {
NoteHead::Group noteHead(int pitch) const { return _drum[pitch].notehead; }
int line(int pitch) const { return _drum[pitch].line; }
int voice(int pitch) const { return _drum[pitch].voice; }
Direction stemDirection(int pitch) const { return _drum[pitch].stemDirection; }
MScore::Direction stemDirection(int pitch) const { return _drum[pitch].stemDirection; }
const QString& name(int pitch) const { return _drum[pitch].name; }
int shortcut(int pitch) const { return _drum[pitch].shortcut; }

View file

@ -870,7 +870,7 @@ void Score::putNote(const Position& p, bool replace)
_is.setSegment(s);
const Instrument* instr = st->part()->instr(s->tick());
Direction stemDirection = Direction::AUTO;
MScore::Direction stemDirection = MScore::Direction::AUTO;
NoteVal nval;
const StringData* stringData = 0;
StaffType* tab = 0;
@ -1283,19 +1283,19 @@ void Score::cmdFlip()
if (chord->beam())
e = chord->beam(); // fall trough
else {
Direction dir = chord->up() ? Direction::DOWN : Direction::UP;
MScore::Direction dir = chord->up() ? MScore::Direction::DOWN : MScore::Direction::UP;
undoChangeProperty(chord, P_ID::STEM_DIRECTION, int(dir));
}
}
if (e->type() == Element::Type::BEAM) {
Beam* beam = static_cast<Beam*>(e);
Direction dir = beam->up() ? Direction::DOWN : Direction::UP;
MScore::Direction dir = beam->up() ? MScore::Direction::DOWN : MScore::Direction::UP;
undoChangeProperty(beam, P_ID::STEM_DIRECTION, int(dir));
}
else if (e->type() == Element::Type::SLUR_SEGMENT) {
SlurTie* slur = static_cast<SlurSegment*>(e)->slurTie();
Direction dir = slur->up() ? Direction::DOWN : Direction::UP;
MScore::Direction dir = slur->up() ? MScore::Direction::DOWN : MScore::Direction::UP;
undoChangeProperty(slur, P_ID::SLUR_DIRECTION, int(dir));
}
else if (e->type() == Element::Type::HAIRPIN_SEGMENT) {
@ -1319,19 +1319,19 @@ void Score::cmdFlip()
undoChangeProperty(a, P_ID::ARTICULATION_ANCHOR, int(aa));
}
else {
Direction d = a->up() ? Direction::DOWN : Direction::UP;
MScore::Direction d = a->up() ? MScore::Direction::DOWN : MScore::Direction::UP;
undoChangeProperty(a, P_ID::DIRECTION, int(d));
}
return; // no layoutAll
}
else if (e->type() == Element::Type::TUPLET) {
Tuplet* tuplet = static_cast<Tuplet*>(e);
Direction d = tuplet->isUp() ? Direction::DOWN : Direction::UP;
MScore::Direction d = tuplet->isUp() ? MScore::Direction::DOWN : MScore::Direction::UP;
undoChangeProperty(tuplet, P_ID::DIRECTION, int(d));
}
else if (e->type() == Element::Type::NOTEDOT) {
Note* note = static_cast<Note*>(e->parent());
Direction d = note->dotIsUp() ? Direction::DOWN : Direction::UP;
MScore::Direction d = note->dotIsUp() ? MScore::Direction::DOWN : MScore::Direction::UP;
undoChangeProperty(note, P_ID::DOT_POSITION, int(d));
// undo(new FlipNoteDotDirection(static_cast<Note*>(e->parent())));
}
@ -2046,7 +2046,7 @@ void Score::cmdEnterRest(const TDuration& d)
int track = _is.track();
NoteVal nval;
setNoteRest(_is.segment(), track, nval, d.fraction(), Direction::AUTO);
setNoteRest(_is.segment(), track, nval, d.fraction(), MScore::Direction::AUTO);
_is.moveToNextInputPos();
_is.setRest(false); // continue with normal note entry
endCmd();

View file

@ -513,12 +513,12 @@ qreal Score::layoutChords2(QList<Note*>& notes, bool up)
chord->rxpos() = 0.0;
// let user mirror property override the default we calculated
if (note->userMirror() == DirectionH::DH_AUTO) {
if (note->userMirror() == MScore::DirectionH::AUTO) {
mirror = nmirror;
}
else {
mirror = note->chord()->up();
if (note->userMirror() == DirectionH::DH_LEFT)
if (note->userMirror() == MScore::DirectionH::LEFT)
mirror = !mirror;
}
note->setMirror(mirror);
@ -796,9 +796,9 @@ void Score::layoutChords3(QList<Note*>& notes, Staff* staff, Segment* segment)
upDotPosX = qMax(upDotPosX, xx);
else
downDotPosX = qMax(downDotPosX, xx);
Direction dotPosition = note->userDotPosition();
MScore::Direction dotPosition = note->userDotPosition();
if (dotPosition == Direction::AUTO && nNotes > 1 && note->visible() && !note->dotsHidden()) {
if (dotPosition == MScore::Direction::AUTO && nNotes > 1 && note->visible() && !note->dotsHidden()) {
// resolve dot conflicts
int line = note->line();
Note* above = (i < nNotes - 1) ? notes[i+1] : 0;
@ -812,14 +812,14 @@ void Score::layoutChords3(QList<Note*>& notes, Staff* staff, Segment* segment)
if ((line & 1) == 0) {
// line
if (intervalAbove == 1 && intervalBelow != 1)
dotPosition = Direction::DOWN;
dotPosition = MScore::Direction::DOWN;
else if (intervalBelow == 1 && intervalAbove != 1)
dotPosition = Direction::UP;
dotPosition = MScore::Direction::UP;
else if (intervalAbove == 0 && above->chord()->dots()) {
// unison
if (((above->voice() & 1) == (note->voice() & 1))) {
above->setDotY(Direction::UP);
dotPosition = Direction::DOWN;
above->setDotY(MScore::Direction::UP);
dotPosition = MScore::Direction::DOWN;
}
}
}
@ -828,12 +828,12 @@ void Score::layoutChords3(QList<Note*>& notes, Staff* staff, Segment* segment)
if (intervalAbove == 0 && above->chord()->dots()) {
// unison
if (!(note->voice() & 1))
dotPosition = Direction::UP;
dotPosition = MScore::Direction::UP;
else {
if (!(above->voice() & 1))
above->setDotY(Direction::UP);
above->setDotY(MScore::Direction::UP);
else
dotPosition = Direction::DOWN;
dotPosition = MScore::Direction::DOWN;
}
}
}

View file

@ -108,8 +108,8 @@ void MScore::init()
#ifdef SCRIPT_INTERFACE
qRegisterMetaType<Element::Type>("ElementType");
qRegisterMetaType<Note::ValueType>("ValueType");
qRegisterMetaType<Direction>("Direction");
qRegisterMetaType<DirectionH>("DirectionH");
qRegisterMetaType<MScore::Direction>("Direction");
qRegisterMetaType<MScore::DirectionH>("DirectionH");
qRegisterMetaType<Element::Placement>("Placement");
qRegisterMetaType<Accidental::Role>("AccidentalRole");
qRegisterMetaType<Accidental::Type>("AccidentalType");
@ -130,7 +130,7 @@ void MScore::init()
qRegisterMetaType<Hairpin::Type>("HairpinType");
qRegisterMetaType<Lyrics::Syllabic>("Syllabic");
qRegisterMetaType<LayoutBreak::Type>("LayoutBreakType");
qRegisterMetaType<Glissando::Type>("Glissando::Type");
qRegisterMetaType<Glissando::Type>("GlissandoType");
// qRegisterMetaType<TextStyle>("TextStyle");
#endif

View file

@ -72,9 +72,6 @@ static const int VISUAL_STRING_NONE = -2; // no ordinal for the visu
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
enum class Direction : char { AUTO, UP, DOWN };
enum class DirectionH : char { DH_AUTO, DH_LEFT, DH_RIGHT };
//---------------------------------------------------------
// ArticulationType
//---------------------------------------------------------
@ -333,6 +330,9 @@ class MScore : public QObject {
#endif
public:
enum class Direction : char { AUTO, UP, DOWN };
enum class DirectionH : char { AUTO, LEFT, RIGHT };
static void init();
static MStyle* defaultStyle();
@ -412,8 +412,8 @@ Q_DECLARE_OPERATORS_FOR_FLAGS(Align);
} // namespace Ms
Q_DECLARE_METATYPE(Ms::Direction);
Q_DECLARE_METATYPE(Ms::DirectionH);
Q_DECLARE_METATYPE(Ms::MScore::Direction);
Q_DECLARE_METATYPE(Ms::MScore::DirectionH);
#endif

View file

@ -170,9 +170,9 @@ Note::Note(Score* s)
_tuning = 0.0;
_accidental = 0;
_mirror = false;
_userMirror = DirectionH::DH_AUTO;
_userMirror = MScore::DirectionH::AUTO;
_small = false;
_userDotPosition = Direction::AUTO;
_userDotPosition = MScore::Direction::AUTO;
_line = 0;
_fret = -1;
_string = -1;
@ -1413,7 +1413,7 @@ Element* Note::drop(const DropData& data)
{
Chord* c = static_cast<Chord*>(e);
Note* n = c->upNote();
Direction dir = c->stemDirection();
MScore::Direction dir = c->stemDirection();
int t = (staff2track(staffIdx()) + n->voice());
score()->select(0, SelectType::SINGLE, 0);
NoteVal nval;
@ -1438,7 +1438,7 @@ Element* Note::drop(const DropData& data)
// setDotPosition
//---------------------------------------------------------
void Note::setDotY(Direction pos)
void Note::setDotY(MScore::Direction pos)
{
bool onLine = false;
qreal y = 0;
@ -1465,17 +1465,17 @@ void Note::setDotY(Direction pos)
bool oddVoice = voice() & 1;
if (onLine) {
// displace dots by half spatium up or down according to voice
if (pos == Direction::AUTO)
if (pos == MScore::Direction::AUTO)
y = oddVoice ? 0.5 : -0.5;
else if (pos == Direction::UP)
else if (pos == MScore::Direction::UP)
y = -0.5;
else
y = 0.5;
}
else {
if (pos == Direction::UP && !oddVoice)
if (pos == MScore::Direction::UP && !oddVoice)
y -= 1.0;
else if (pos == Direction::DOWN && oddVoice)
else if (pos == MScore::Direction::DOWN && oddVoice)
y += 1.0;
}
y *= spatium() * staff()->lineDistance();
@ -1585,10 +1585,10 @@ bool Note::dotIsUp() const
{
if (_dots[0] == 0)
return true;
if (_userDotPosition == Direction::AUTO)
if (_userDotPosition == MScore::Direction::AUTO)
return _dots[0]->y() < spatium() * .1;
else
return (_userDotPosition == Direction::UP);
return (_userDotPosition == MScore::Direction::UP);
}
//---------------------------------------------------------
@ -1759,7 +1759,7 @@ void Note::reset()
{
score()->undoChangeProperty(this, P_ID::USER_OFF, QPointF());
score()->undoChangeProperty(chord(), P_ID::USER_OFF, QPointF());
score()->undoChangeProperty(chord(), P_ID::STEM_DIRECTION, int(Direction::AUTO));
score()->undoChangeProperty(chord(), P_ID::STEM_DIRECTION, int(MScore::Direction::AUTO));
}
//---------------------------------------------------------
@ -2075,10 +2075,10 @@ bool Note::setProperty(P_ID propertyId, const QVariant& v)
setSmall(v.toBool());
break;
case P_ID::MIRROR_HEAD:
setUserMirror(DirectionH(v.toInt()));
setUserMirror(MScore::DirectionH(v.toInt()));
break;
case P_ID::DOT_POSITION:
setUserDotPosition(Direction(v.toInt()));
setUserDotPosition(MScore::Direction(v.toInt()));
break;
case P_ID::HEAD_GROUP:
setHeadGroup(NoteHead::Group(v.toInt()));
@ -2205,7 +2205,7 @@ void Note::undoSetVeloOffset(int val)
// undoSetUserMirror
//---------------------------------------------------------
void Note::undoSetUserMirror(DirectionH val)
void Note::undoSetUserMirror(MScore::DirectionH val)
{
undoChangeProperty(P_ID::MIRROR_HEAD, int(val));
}
@ -2214,7 +2214,7 @@ void Note::undoSetUserMirror(DirectionH val)
// undoSetUserDotPosition
//---------------------------------------------------------
void Note::undoSetUserDotPosition(Direction val)
void Note::undoSetUserDotPosition(MScore::Direction val)
{
undoChangeProperty(P_ID::DOT_POSITION, int(val));
}
@ -2257,9 +2257,9 @@ QVariant Note::propertyDefault(P_ID propertyId) const
case P_ID::SMALL:
return false;
case P_ID::MIRROR_HEAD:
return int(DirectionH::DH_AUTO);
return int(MScore::DirectionH::AUTO);
case P_ID::DOT_POSITION:
return int(Direction::AUTO);
return int(MScore::Direction::AUTO);
case P_ID::HEAD_GROUP:
return int(NoteHead::Group::HEAD_NORMAL);
case P_ID::VELO_OFFSET:

View file

@ -109,57 +109,59 @@ struct NoteVal {
// @@ Note
/// Graphic representation of a note.
//
// @P subchannel int midi subchannel (for midi articulation) (read only)
// @P line int notehead position (read only)
// @P fret int fret number in tablature
// @P string int string number in tablature
// @P tpc int tonal pitch class, as per concert pitch setting
// @P tpc1 int tonal pitch class, non transposed
// @P tpc2 int tonal pitch class, transposed
// @P pitch int midi pitch
// @P ppitch int actual played midi pitch (honoring ottavas) (read only)
// @P ghost bool ghost note (guitar: death note)
// @P hidden bool hidden, not played note (read only)
// @P mirror bool mirror note head on x axis (read only)
// @P small bool small note head
// @P play bool play note
// @P tuning qreal tuning offset in cent
// @P veloType Ms::Note::ValueType (OFFSET_VAL, USER_VAL)
// @P subchannel int midi subchannel (for midi articulation) (read only)
// @P line int notehead position (read only)
// @P fret int fret number in tablature
// @P string int string number in tablature
// @P tpc int tonal pitch class, as per concert pitch setting
// @P tpc1 int tonal pitch class, non transposed
// @P tpc2 int tonal pitch class, transposed
// @P pitch int midi pitch
// @P ppitch int actual played midi pitch (honoring ottavas) (read only)
// @P ghost bool ghost note (guitar: death note)
// @P hidden bool hidden, not played note (read only)
// @P mirror bool mirror note head on x axis (read only)
// @P small bool small note head
// @P play bool play note
// @P tuning qreal tuning offset in cent
// @P veloType Ms::Note::ValueType (OFFSET_VAL, USER_VAL)
// @P veloOffset int
// @P userMirror Ms::DirectionH (DH_AUTO, DH_LEFT, DH_RIGHT)
// @P userDotPosition Ms::Direction (AUTO, UP, DOWN)
// @P headGroup Ms::NoteHead::Group (HEAD_NORMAL, HEAD_CROSS, HEAD_DIAMOND, HEAD_TRIANGLE, HEAD_MI, HEAD_SLASH, HEAD_XCIRCLE, HEAD_DO, HEAD_RE, HEAD_FA, HEAD_LA, HEAD_TI, HEAD_SOL, HEAD_BREVIS_ALT)
// @P headType Ms::NoteHead::Type (HEAD_AUTO, HEAD_WHOLE, HEAD_HALF, HEAD_QUARTER, HEAD_BREVIS)
// @P elements array[Ms::Element] list of elements attached to note head
// @P userMirror Ms::MScore::DirectionH (AUTO, LEFT, RIGHT)
// @P userDotPosition Ms::MScore::Direction (AUTO, UP, DOWN)
// @P headGroup Ms::NoteHead::Group (HEAD_NORMAL, HEAD_CROSS, HEAD_DIAMOND, HEAD_TRIANGLE, HEAD_MI, HEAD_SLASH, HEAD_XCIRCLE, HEAD_DO, HEAD_RE, HEAD_FA, HEAD_LA, HEAD_TI, HEAD_SOL, HEAD_BREVIS_ALT)
// @P headType Ms::NoteHead::Type (HEAD_AUTO, HEAD_WHOLE, HEAD_HALF, HEAD_QUARTER, HEAD_BREVIS)
// @P elements array[Ms::Element] list of elements attached to note head
//---------------------------------------------------------------------------------------
class Note : public Element {
Q_OBJECT
Q_PROPERTY(int subchannel READ subchannel)
Q_PROPERTY(int line READ line)
Q_PROPERTY(int fret READ fret WRITE undoSetFret)
Q_PROPERTY(int string READ string WRITE undoSetString)
Q_PROPERTY(int tpc READ tpc)
Q_PROPERTY(int tpc1 READ tpc1 WRITE undoSetTpc1)
Q_PROPERTY(int tpc2 READ tpc2 WRITE undoSetTpc2)
Q_PROPERTY(int pitch READ pitch WRITE undoSetPitch)
Q_PROPERTY(int ppitch READ ppitch)
Q_PROPERTY(bool ghost READ ghost WRITE undoSetGhost)
Q_PROPERTY(bool hidden READ hidden)
Q_PROPERTY(bool mirror READ mirror)
Q_PROPERTY(bool small READ small WRITE undoSetSmall)
Q_PROPERTY(bool play READ play WRITE undoSetPlay)
Q_PROPERTY(qreal tuning READ tuning WRITE undoSetTuning)
Q_PROPERTY(Ms::Note::ValueType veloType READ veloType WRITE undoSetVeloType)
Q_PROPERTY(int veloOffset READ veloOffset WRITE undoSetVeloOffset)
Q_PROPERTY(Ms::DirectionH userMirror READ userMirror WRITE undoSetUserMirror)
Q_PROPERTY(Ms::Direction userDotPosition READ userDotPosition WRITE undoSetUserDotPosition)
Q_PROPERTY(Ms::NoteHead::Group headGroup READ headGroup WRITE undoSetHeadGroup)
Q_PROPERTY(Ms::NoteHead::Type headType READ headType WRITE undoSetHeadType)
Q_PROPERTY(int subchannel READ subchannel)
Q_PROPERTY(int line READ line)
Q_PROPERTY(int fret READ fret WRITE undoSetFret)
Q_PROPERTY(int string READ string WRITE undoSetString)
Q_PROPERTY(int tpc READ tpc)
Q_PROPERTY(int tpc1 READ tpc1 WRITE undoSetTpc1)
Q_PROPERTY(int tpc2 READ tpc2 WRITE undoSetTpc2)
Q_PROPERTY(int pitch READ pitch WRITE undoSetPitch)
Q_PROPERTY(int ppitch READ ppitch)
Q_PROPERTY(bool ghost READ ghost WRITE undoSetGhost)
Q_PROPERTY(bool hidden READ hidden)
Q_PROPERTY(bool mirror READ mirror)
Q_PROPERTY(bool small READ small WRITE undoSetSmall)
Q_PROPERTY(bool play READ play WRITE undoSetPlay)
Q_PROPERTY(qreal tuning READ tuning WRITE undoSetTuning)
Q_PROPERTY(Ms::Note::ValueType veloType READ veloType WRITE undoSetVeloType)
Q_PROPERTY(int veloOffset READ veloOffset WRITE undoSetVeloOffset)
Q_PROPERTY(Ms::MScore::DirectionH userMirror READ userMirror WRITE undoSetUserMirror)
Q_PROPERTY(Ms::MScore::Direction userDotPosition READ userDotPosition WRITE undoSetUserDotPosition)
Q_PROPERTY(Ms::NoteHead::Group headGroup READ headGroup WRITE undoSetHeadGroup)
Q_PROPERTY(Ms::NoteHead::Type headType READ headType WRITE undoSetHeadType)
Q_PROPERTY(QQmlListProperty<Ms::Element> elements READ qmlElements)
Q_ENUMS(ValueType)
Q_ENUMS(Ms::NoteHead::Group)
Q_ENUMS(Ms::NoteHead::Type)
Q_ENUMS(Ms::MScore::Direction)
Q_ENUMS(Ms::MScore::DirectionH)
public:
enum class ValueType : char { OFFSET_VAL, USER_VAL };
@ -187,8 +189,8 @@ class Note : public Element {
bool _play; // note is not played if false
mutable bool _mark; // for use in sequencer
DirectionH _userMirror; ///< user override of mirror
Direction _userDotPosition; ///< user override of dot position
MScore::DirectionH _userMirror; ///< user override of mirror
MScore::Direction _userDotPosition; ///< user override of dot position
NoteHead::Group _headGroup;
NoteHead::Type _headType;
@ -337,11 +339,11 @@ class Note : public Element {
int subchannel() const { return _subchannel; }
void setSubchannel(int val) { _subchannel = val; }
DirectionH userMirror() const { return _userMirror; }
void setUserMirror(DirectionH d) { _userMirror = d; }
MScore::DirectionH userMirror() const { return _userMirror; }
void setUserMirror(MScore::DirectionH d) { _userMirror = d; }
Direction userDotPosition() const { return _userDotPosition; }
void setUserDotPosition(Direction d) { _userDotPosition = d; }
MScore::Direction userDotPosition() const { return _userDotPosition; }
void setUserDotPosition(MScore::Direction d) { _userDotPosition = d; }
bool dotIsUp() const; // actual dot position
void reset();
@ -385,8 +387,8 @@ class Note : public Element {
void undoSetVeloOffset(int);
void undoSetOnTimeUserOffset(int);
void undoSetOffTimeUserOffset(int);
void undoSetUserMirror(DirectionH);
void undoSetUserDotPosition(Direction);
void undoSetUserMirror(MScore::DirectionH);
void undoSetUserDotPosition(MScore::Direction);
void undoSetHeadGroup(NoteHead::Group);
void undoSetHeadType(NoteHead::Type);
@ -397,7 +399,7 @@ class Note : public Element {
bool mark() const { return _mark; }
void setMark(bool v) const { _mark = v; }
virtual void setScore(Score* s);
void setDotY(Direction);
void setDotY(MScore::Direction);
static SymId noteHead(int direction, NoteHead::Group, NoteHead::Type);
};

View file

@ -260,22 +260,22 @@ QVariant getProperty(P_ID id, XmlReader& e)
{
QString value(e.readElementText());
if (value == "up")
return QVariant(int(Direction::UP));
return QVariant(int(MScore::Direction::UP));
else if (value == "down")
return QVariant(int(Direction::DOWN));
return QVariant(int(MScore::Direction::DOWN));
else if (value == "auto")
return QVariant(int(Direction::AUTO));
return QVariant(int(MScore::Direction::AUTO));
}
break;
case P_TYPE::DIRECTION_H:
{
QString value(e.readElementText());
if (value == "left" || value == "1")
return QVariant(int(DirectionH::DH_LEFT));
return QVariant(int(MScore::DirectionH::LEFT));
else if (value == "right" || value == "2")
return QVariant(int(DirectionH::DH_RIGHT));
return QVariant(int(MScore::DirectionH::RIGHT));
else if (value == "auto")
return QVariant(int(DirectionH::DH_AUTO));
return QVariant(int(MScore::DirectionH::AUTO));
}
break;
case P_TYPE::LAYOUT_BREAK: {

View file

@ -214,8 +214,8 @@ enum class P_TYPE : char {
STRING,
SCALE,
COLOR,
DIRECTION, // enum class Direction
DIRECTION_H, // enum class DirectionH
DIRECTION, // enum class MScore::Direction
DIRECTION_H, // enum class MScore::DirectionH
LAYOUT_BREAK,
VALUE_TYPE,
BEAM_MODE,

View file

@ -218,9 +218,9 @@ Element* Rest::drop(const DropData& data)
case Element::Type::CHORD:
{
Chord* c = static_cast<Chord*>(e);
Note* n = c->upNote();
Direction dir = c->stemDirection();
Chord* c = static_cast<Chord*>(e);
Note* n = c->upNote();
MScore::Direction dir = c->stemDirection();
// score()->select(0, SelectType::SINGLE, 0);
NoteVal nval;
nval.pitch = n->pitch();

View file

@ -392,8 +392,8 @@ class Score : public QObject {
void cmdExchangeVoice(int, int);
void removeChordRest(ChordRest* cr, bool clearSegment);
void cmdMoveRest(Rest*, Direction);
void cmdMoveLyrics(Lyrics*, Direction);
void cmdMoveRest(Rest*, MScore::Direction);
void cmdMoveLyrics(Lyrics*, MScore::Direction);
void cmdHalfDuration();
void cmdDoubleDuration();
@ -520,7 +520,7 @@ class Score : public QObject {
void undoChangeBracketSpan(Staff* staff, int column, int span);
void undoChangeTuning(Note*, qreal);
void undoChangePageFormat(PageFormat*, qreal spatium, int);
void undoChangeUserMirror(Note*, DirectionH);
void undoChangeUserMirror(Note*, MScore::DirectionH);
void undoChangeKeySig(Staff* ostaff, int tick, Key);
void undoChangeClef(Staff* ostaff, Segment*, ClefType st);
void undoChangeBarLine(Measure* m, BarLineType);
@ -535,7 +535,7 @@ class Score : public QObject {
void setGraceNote(Chord*, int pitch, NoteType type, int len);
Segment* setNoteRest(Segment*, int track, NoteVal nval, Fraction, Direction stemDirection = Direction::AUTO);
Segment* setNoteRest(Segment*, int track, NoteVal nval, Fraction, MScore::Direction stemDirection = MScore::Direction::AUTO);
void changeCRlen(ChordRest* cr, const TDuration&);
Fraction makeGap(Segment*, int track, const Fraction&, Tuplet*, bool keepChord = false);

View file

@ -145,7 +145,7 @@ bool SlurSegment::edit(MuseScoreView* viewer, int curGrip, int key, Qt::Keyboard
Slur* sl = static_cast<Slur*>(slurTie());
if (key == Qt::Key_X) {
sl->setSlurDirection(sl->up() ? Direction::DOWN : Direction::UP);
sl->setSlurDirection(sl->up() ? MScore::Direction::DOWN : MScore::Direction::UP);
sl->layout();
return true;
}
@ -635,7 +635,7 @@ bool SlurSegment::isEdited() const
SlurTie::SlurTie(Score* s)
: Spanner(s)
{
_slurDirection = Direction::AUTO;
_slurDirection = MScore::Direction::AUTO;
_up = true;
_lineType = 0; // default is solid
}
@ -956,7 +956,7 @@ void SlurTie::writeProperties(Xml& xml) const
int idx = 0;
foreach(const SpannerSegment* ss, spannerSegments())
((SlurSegment*)ss)->write(xml, idx++);
if (_slurDirection != Direction::AUTO)
if (_slurDirection != MScore::Direction::AUTO)
xml.tag("up", int(_slurDirection));
if (_lineType)
xml.tag("lineType", _lineType);
@ -980,7 +980,7 @@ bool SlurTie::readProperties(XmlReader& e)
add(segment);
}
else if (tag == "up")
_slurDirection = Direction(e.readInt());
_slurDirection = MScore::Direction(e.readInt());
else if (tag == "lineType")
_lineType = e.readInt();
else if (!Element::readProperties(e))
@ -1001,7 +1001,7 @@ void SlurTie::undoSetLineType(int t)
// undoSetSlurDirection
//---------------------------------------------------------
void SlurTie::undoSetSlurDirection(Direction d)
void SlurTie::undoSetSlurDirection(MScore::Direction d)
{
score()->undoChangeProperty(this, P_ID::SLUR_DIRECTION, int(d));
}
@ -1037,7 +1037,7 @@ bool SlurTie::setProperty(P_ID propertyId, const QVariant& v)
{
switch(propertyId) {
case P_ID::LINE_TYPE: setLineType(v.toInt()); break;
case P_ID::SLUR_DIRECTION: setSlurDirection(Direction(v.toInt())); break;
case P_ID::SLUR_DIRECTION: setSlurDirection(MScore::Direction(v.toInt())); break;
default:
return Spanner::setProperty(propertyId, v);
}
@ -1054,7 +1054,7 @@ QVariant SlurTie::propertyDefault(P_ID id) const
case P_ID::LINE_TYPE:
return 0;
case P_ID::SLUR_DIRECTION:
return int(Direction::AUTO);
return int(MScore::Direction::AUTO);
default:
return Spanner::propertyDefault(id);
}
@ -1258,13 +1258,13 @@ void Slur::layout()
return;
}
switch (_slurDirection) {
case Direction::UP:
case MScore::Direction::UP:
_up = true;
break;
case Direction::DOWN:
case MScore::Direction::DOWN:
_up = false;
break;
case Direction::AUTO:
case MScore::Direction::AUTO:
{
//
// assumption:
@ -1457,10 +1457,10 @@ void Slur::layoutChord()
Note* startNote = c1->upNote();
// Note* endNote = c2->upNote();
if (_slurDirection == Direction::AUTO)
if (_slurDirection == MScore::Direction::AUTO)
_up = false;
else
_up = _slurDirection == Direction::UP ? true : false;
_up = _slurDirection == MScore::Direction::UP ? true : false;
qreal w = startNote->headWidth();
qreal xo1 = w * 1.12;

View file

@ -119,14 +119,15 @@ class SlurSegment : public SpannerSegment {
//-------------------------------------------------------------------
// @@ SlurTie
// @P lineType int (0 - solid, 1 - dotted, 2 - dashed)
// @P slurDirection Ms::Direction (AUTO, UP, DOWN)
// @P lineType int (0 - solid, 1 - dotted, 2 - dashed)
// @P slurDirection Ms::MScore::Direction (AUTO, UP, DOWN)
//-------------------------------------------------------------------
class SlurTie : public Spanner {
Q_OBJECT
Q_PROPERTY(int lineType READ lineType WRITE undoSetLineType)
Q_PROPERTY(Ms::Direction slurDirection READ slurDirection WRITE undoSetSlurDirection)
Q_PROPERTY(int lineType READ lineType WRITE undoSetLineType)
Q_PROPERTY(Ms::MScore::Direction slurDirection READ slurDirection WRITE undoSetSlurDirection)
Q_ENUMS(Ms::MScore::Direction)
int _lineType; // 0 = solid, 1 = dotted, 2 = dashed
@ -134,7 +135,7 @@ class SlurTie : public Spanner {
bool _up; // actual direction
QQueue<SlurSegment*> delSegments; // "deleted" segments
Direction _slurDirection;
MScore::Direction _slurDirection;
qreal firstNoteRestSegmentX(System* system);
void fixupSegments(unsigned nsegs);
@ -144,14 +145,14 @@ class SlurTie : public Spanner {
~SlurTie();
virtual Element::Type type() const = 0;
bool up() const { return _up; }
bool up() const { return _up; }
Direction slurDirection() const { return _slurDirection; }
void setSlurDirection(Direction d) { _slurDirection = d; }
void undoSetSlurDirection(Direction d);
MScore::Direction slurDirection() const { return _slurDirection; }
void setSlurDirection(MScore::Direction d) { _slurDirection = d; }
void undoSetSlurDirection(MScore::Direction d);
virtual void layout2(const QPointF, int, struct UP&) {}
virtual bool contains(const QPointF&) const { return false; } // not selectable
virtual bool contains(const QPointF&) const { return false; } // not selectable
void writeProperties(Xml& xml) const;
bool readProperties(XmlReader&);

View file

@ -1450,7 +1450,7 @@ void MStyle::set(StyleIdx t, int val)
set(t, QVariant(val));
}
void MStyle::set(StyleIdx t, Direction val)
void MStyle::set(StyleIdx t, MScore::Direction val)
{
set(t, QVariant(int(val)));
}

View file

@ -387,7 +387,7 @@ class MStyle {
void set(StyleIdx t, bool val);
void set(StyleIdx t, qreal val);
void set(StyleIdx t, int val);
void set(StyleIdx t, Direction val);
void set(StyleIdx t, MScore::Direction val);
void set(StyleIdx t, const QVariant& v);
QVariant value(StyleIdx idx) const;

View file

@ -267,7 +267,7 @@ void Tie::calculateDirection()
Measure* m1 = c1->measure();
Measure* m2 = c2->measure();
if (_slurDirection == Direction::AUTO) {
if (_slurDirection == MScore::Direction::AUTO) {
QList<Note*> notes = c1->notes();
int n = notes.size();
if (m1->mstaff(c1->staffIdx())->hasVoices || m2->mstaff(c2->staffIdx())->hasVoices) {
@ -311,7 +311,7 @@ void Tie::calculateDirection()
}
}
else
_up = _slurDirection == Direction::UP ? true : false;
_up = _slurDirection == MScore::Direction::UP ? true : false;
}
//---------------------------------------------------------
@ -331,7 +331,7 @@ void Tie::layout()
return;
}
Chord* c1 = startNote()->chord();
if (_slurDirection == Direction::AUTO) {
if (_slurDirection == MScore::Direction::AUTO) {
if (c1->measure()->mstaff(c1->staffIdx())->hasVoices) {
// in polyphonic passage, ties go on the stem side
_up = c1->up();
@ -340,7 +340,7 @@ void Tie::layout()
_up = !c1->up();
}
else
_up = _slurDirection == Direction::UP ? true : false;
_up = _slurDirection == MScore::Direction::UP ? true : false;
fixupSegments(1);
SlurSegment* segment = segmentAt(0);
segment->setSpannerSegmentType(SpannerSegmentType::SINGLE);

View file

@ -39,7 +39,7 @@ Tuplet::Tuplet(Score* s)
_number = 0;
_hasBracket = false;
_isUp = true;
_direction = Direction::AUTO;
_direction = MScore::Direction::AUTO;
}
Tuplet::Tuplet(const Tuplet& t)
@ -141,13 +141,13 @@ void Tuplet::layout()
//
// find out main direction
//
if (_direction == Direction::AUTO) {
if (_direction == MScore::Direction::AUTO) {
int up = 1;
foreach (const DurationElement* e, _elements) {
if (e->type() == Element::Type::CHORD) {
const Chord* c = static_cast<const Chord*>(e);
if (c->stemDirection() != Direction::AUTO)
up += c->stemDirection() == Direction::UP ? 1000 : -1000;
if (c->stemDirection() != MScore::Direction::AUTO)
up += c->stemDirection() == MScore::Direction::UP ? 1000 : -1000;
else
up += c->up() ? 1 : -1;
}
@ -158,7 +158,7 @@ void Tuplet::layout()
_isUp = up > 0;
}
else
_isUp = _direction == Direction::UP;
_isUp = _direction == MScore::Direction::UP;
const DurationElement* cr1 = _elements.front();
while (cr1->type() == Element::Type::TUPLET) {
@ -886,7 +886,7 @@ bool Tuplet::setProperty(P_ID propertyId, const QVariant& v)
score()->addRefresh(canvasBoundingRect());
switch(propertyId) {
case P_ID::DIRECTION:
setDirection(Direction(v.toInt()));
setDirection(MScore::Direction(v.toInt()));
break;
case P_ID::NUMBER_TYPE:
setNumberType(NumberType(v.toInt()));
@ -922,7 +922,7 @@ QVariant Tuplet::propertyDefault(P_ID id) const
{
switch(id) {
case P_ID::DIRECTION:
return int(Direction::AUTO);
return int(MScore::Direction::AUTO);
case P_ID::NUMBER_TYPE:
return int(Tuplet::NumberType::SHOW_NUMBER);
case P_ID::BRACKET_TYPE:

View file

@ -51,7 +51,7 @@ class Tuplet : public DurationElement {
Fraction _ratio;
TDuration _baseLen; // 1/8 for a triplet of 1/8
Direction _direction;
MScore::Direction _direction;
bool _isUp;
QPointF p1, p2;
@ -110,8 +110,8 @@ class Tuplet : public DurationElement {
virtual void dump() const;
void setDirection(Direction d) { _direction = d; }
Direction direction() const { return _direction; }
void setDirection(MScore::Direction d) { _direction = d; }
MScore::Direction direction() const { return _direction; }
bool isUp() const { return _isUp; }
virtual int tick() const { return _tick; }
void setTick(int val) { _tick = val; }

View file

@ -1232,7 +1232,7 @@ void Score::undoChangeTuning(Note* n, qreal v)
undoChangeProperty(n, P_ID::TUNING, v);
}
void Score::undoChangeUserMirror(Note* n, DirectionH d)
void Score::undoChangeUserMirror(Note* n, MScore::DirectionH d)
{
undoChangeProperty(n, P_ID::MIRROR_HEAD, int(d));
}

View file

@ -410,26 +410,26 @@ void Xml::tag(P_ID id, QVariant data, QVariant defaultData)
break;
case P_TYPE::DIRECTION:
switch(Direction(data.toInt())) {
case Direction::UP:
switch(MScore::Direction(data.toInt())) {
case MScore::Direction::UP:
tag(name, QVariant("up"));
break;
case Direction::DOWN:
case MScore::Direction::DOWN:
tag(name, QVariant("down"));
break;
case Direction::AUTO:
case MScore::Direction::AUTO:
break;
}
break;
case P_TYPE::DIRECTION_H:
switch(DirectionH(data.toInt())) {
case DirectionH::DH_LEFT:
switch(MScore::DirectionH(data.toInt())) {
case MScore::DirectionH::LEFT:
tag(name, QVariant("left"));
break;
case DirectionH::DH_RIGHT:
case MScore::DirectionH::RIGHT:
tag(name, QVariant("right"));
break;
case DirectionH::DH_AUTO:
case MScore::DirectionH::AUTO:
break;
}
break;

View file

@ -447,10 +447,10 @@ static int readCapVoice(Score* score, CapVoice* cvoice, int staffIdx, int tick,
chord->setTrack(track);
switch (o->stemDir) {
case ChordObj::DOWN:
chord->setStemDirection(Direction::DOWN);
chord->setStemDirection(MScore::Direction::DOWN);
break;
case ChordObj::UP:
chord->setStemDirection(Direction::UP);
chord->setStemDirection(MScore::Direction::UP);
break;
case ChordObj::NONE:
chord->setNoStem(true);

View file

@ -1073,7 +1073,7 @@ void ChordDebug::beamModeChanged(int n)
void ChordDebug::directionChanged(int val)
{
((Chord*)element())->setStemDirection(Direction(val));
((Chord*)element())->setStemDirection(MScore::Direction(val));
}
//---------------------------------------------------------

View file

@ -102,10 +102,10 @@ void DrumTools::updateDrumset()
int line = drumset->line(pitch);
NoteHead::Group noteHead = drumset->noteHead(pitch);
int voice = drumset->voice(pitch);
Direction dir = drumset->stemDirection(pitch);
if (dir == Direction::UP)
MScore::Direction dir = drumset->stemDirection(pitch);
if (dir == MScore::Direction::UP)
up = true;
else if (dir == Direction::DOWN)
else if (dir == MScore::Direction::DOWN)
up = false;
else
up = line > 4;

View file

@ -223,7 +223,7 @@ void EditDrumset::itemChanged(QTreeWidgetItem* current, QTreeWidgetItem* previou
nDrumset.drum(pitch).shortcut = 0;
else
nDrumset.drum(pitch).shortcut = "ABCDEFG"[shortcut->currentIndex()];
nDrumset.drum(pitch).stemDirection = Direction(stemDirection->currentIndex());
nDrumset.drum(pitch).stemDirection = MScore::Direction(stemDirection->currentIndex());
previous->setText(Column::NAME, qApp->translate("drumset", qPrintable(nDrumset.name(pitch))));
}
if (current == 0)
@ -270,7 +270,7 @@ void EditDrumset::valueChanged()
nDrumset.drum(pitch).notehead = NoteHead::Group(noteHead->currentIndex() - 1);
nDrumset.drum(pitch).line = staffLine->value();
nDrumset.drum(pitch).voice = voice->currentIndex();
nDrumset.drum(pitch).stemDirection = Direction(stemDirection->currentIndex());
nDrumset.drum(pitch).stemDirection = MScore::Direction(stemDirection->currentIndex());
if (QString(QChar(nDrumset.drum(pitch).shortcut)) != shortcut->currentText()) {
if (shortcut->currentText().isEmpty())
nDrumset.drum(pitch).shortcut = 0;
@ -294,11 +294,11 @@ void EditDrumset::updateExample()
int line = nDrumset.line(pitch);
NoteHead::Group noteHead = nDrumset.noteHead(pitch);
int voice = nDrumset.voice(pitch);
Direction dir = nDrumset.stemDirection(pitch);
MScore::Direction dir = nDrumset.stemDirection(pitch);
bool up;
if (dir == Direction::UP)
if (dir == MScore::Direction::UP)
up = true;
else if (dir == Direction::DOWN)
else if (dir == MScore::Direction::DOWN)
up = false;
else
up = line > 4;

View file

@ -473,7 +473,7 @@ void SlurHandler::doSlurStart(Chord* chord, Notations& notations, Xml& xml, bool
slur[i] = 0;
started[i] = false;
notations.tag(xml);
xml.tagE(QString("slur%1 type=\"stop\"%2 number=\"%3\"").arg(rest).arg(s->slurDirection() == Direction::UP ? " placement=\"above\"" : "").arg(i + 1));
xml.tagE(QString("slur%1 type=\"stop\"%2 number=\"%3\"").arg(rest).arg(s->slurDirection() == MScore::Direction::UP ? " placement=\"above\"" : "").arg(i + 1));
}
}
}
@ -497,7 +497,7 @@ void SlurHandler::doSlurStart(Chord* chord, Notations& notations, Xml& xml, bool
slur[i] = 0;
started[i] = false;
notations.tag(xml);
xml.tagE(QString("slur%1 type=\"start\"%2 number=\"%3\"").arg(rest).arg(s->slurDirection() == Direction::UP ? " placement=\"above\"" : "").arg(i + 1));
xml.tagE(QString("slur%1 type=\"start\"%2 number=\"%3\"").arg(rest).arg(s->slurDirection() == MScore::Direction::UP ? " placement=\"above\"" : "").arg(i + 1));
}
else {
// find free slot to store it

View file

@ -368,7 +368,7 @@ void MsScWriter::note(const QString pitch, const QVector<Bww::BeamType> beamList
if (triplet != ST_NONE) ticks = 2 * ticks / 3;
Ms::Beam::Mode bm = (beamList.at(0) == Bww::BM_BEGIN) ? Ms::Beam::Mode::BEGIN : Ms::Beam::Mode::AUTO;
Ms::Direction sd = Ms::Direction::AUTO;
Ms::MScore::Direction sd = Ms::MScore::Direction::AUTO;
// create chord
Ms::Chord* cr = new Ms::Chord(score);
@ -378,13 +378,13 @@ void MsScWriter::note(const QString pitch, const QVector<Bww::BeamType> beamList
if (grace) {
cr->setNoteType(Ms::NoteType::GRACE32);
cr->setDurationType(Ms::TDuration::DurationType::V_32ND);
sd = Ms::Direction::UP;
sd = Ms::MScore::Direction::UP;
}
else {
if (durationType.type() == Ms::TDuration::DurationType::V_INVALID)
durationType.setType(Ms::TDuration::DurationType::V_QUARTER);
cr->setDurationType(durationType);
sd = Ms::Direction::DOWN;
sd = Ms::MScore::Direction::DOWN;
}
cr->setDuration(durationType.fraction());
cr->setDots(dots);

View file

@ -2908,9 +2908,9 @@ int GuitarPro5::readBeat(int tick, int voice, Measure* measure, int staffIdx, Tu
Chord* chord = static_cast<Chord*>(cr);
applyBeatEffects(chord, beatEffects);
if (rr == 0x2)
chord->setStemDirection(Direction::DOWN);
chord->setStemDirection(MScore::Direction::DOWN);
else if (rr == 0xa)
chord->setStemDirection(Direction::UP);
chord->setStemDirection(MScore::Direction::UP);
else {
; // qDebug(" 1beat read 0x%02x", rr);
}

View file

@ -395,7 +395,7 @@ void setMusicNotesFromMidi(Score *score,
if (!drumset->isValid(mn.pitch))
qDebug("unmapped drum note 0x%02x %d", mn.pitch, mn.pitch);
else {
Direction sd = drumset->stemDirection(mn.pitch);
MScore::Direction sd = drumset->stemDirection(mn.pitch);
chord->setStemDirection(sd);
}
}

View file

@ -1508,7 +1508,7 @@ void OveToMScore::convertNotes(Measure* measure, int part, int staff, int track)
cr->setVisible(oveNote->getShow());
((Ms::Chord*) cr)->setNoStem((int) container->getNoteType() <= OVE::Note_Whole);
if(!setDirection)
((Ms::Chord*) cr)->setStemDirection(container->getStemUp() ? Direction::UP : Direction::DOWN);
((Ms::Chord*) cr)->setStemDirection(container->getStemUp() ? MScore::Direction::UP : MScore::Direction::DOWN);
// cross staff
int staffMove = 0;
@ -1575,7 +1575,7 @@ void OveToMScore::convertNotes(Measure* measure, int part, int staff, int track)
const OVE::Tuplet* oveTuplet = getTuplet(tuplets, container->start()->getOffset());
if (oveTuplet != 0) {
//set direction
tuplet->setDirection(oveTuplet->getLeftShoulder()->getYOffset() < 0 ? Direction::UP : Direction::DOWN);
tuplet->setDirection(oveTuplet->getLeftShoulder()->getYOffset() < 0 ? MScore::Direction::UP : MScore::Direction::DOWN);
if(container->start()->getOffset() == oveTuplet->stop()->getOffset()){
tuplet = 0;
@ -2157,7 +2157,7 @@ void OveToMScore::convertSlurs(Measure* measure, int part, int staff, int track)
int absEndTick = mtt_->getTick(slurPtr->start()->getMeasure()+slurPtr->stop()->getMeasure(), endContainer->getTick());
Slur* slur = new Slur(score_);
slur->setSlurDirection(slurPtr->getShowOnTop()? Direction::UP : Direction::DOWN);
slur->setSlurDirection(slurPtr->getShowOnTop()? MScore::Direction::UP : MScore::Direction::DOWN);
slur->setTick(absStartTick);
slur->setTick2(absEndTick);
slur->setTrack(track);

View file

@ -1926,7 +1926,7 @@ static void removeBeam(Beam*& beam)
// handleBeamAndStemDir
//---------------------------------------------------------
static void handleBeamAndStemDir(ChordRest* cr, const Beam::Mode bm, const Direction sd, Beam*& beam)
static void handleBeamAndStemDir(ChordRest* cr, const Beam::Mode bm, const MScore::Direction sd, Beam*& beam)
{
if (!cr) return;
// create a new beam
@ -4166,9 +4166,9 @@ void MusicXml::xmlNotations(Note* note, ChordRest* cr, int trk, int ticks, QDomE
endSlur = true;
QString pl = ee.attribute(QString("placement"));
if (pl == "above")
slur[slurNo]->setSlurDirection(Direction::UP);
slur[slurNo]->setSlurDirection(MScore::Direction::UP);
else if (pl == "below")
slur[slurNo]->setSlurDirection(Direction::DOWN);
slur[slurNo]->setSlurDirection(MScore::Direction::DOWN);
//slur[slurNo]->setStart(tick, trk + voice);
//slur[slurNo]->setTrack((staff + relStaff) * VOICES);
slur[slurNo]->setTrack(track);
@ -4222,9 +4222,9 @@ void MusicXml::xmlNotations(Note* note, ChordRest* cr, int trk, int ticks, QDomE
tie->setTrack(track);
QString tiedOrientation = ee.attribute("orientation", "auto");
if (tiedOrientation == "over")
tie->setSlurDirection(Direction::UP);
tie->setSlurDirection(MScore::Direction::UP);
else if (tiedOrientation == "under")
tie->setSlurDirection(Direction::DOWN);
tie->setSlurDirection(MScore::Direction::DOWN);
else if (tiedOrientation == "auto")
; // ignore
else
@ -4650,7 +4650,7 @@ Note* MusicXml::xmlNote(Measure* measure, int staff, const QString& partId, Beam
bool rest = false;
int relStaff = 0;
Beam::Mode bm = Beam::Mode::NONE;
Direction sd = Direction::AUTO;
MScore::Direction sd = MScore::Direction::AUTO;
bool grace = false;
QString graceSlash;
QString step;
@ -4813,9 +4813,9 @@ Note* MusicXml::xmlNote(Measure* measure, int staff, const QString& partId, Beam
;
else if (tag == "stem") {
if (s == "up")
sd = Direction::UP;
sd = MScore::Direction::UP;
else if (s == "down")
sd = Direction::DOWN;
sd = MScore::Direction::DOWN;
else if (s == "none")
noStem = true;
else if (s == "double")
@ -5139,11 +5139,11 @@ Note* MusicXml::xmlNote(Measure* measure, int staff, const QString& partId, Beam
// the drum palette cannot handle stem direction AUTO,
// overrule if necessary
if (sd == Direction::AUTO) {
if (sd == MScore::Direction::AUTO) {
if (line > 4)
sd = Direction::DOWN;
sd = MScore::Direction::DOWN;
else
sd = Direction::UP;
sd = MScore::Direction::UP;
}
if (drumsets.contains(partId)

View file

@ -204,12 +204,12 @@ void MuseData::readNote(Part* part, const QString& s)
break;
}
}
Direction dir = Direction::AUTO;
MScore::Direction dir = MScore::Direction::AUTO;
if (s.size() >= 23) {
if (s[22] == 'u')
dir = Direction::UP;
dir = MScore::Direction::UP;
else if (s[22] == 'd')
dir = Direction::DOWN;
dir = MScore::Direction::DOWN;
}
int staffIdx = 0;

View file

@ -130,15 +130,15 @@ struct MusicXMLDrumInstrument {
QString name;
NoteHead::Group notehead; ///< notehead symbol set
int line; ///< place notehead onto this line
Direction stemDirection;
MScore::Direction stemDirection;
QString toString() const;
MusicXMLDrumInstrument()
: pitch(-1), name(), notehead(NoteHead::Group::HEAD_INVALID), line(0), stemDirection(Direction::AUTO) {}
: pitch(-1), name(), notehead(NoteHead::Group::HEAD_INVALID), line(0), stemDirection(MScore::Direction::AUTO) {}
MusicXMLDrumInstrument(QString s)
: pitch(-1), name(s), notehead(NoteHead::Group::HEAD_INVALID), line(0), stemDirection(Direction::AUTO) {}
MusicXMLDrumInstrument(int p, QString s, NoteHead::Group nh, int l, Direction d)
: pitch(-1), name(s), notehead(NoteHead::Group::HEAD_INVALID), line(0), stemDirection(MScore::Direction::AUTO) {}
MusicXMLDrumInstrument(int p, QString s, NoteHead::Group nh, int l, MScore::Direction d)
: pitch(p), name(s), notehead(nh), line(l), stemDirection(d) {}
};

View file

@ -80,35 +80,35 @@ void TestNote::note()
delete n;
// mirror
note->setUserMirror(DirectionH::DH_LEFT);
note->setUserMirror(MScore::DirectionH::LEFT);
n = static_cast<Note*>(writeReadElement(note));
QCOMPARE(n->userMirror(), DirectionH::DH_LEFT);
QCOMPARE(n->userMirror(), MScore::DirectionH::LEFT);
delete n;
note->setUserMirror(DirectionH::DH_RIGHT);
note->setUserMirror(MScore::DirectionH::RIGHT);
n = static_cast<Note*>(writeReadElement(note));
QCOMPARE(n->userMirror(), DirectionH::DH_RIGHT);
QCOMPARE(n->userMirror(), MScore::DirectionH::RIGHT);
delete n;
note->setUserMirror(DirectionH::DH_AUTO);
note->setUserMirror(MScore::DirectionH::AUTO);
n = static_cast<Note*>(writeReadElement(note));
QCOMPARE(n->userMirror(), DirectionH::DH_AUTO);
QCOMPARE(n->userMirror(), MScore::DirectionH::AUTO);
delete n;
// dot position
note->setUserDotPosition(Direction::UP);
note->setUserDotPosition(MScore::Direction::UP);
n = static_cast<Note*>(writeReadElement(note));
QCOMPARE(n->userDotPosition(), Direction::UP);
QCOMPARE(n->userDotPosition(), MScore::Direction::UP);
delete n;
note->setUserDotPosition(Direction::DOWN);
note->setUserDotPosition(MScore::Direction::DOWN);
n = static_cast<Note*>(writeReadElement(note));
QCOMPARE(n->userDotPosition(), Direction::DOWN);
QCOMPARE(n->userDotPosition(), MScore::Direction::DOWN);
delete n;
note->setUserDotPosition(Direction::AUTO);
note->setUserDotPosition(MScore::Direction::AUTO);
n = static_cast<Note*>(writeReadElement(note));
QCOMPARE(n->userDotPosition(), Direction::AUTO);
QCOMPARE(n->userDotPosition(), MScore::Direction::AUTO);
delete n;
// headGroup
for (int i = 0; i < int (NoteHead::Group::HEAD_GROUPS); ++i) {
@ -201,35 +201,35 @@ void TestNote::note()
delete n;
// mirror
note->setProperty(P_ID::MIRROR_HEAD, int(DirectionH::DH_LEFT));
note->setProperty(P_ID::MIRROR_HEAD, int(MScore::DirectionH::LEFT));
n = static_cast<Note*>(writeReadElement(note));
QCOMPARE(n->userMirror(), DirectionH::DH_LEFT);
QCOMPARE(n->userMirror(), MScore::DirectionH::LEFT);
delete n;
note->setProperty(P_ID::MIRROR_HEAD, int(DirectionH::DH_RIGHT));
note->setProperty(P_ID::MIRROR_HEAD, int(MScore::DirectionH::RIGHT));
n = static_cast<Note*>(writeReadElement(note));
QCOMPARE(n->userMirror(), DirectionH::DH_RIGHT);
QCOMPARE(n->userMirror(), MScore::DirectionH::RIGHT);
delete n;
note->setProperty(P_ID::MIRROR_HEAD, int(DirectionH::DH_AUTO));
note->setProperty(P_ID::MIRROR_HEAD, int(MScore::DirectionH::AUTO));
n = static_cast<Note*>(writeReadElement(note));
QCOMPARE(n->userMirror(), DirectionH::DH_AUTO);
QCOMPARE(n->userMirror(), MScore::DirectionH::AUTO);
delete n;
// dot position
note->setProperty(P_ID::DOT_POSITION, int(Direction::UP));
note->setProperty(P_ID::DOT_POSITION, int(MScore::Direction::UP));
n = static_cast<Note*>(writeReadElement(note));
QCOMPARE(n->userDotPosition(), Direction::UP);
QCOMPARE(n->userDotPosition(), MScore::Direction::UP);
delete n;
note->setProperty(P_ID::DOT_POSITION, int(Direction::DOWN));
note->setProperty(P_ID::DOT_POSITION, int(MScore::Direction::DOWN));
n = static_cast<Note*>(writeReadElement(note));
QCOMPARE(n->userDotPosition(), Direction::DOWN);
QCOMPARE(n->userDotPosition(), MScore::Direction::DOWN);
delete n;
note->setProperty(P_ID::DOT_POSITION, int(Direction::AUTO));
note->setProperty(P_ID::DOT_POSITION, int(MScore::Direction::AUTO));
n = static_cast<Note*>(writeReadElement(note));
QCOMPARE(n->userDotPosition(), Direction::AUTO);
QCOMPARE(n->userDotPosition(), MScore::Direction::AUTO);
delete n;
// headGroup