MuseScore/libmscore/tremolobar.h

69 lines
2.3 KiB
C
Raw Normal View History

2012-05-26 14:26:10 +02:00
//=============================================================================
// MuseScore
// Music Composition & Notation
//
// 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
//=============================================================================
#ifndef __TREMOLOBAR_H__
#define __TREMOLOBAR_H__
#include "element.h"
#include "pitchvalue.h"
2013-05-13 18:49:17 +02:00
namespace Ms {
2012-05-26 14:26:10 +02:00
//---------------------------------------------------------
2012-07-25 11:49:34 +02:00
// @@ TremoloBar
//
// @P userMag qreal
2016-09-20 17:13:54 +02:00
// @P lineWidth qreal
// @P play bool play tremolo bar
2012-05-26 14:26:10 +02:00
//---------------------------------------------------------
class TremoloBar final : public Element {
2016-09-20 17:13:54 +02:00
Spatium _lw;
qreal _userMag { 1.0 }; // allowed 0.1 - 10.0
bool _play { true };
2012-05-26 14:26:10 +02:00
QList<PitchValue> _points;
2016-09-20 17:13:54 +02:00
2016-09-20 14:44:43 +02:00
QPolygonF polygon; // computed by layout
2012-05-26 14:26:10 +02:00
public:
TremoloBar(Score* s);
2016-09-20 17:13:54 +02:00
virtual TremoloBar* clone() const override { return new TremoloBar(*this); }
virtual ElementType type() const override { return ElementType::TREMOLOBAR; }
2016-09-20 17:13:54 +02:00
virtual void layout() override;
virtual void draw(QPainter*) const override;
2016-11-19 11:51:21 +01:00
virtual void write(XmlWriter&) const override;
2016-09-20 17:13:54 +02:00
virtual void read(XmlReader& e) override;
2012-05-26 14:26:10 +02:00
QList<PitchValue>& points() { return _points; }
const QList<PitchValue>& points() const { return _points; }
void setPoints(const QList<PitchValue>& p) { _points = p; }
2018-03-27 15:36:00 +02:00
virtual QVariant getProperty(Pid propertyId) const override;
virtual bool setProperty(Pid propertyId, const QVariant&) override;
virtual QVariant propertyDefault(Pid) const override;
2016-09-20 17:13:54 +02:00
qreal userMag() const { return _userMag; }
void setUserMag(qreal m) { _userMag = m; }
void setLineWidth(Spatium v) { _lw = v; }
Spatium lineWidth() const { return _lw; }
2016-09-20 17:13:54 +02:00
bool play() const { return _play; }
void setPlay(bool val) { _play = val; }
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