2012-05-26 14:26:10 +02:00
|
|
|
//=============================================================================
|
|
|
|
// MuseScore
|
|
|
|
// Music Composition & Notation
|
|
|
|
// $Id:$
|
|
|
|
//
|
|
|
|
// Copyright (C) 2010-2011 Werner Schweer
|
|
|
|
//
|
|
|
|
// This program is free software; you can redistribute it and/or modify
|
|
|
|
// it under the terms of the GNU General Public License version 2
|
|
|
|
// as published by the Free Software Foundation and appearing in
|
|
|
|
// the file LICENCE.GPL
|
|
|
|
//=============================================================================
|
|
|
|
|
|
|
|
#include "fingering.h"
|
|
|
|
#include "score.h"
|
|
|
|
#include "undo.h"
|
|
|
|
|
|
|
|
//---------------------------------------------------------
|
|
|
|
// Fingering
|
|
|
|
//---------------------------------------------------------
|
|
|
|
|
|
|
|
Fingering::Fingering(Score* s)
|
|
|
|
: Text(s)
|
|
|
|
{
|
2012-10-25 16:21:07 +02:00
|
|
|
setTextStyleType(TEXT_STYLE_FINGERING);
|
2012-05-26 14:26:10 +02:00
|
|
|
setFlag(ELEMENT_HAS_TAG, true);
|
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------
|
|
|
|
// layout
|
|
|
|
//---------------------------------------------------------
|
|
|
|
|
|
|
|
void Fingering::layout()
|
|
|
|
{
|
|
|
|
Text::layout();
|
2012-09-22 21:23:37 +02:00
|
|
|
setPos(QPointF());
|
2012-05-26 14:26:10 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------
|
|
|
|
// write
|
|
|
|
//---------------------------------------------------------
|
|
|
|
|
|
|
|
void Fingering::write(Xml& xml) const
|
|
|
|
{
|
|
|
|
xml.stag(name());
|
|
|
|
Text::writeProperties(xml);
|
|
|
|
xml.etag();
|
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------
|
|
|
|
// read
|
|
|
|
//---------------------------------------------------------
|
|
|
|
|
|
|
|
void Fingering::read(const QDomElement& de)
|
|
|
|
{
|
|
|
|
for (QDomElement e = de.firstChildElement(); !e.isNull(); e = e.nextSiblingElement()) {
|
|
|
|
if (!Text::readProperties(e))
|
|
|
|
domError(e);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------
|
2012-11-19 10:08:15 +01:00
|
|
|
// reset
|
2012-05-26 14:26:10 +02:00
|
|
|
//---------------------------------------------------------
|
|
|
|
|
2012-11-19 10:08:15 +01:00
|
|
|
void Fingering::reset()
|
2012-05-26 14:26:10 +02:00
|
|
|
{
|
|
|
|
QPointF o(userOff());
|
|
|
|
score()->layoutFingering(this);
|
|
|
|
QPointF no(userOff());
|
|
|
|
setUserOff(o);
|
2012-08-23 17:40:04 +02:00
|
|
|
score()->undoChangeProperty(this, P_USER_OFF, no);
|
2012-05-26 14:26:10 +02:00
|
|
|
}
|
2012-09-22 21:23:37 +02:00
|
|
|
|