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 __ARPEGGIO_H__
|
|
|
|
#define __ARPEGGIO_H__
|
|
|
|
|
|
|
|
#include "element.h"
|
|
|
|
|
|
|
|
class QPainter;
|
|
|
|
|
2013-05-13 18:49:17 +02:00
|
|
|
namespace Ms {
|
|
|
|
|
|
|
|
class Chord;
|
|
|
|
|
2014-05-21 18:52:58 +02:00
|
|
|
enum class ArpeggioType : char {
|
2013-02-27 11:23:30 +01:00
|
|
|
NORMAL, UP, DOWN, BRACKET, UP_STRAIGHT, DOWN_STRAIGHT
|
2012-05-26 14:26:10 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
//---------------------------------------------------------
|
2012-07-25 11:49:34 +02:00
|
|
|
// @@ Arpeggio
|
2012-05-26 14:26:10 +02:00
|
|
|
//---------------------------------------------------------
|
|
|
|
|
|
|
|
class Arpeggio : public Element {
|
2012-05-28 11:29:21 +02:00
|
|
|
Q_OBJECT
|
|
|
|
|
2013-03-05 20:23:59 +01:00
|
|
|
ArpeggioType _arpeggioType;
|
2013-02-27 11:10:57 +01:00
|
|
|
qreal _userLen1;
|
|
|
|
qreal _userLen2;
|
2012-05-26 14:26:10 +02:00
|
|
|
qreal _height;
|
|
|
|
int _span; // spanning staves
|
2015-05-05 18:46:13 +02:00
|
|
|
QList<SymId> symbols;
|
2013-11-19 12:12:07 +01:00
|
|
|
|
|
|
|
void symbolLine(SymId start, SymId fill);
|
|
|
|
void symbolLine2(SymId end, SymId fill);
|
2012-05-26 14:26:10 +02:00
|
|
|
|
2015-01-19 12:37:17 +01:00
|
|
|
virtual void spatiumChanged(qreal /*oldValue*/, qreal /*newValue*/) override;
|
|
|
|
virtual QLineF dragAnchor() const override;
|
|
|
|
virtual QPointF gripAnchor(Grip) const override;
|
|
|
|
virtual void startEdit(MuseScoreView*, const QPointF&) override;
|
2012-05-26 14:26:10 +02:00
|
|
|
|
|
|
|
public:
|
|
|
|
Arpeggio(Score* s);
|
2015-01-19 12:37:17 +01:00
|
|
|
virtual Arpeggio* clone() const override { return new Arpeggio(*this); }
|
|
|
|
virtual Element::Type type() const override { return Element::Type::ARPEGGIO; }
|
|
|
|
|
2013-03-05 20:23:59 +01:00
|
|
|
ArpeggioType arpeggioType() const { return _arpeggioType; }
|
|
|
|
void setArpeggioType(ArpeggioType v) { _arpeggioType = v; }
|
2012-05-26 14:26:10 +02:00
|
|
|
|
2013-03-05 20:23:59 +01:00
|
|
|
Chord* chord() const { return (Chord*)parent(); }
|
2015-01-19 12:37:17 +01:00
|
|
|
|
2014-08-13 21:01:21 +02:00
|
|
|
virtual bool acceptDrop(const DropData&) const override;
|
2015-01-19 12:37:17 +01:00
|
|
|
virtual Element* drop(const DropData&) override;
|
|
|
|
virtual void layout() override;
|
|
|
|
virtual void draw(QPainter*) const override;
|
|
|
|
virtual bool isEditable() const override { return true; }
|
|
|
|
virtual void editDrag(const EditData&) override;
|
|
|
|
virtual void updateGrips(Grip*, QVector<QRectF>&) const override;
|
|
|
|
virtual int grips() const override { return 2; }
|
|
|
|
virtual bool edit(MuseScoreView*, Grip, int key, Qt::KeyboardModifiers, const QString&) override;
|
|
|
|
|
|
|
|
virtual void read(XmlReader& e) override;
|
|
|
|
virtual void write(Xml& xml) const override;
|
|
|
|
|
2012-05-26 14:26:10 +02:00
|
|
|
int span() const { return _span; }
|
|
|
|
void setSpan(int val) { _span = val; }
|
|
|
|
void setHeight(qreal);
|
2013-02-27 11:10:57 +01:00
|
|
|
|
|
|
|
qreal userLen1() const { return _userLen1; }
|
|
|
|
qreal userLen2() const { return _userLen2; }
|
|
|
|
void setUserLen1(qreal v) { _userLen1 = v; }
|
|
|
|
void setUserLen2(qreal v) { _userLen2 = v; }
|
|
|
|
|
2015-01-19 12:37:17 +01:00
|
|
|
virtual QVariant getProperty(P_ID propertyId) const override;
|
|
|
|
virtual bool setProperty(P_ID propertyId, const QVariant&) override;
|
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
|
|
|
|
|