MuseScore/libmscore/pedal.h

81 lines
2.5 KiB
C
Raw Normal View History

2012-05-26 14:26:10 +02:00
//=============================================================================
// MuseScore
// Music Composition & Notation
//
// Copyright (C) 2002-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
//=============================================================================
#ifndef __PEDAL_H__
#define __PEDAL_H__
#include "textline.h"
2013-05-13 18:49:17 +02:00
namespace Ms {
2013-08-09 11:42:24 +02:00
class Pedal;
2012-10-27 14:46:35 +02:00
//---------------------------------------------------------
// @@ PedalSegment
//---------------------------------------------------------
class PedalSegment : public TextLineSegment {
Q_OBJECT
protected:
public:
PedalSegment(Score* s) : TextLineSegment(s) {}
virtual Element::Type type() const override { return Element::Type::PEDAL_SEGMENT; }
2013-08-09 11:42:24 +02:00
virtual PedalSegment* clone() const override { return new PedalSegment(*this); }
2014-05-27 17:09:27 +02:00
Pedal* pedal() const { return (Pedal*)spanner(); }
2013-08-09 11:42:24 +02:00
virtual void layout() override;
virtual bool setProperty(P_ID propertyId, const QVariant&) override;
virtual QVariant propertyDefault(P_ID) const override;
virtual PropertyStyle propertyStyle(P_ID) const override;
virtual void resetProperty(P_ID id) override;
virtual void styleChanged() override;
2014-05-27 17:09:27 +02:00
friend class Pedal;
2012-10-27 14:46:35 +02:00
};
2012-05-26 14:26:10 +02:00
//---------------------------------------------------------
2012-07-25 11:49:34 +02:00
// @@ Pedal
2012-05-26 14:26:10 +02:00
//---------------------------------------------------------
class Pedal : public TextLine {
Q_OBJECT
2013-08-09 11:42:24 +02:00
PropertyStyle lineWidthStyle;
PropertyStyle lineStyleStyle;
2014-05-27 17:09:27 +02:00
protected:
QPointF linePos(Grip, System**) const override;
2014-05-27 17:09:27 +02:00
2012-05-26 14:26:10 +02:00
public:
Pedal(Score* s);
virtual Pedal* clone() const override { return new Pedal(*this); }
virtual Element::Type type() const override { return Element::Type::PEDAL; }
2013-08-09 11:42:24 +02:00
virtual void read(XmlReader&) override;
2012-10-27 14:46:35 +02:00
LineSegment* createLineSegment();
2013-08-09 11:42:24 +02:00
virtual void setYoff(qreal) override;
2013-08-09 11:42:24 +02:00
virtual bool setProperty(P_ID propertyId, const QVariant& val) override;
virtual QVariant propertyDefault(P_ID propertyId) const override;
virtual PropertyStyle propertyStyle(P_ID id) const override;
virtual StyleIdx getPropertyStyle(P_ID) const override;
2013-08-09 11:42:24 +02:00
virtual void resetProperty(P_ID id) override;
2013-08-09 11:42:24 +02:00
virtual void styleChanged() override;
2014-05-27 17:09:27 +02:00
friend class PedalLine;
2012-05-26 14:26:10 +02:00
};
2013-05-13 18:49:17 +02:00
} // namespace Ms
2012-05-26 14:26:10 +02:00
#endif