2012-05-26 14:26:10 +02:00
|
|
|
//=============================================================================
|
|
|
|
// MuseScore
|
|
|
|
// Music Composition & Notation
|
|
|
|
//
|
|
|
|
// Copyright (C) 2008-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 __GLISSANDO_H__
|
|
|
|
#define __GLISSANDO_H__
|
|
|
|
|
|
|
|
#include "element.h"
|
|
|
|
|
2013-05-13 18:49:17 +02:00
|
|
|
namespace Ms {
|
|
|
|
|
2012-05-26 14:26:10 +02:00
|
|
|
class Note;
|
|
|
|
|
2013-02-28 15:06:54 +01:00
|
|
|
//---------------------------------------------------------
|
|
|
|
// GlissandoType
|
|
|
|
//---------------------------------------------------------
|
|
|
|
|
|
|
|
enum class GlissandoType {
|
|
|
|
STRAIGHT, WAVY
|
|
|
|
};
|
|
|
|
|
2012-05-26 14:26:10 +02:00
|
|
|
//---------------------------------------------------------
|
2012-07-25 11:49:34 +02:00
|
|
|
// @@ Glissando
|
2014-05-16 13:44:32 +02:00
|
|
|
// @P glissandoType Ms::GlissandoType (STRAIGHT, WAVY)
|
|
|
|
// @P text QString
|
2014-01-12 12:51:51 +01:00
|
|
|
// @P showText bool
|
2012-05-26 14:26:10 +02:00
|
|
|
//---------------------------------------------------------
|
|
|
|
|
|
|
|
class Glissando : public Element {
|
2012-05-28 11:29:21 +02:00
|
|
|
Q_OBJECT
|
|
|
|
|
2013-03-05 20:23:59 +01:00
|
|
|
Q_PROPERTY(GlissandoType glissandoType READ glissandoType WRITE undoSetGlissandoType)
|
|
|
|
Q_PROPERTY(QString text READ text WRITE undoSetText)
|
|
|
|
Q_PROPERTY(bool showText READ showText WRITE undoSetShowText)
|
2013-02-28 15:06:54 +01:00
|
|
|
|
2013-03-05 20:23:59 +01:00
|
|
|
GlissandoType _glissandoType;
|
2012-05-26 14:26:10 +02:00
|
|
|
QLineF line;
|
|
|
|
QString _text;
|
|
|
|
bool _showText;
|
|
|
|
|
|
|
|
public:
|
|
|
|
Glissando(Score* s);
|
2013-02-28 15:06:54 +01:00
|
|
|
Glissando(const Glissando&);
|
|
|
|
|
2013-03-05 20:23:59 +01:00
|
|
|
virtual Glissando* clone() const { return new Glissando(*this); }
|
|
|
|
virtual ElementType type() const { return GLISSANDO; }
|
|
|
|
GlissandoType glissandoType() const { return _glissandoType; }
|
|
|
|
void setGlissandoType(GlissandoType v) { _glissandoType = v; }
|
2012-05-26 14:26:10 +02:00
|
|
|
virtual Space space() const;
|
|
|
|
|
|
|
|
virtual void draw(QPainter*) const;
|
|
|
|
virtual void layout();
|
|
|
|
virtual void write(Xml&) const;
|
2013-01-11 18:10:18 +01:00
|
|
|
virtual void read(XmlReader&);
|
2012-05-26 14:26:10 +02:00
|
|
|
|
|
|
|
void setSize(const QSizeF&); // used for palette
|
|
|
|
|
|
|
|
QString text() const { return _text; }
|
|
|
|
void setText(const QString& t) { _text = t; }
|
|
|
|
bool showText() const { return _showText; }
|
|
|
|
void setShowText(bool v) { _showText = v; }
|
2013-02-28 15:06:54 +01:00
|
|
|
|
2013-03-05 20:23:59 +01:00
|
|
|
void undoSetGlissandoType(GlissandoType);
|
2013-02-28 15:06:54 +01:00
|
|
|
void undoSetText(const QString&);
|
|
|
|
void undoSetShowText(bool);
|
|
|
|
|
|
|
|
virtual QVariant getProperty(P_ID propertyId) const;
|
|
|
|
virtual bool setProperty(P_ID propertyId, const QVariant&);
|
|
|
|
virtual QVariant propertyDefault(P_ID) const;
|
2012-05-26 14:26:10 +02:00
|
|
|
};
|
|
|
|
|
2013-05-13 18:49:17 +02:00
|
|
|
|
|
|
|
} // namespace Ms
|
2014-05-16 14:17:03 +02:00
|
|
|
|
|
|
|
Q_DECLARE_METATYPE(Ms::GlissandoType);
|
|
|
|
|
2012-05-26 14:26:10 +02:00
|
|
|
#endif
|
|
|
|
|