MuseScore/libmscore/shadownote.h

63 lines
1.6 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 __SHADOWNOTE_H__
#define __SHADOWNOTE_H__
#include "element.h"
#include "durationtype.h"
2012-05-26 14:26:10 +02:00
class QPainter;
2013-05-13 18:49:17 +02:00
namespace Ms {
2012-05-26 14:26:10 +02:00
//---------------------------------------------------------
// ShadowNote
//---------------------------------------------------------
/**
Graphic representation of a shadow note,
which shows the note insert position in note entry mode.
*/
class ShadowNote : public Element {
Q_OBJECT
2012-05-26 14:26:10 +02:00
int _line;
SymId _notehead;
TDuration _duration;
int _voice;
bool _rest;
2012-05-26 14:26:10 +02:00
public:
ShadowNote(Score*);
virtual ShadowNote* clone() const { return new ShadowNote(*this); }
virtual Element::Type type() const { return Element::Type::SHADOW_NOTE; }
2012-05-26 14:26:10 +02:00
virtual void layout();
int line() const { return _line; }
void setLine(int n) { _line = n; }
2012-05-26 14:26:10 +02:00
virtual void draw(QPainter*) const;
void setState(SymId noteSymbol, int voice, TDuration duration, bool rest = false);
SymId getNoteFlag() const;
bool computeUp() const;
SymId notehead() const { return _notehead; }
bool isValid() const;
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