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"
|
2015-10-28 14:11:29 +01:00
|
|
|
#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.
|
|
|
|
*/
|
|
|
|
|
2017-12-21 14:03:45 +01:00
|
|
|
class ShadowNote final : public Element
|
|
|
|
{
|
2012-05-26 14:26:10 +02:00
|
|
|
int _line;
|
2015-10-28 14:11:29 +01:00
|
|
|
SymId _notehead;
|
2016-06-03 00:39:58 +02:00
|
|
|
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); }
|
2014-06-24 18:36:02 +02:00
|
|
|
ElementType type() const override { return ElementType::SHADOW_NOTE; }
|
2020-03-27 12:07:27 +01:00
|
|
|
|
|
|
|
void layout() override;
|
|
|
|
int line() const { return _line; }
|
2014-06-24 18:36:02 +02:00
|
|
|
void setLine(int n) { _line = n; }
|
2015-10-28 14:11:29 +01:00
|
|
|
|
2016-06-03 00:39:58 +02:00
|
|
|
void draw(QPainter*) const override;
|
|
|
|
|
2015-10-28 14:11:29 +01:00
|
|
|
void setState(SymId noteSymbol, int voice, TDuration duration, bool rest = false);
|
2012-05-26 14:26:10 +02:00
|
|
|
|
2016-06-03 00:39:58 +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; }
|
2015-10-28 14:11:29 +01:00
|
|
|
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
|