Canorus  0.0
drawablenote.h
Go to the documentation of this file.
1 
8 #ifndef DRAWABLENOTE_H_
9 #define DRAWABLENOTE_H_
10 
12 #include "score/note.h"
13 
14 class CANote;
16 
18  public:
19  CADrawableNote(CANote *note, CADrawableContext *drawableContext, double x, double y, bool shadowNote = false, CADrawableAccidental* acc=0);
20 
22 
23  void draw(QPainter *p, CADrawSettings s);
24 
25  inline CANote* note() { return static_cast<CANote*>(_musElement); }
26 
27  CADrawableNote *clone(CADrawableContext* newContext = 0);
28 
29  void setDrawLedgerLines(bool ledgerLines) { _drawLedgerLines = ledgerLines; }
30  bool drawLedgerLines() { return _drawLedgerLines; }
31 
34 
35  private:
37  bool _shadowNote;
40  double _stemLength;
42  double _penWidth; // pen width for stem
43  QString _noteHeadGlyphName; // Feta glyph name for the notehead symbol.
44  QString _flagUpGlyphName; // likewise for stem flags
46  static const double HUNDREDTWENTYEIGHTH_STEM_LENGTH;
47  static const double SIXTYFOURTH_STEM_LENGTH;
48  static const double THIRTYSECOND_STEM_LENGTH;
49  static const double SIXTEENTH_STEM_LENGTH;
50  static const double EIGHTH_STEM_LENGTH;
51  static const double QUARTER_STEM_LENGTH;
52  static const double HALF_STEM_LENGTH;
53  static const double QUARTER_YPOS_DELTA;
54  static const double HALF_YPOS_DELTA;
55 };
56 
57 #endif /* DRAWABLENOTE_H_ */
CADrawableNote::SIXTYFOURTH_STEM_LENGTH
static const double SIXTYFOURTH_STEM_LENGTH
Definition: drawablenote.h:47
CADrawSettings::x
int x
Definition: drawable.h:18
CADrawableNote::HALF_YPOS_DELTA
static const double HALF_YPOS_DELTA
Definition: drawablenote.h:54
CADrawableMusElement
Definition: drawablemuselement.h:16
CADrawableNote::SIXTEENTH_STEM_LENGTH
static const double SIXTEENTH_STEM_LENGTH
Definition: drawablenote.h:49
CADrawableNote::CADrawableNote
CADrawableNote(CANote *note, CADrawableContext *drawableContext, double x, double y, bool shadowNote=false, CADrawableAccidental *acc=0)
Definition: drawablenote.cpp:34
CANote::notePosition
int notePosition()
Definition: note.cpp:102
CADrawableMusElement::_drawableMusElementType
CADrawableMusElementType _drawableMusElementType
Definition: drawablemuselement.h:46
note.h
CAPlayableLength::Sixteenth
@ Sixteenth
Definition: playablelength.h:25
CADrawableNote::_drawLedgerLines
bool _drawLedgerLines
Definition: drawablenote.h:36
drawableaccidental.h
CANote
Represents a note in the score.
Definition: note.h:18
CADrawableNote::drawableAccidental
CADrawableAccidental * drawableAccidental()
Definition: drawablenote.h:33
CAPlayableLength::Eighth
@ Eighth
Definition: playablelength.h:24
CADrawSettings::worldY
double worldY
Definition: drawable.h:24
CADrawableNote::_noteHeadGlyphName
QString _noteHeadGlyphName
Definition: drawablenote.h:43
CADrawable::xPos
double xPos() const
Definition: drawable.h:55
CAPlayableLength::Breve
@ Breve
Definition: playablelength.h:20
CADrawableNote::_noteHeadWidth
double _noteHeadWidth
Definition: drawablenote.h:41
CADrawable::setWidth
void setWidth(double width)
Definition: drawable.h:73
CADrawableNote::~CADrawableNote
~CADrawableNote()
Definition: drawablenote.cpp:138
CADrawable::setXPos
void setXPos(double xPos)
Definition: drawable.h:71
CADrawableNote::drawLedgerLines
bool drawLedgerLines()
Definition: drawablenote.h:30
CAPlayableLength::SixtyFourth
@ SixtyFourth
Definition: playablelength.h:27
CADrawableNote::HALF_STEM_LENGTH
static const double HALF_STEM_LENGTH
Definition: drawablenote.h:52
CADrawableNote::_flagUpGlyphName
QString _flagUpGlyphName
Definition: drawablenote.h:44
CADrawSettings
Definition: drawable.h:16
CADrawableMusElement::_drawableContext
CADrawableContext * _drawableContext
Definition: drawablemuselement.h:47
CANote::StemUp
@ StemUp
Definition: note.h:23
CADrawableContext::DrawableStaff
@ DrawableStaff
Definition: drawablecontext.h:21
CADrawableAccidental
Definition: drawableaccidental.h:13
CADrawableNote::HUNDREDTWENTYEIGHTH_STEM_LENGTH
static const double HUNDREDTWENTYEIGHTH_STEM_LENGTH
Definition: drawablenote.h:46
CADrawableNote::THIRTYSECOND_STEM_LENGTH
static const double THIRTYSECOND_STEM_LENGTH
Definition: drawablenote.h:48
CADrawableStaff
Definition: drawablestaff.h:24
CAPlayableLength::musicLength
const CAMusicLength musicLength()
Definition: playablelength.h:34
CADrawableNote::draw
void draw(QPainter *p, CADrawSettings s)
Definition: drawablenote.cpp:141
CADrawable::setHeight
void setHeight(double height)
Definition: drawable.h:74
CADrawable::yPos
double yPos() const
Definition: drawable.h:56
drawablemuselement.h
CAPlayableLength::Quarter
@ Quarter
Definition: playablelength.h:23
CAPlayableLength::HundredTwentyEighth
@ HundredTwentyEighth
Definition: playablelength.h:28
CAPlayableLength::ThirtySecond
@ ThirtySecond
Definition: playablelength.h:26
CADrawable::setYPos
void setYPos(double yPos)
Definition: drawable.h:72
CADrawable::clone
virtual CADrawable * clone()
Definition: drawable.cpp:23
CADrawableNote::_stemDirection
CANote::CAStemDirection _stemDirection
Definition: drawablenote.h:39
CADrawableNote
Definition: drawablenote.h:17
CADrawableNote::QUARTER_YPOS_DELTA
static const double QUARTER_YPOS_DELTA
Definition: drawablenote.h:53
CADrawableNote::setDrawableAccidental
void setDrawableAccidental(CADrawableAccidental *acc)
Definition: drawablenote.h:32
drawablecontext.h
CADrawableNote::_drawableAcc
CADrawableAccidental * _drawableAcc
Is the current note shadow note?
Definition: drawablenote.h:38
CAPlayableLength::Half
@ Half
Definition: playablelength.h:22
CAPlayableLength::dotted
const int dotted()
Definition: playablelength.h:35
CADrawSettings::color
QColor color
Definition: drawable.h:22
CADrawableMusElement::_musElement
CAMusElement * _musElement
Definition: drawablemuselement.h:48
drawablestaff.h
CADrawableNote::_shadowNote
bool _shadowNote
Are the ledger lines drawn or not. True when ledger lines needed, False when the note is inside the s...
Definition: drawablenote.h:37
CAPlayableLength::Undefined
@ Undefined
Definition: playablelength.h:19
CADrawSettings::y
int y
Definition: drawable.h:19
CADrawable::width
double width() const
Definition: drawable.h:57
CADrawableNote::EIGHTH_STEM_LENGTH
static const double EIGHTH_STEM_LENGTH
Definition: drawablenote.h:50
CADrawable::height
double height() const
Definition: drawable.h:58
CANote::actualStemDirection
CAStemDirection actualStemDirection()
Definition: note.cpp:329
CADrawableContext
Definition: drawablecontext.h:18
canorus.h
CADrawableNote::setDrawLedgerLines
void setDrawLedgerLines(bool ledgerLines)
Definition: drawablenote.h:29
CADrawableNote::_penWidth
double _penWidth
Definition: drawablenote.h:42
CANote::CAStemDirection
CAStemDirection
Direction of the note's stem.
Definition: note.h:20
CADrawableMusElement::drawableContext
CADrawableContext * drawableContext()
Definition: drawablemuselement.h:39
voice.h
CAPlayableLength::Whole
@ Whole
Definition: playablelength.h:21
drawablenote.h
CADrawSettings::z
float z
Definition: drawable.h:17
CADrawableNote::QUARTER_STEM_LENGTH
static const double QUARTER_STEM_LENGTH
Definition: drawablenote.h:51
staff.h
CACanorus::fetaCodepoint
static int fetaCodepoint(const QString &name)
Definition: canorus.cpp:216
CADrawableNote::note
CANote * note()
Definition: drawablenote.h:25
CADrawableNote::_stemLength
double _stemLength
This value is StemUp or StemDown only, no StemPreferred or StemNeutral present. We generate this on C...
Definition: drawablenote.h:40
CADrawableNote::_flagDownGlyphName
QString _flagDownGlyphName
Definition: drawablenote.h:45
CAPlayable::playableLength
CAPlayableLength & playableLength()
Definition: playable.h:23
CADrawableMusElement::DrawableNote
@ DrawableNote
Definition: drawablemuselement.h:19