MuseScore/libmscore/shadownote.h

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

59 lines
1.5 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
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 final : public Element
{
2012-05-26 14:26:10 +02:00
int _line;
SymId _notehead;
TDuration _duration;
int _voice;
bool _rest;
2020-03-27 12:07:27 +01:00
2020-05-26 15:54:26 +02:00
public:
2020-03-27 12:07:27 +01:00
ShadowNote(Score*);
ShadowNote* clone() const override { return new ShadowNote(*this); }
ElementType type() const override { return ElementType::SHADOW_NOTE; }
2020-03-27 12:07:27 +01:00
void layout() override;
int line() const { return _line; }
void setLine(int n) { _line = n; }
void draw(QPainter*) const override;
void setState(SymId noteSymbol, int voice, TDuration duration, bool rest = false);
2012-05-26 14:26:10 +02:00
SymId getNoteFlag() const;
bool computeUp() const;
2013-05-13 18:49:17 +02:00
2020-03-27 12:07:27 +01:00
SymId notehead() const { return _notehead; }
bool isValid() const;
2020-05-26 15:54:26 +02:00
};
2013-05-13 18:49:17 +02:00
} // namespace Ms
2012-05-26 14:26:10 +02:00
#endif