MuseScore/libmscore/tremolobar.h

72 lines
2.2 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);
2020-03-27 12:07:27 +01:00
TremoloBar* clone() const override { return new TremoloBar(*this); }
ElementType type() const override { return ElementType::TREMOLOBAR; }
void layout() override;
void draw(QPainter*) const override;
void write(XmlWriter&) const override;
void read(XmlReader& e) override;
2016-09-20 17:13:54 +02:00
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; }
2020-03-27 12:07:27 +01:00
QVariant getProperty(Pid propertyId) const override;
bool setProperty(Pid propertyId, const QVariant&) override;
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