|
Canorus
0.7
|
00001 00008 #ifndef DRAWABLENOTE_H_ 00009 #define DRAWABLENOTE_H_ 00010 00011 #include "drawable/drawablemuselement.h" 00012 #include "core/note.h" 00013 00014 class CANote; 00015 class CADrawableAccidental; 00016 00017 class CADrawableNote : public CADrawableMusElement { 00018 public: 00019 CADrawableNote(CANote *note, CADrawableContext *drawableContext, double x, double y, bool shadowNote = false, CADrawableAccidental* acc=0); 00020 00021 ~CADrawableNote(); 00022 00023 void draw(QPainter *p, CADrawSettings s); 00024 00025 inline CANote* note() { return static_cast<CANote*>(_musElement); } 00026 00027 CADrawableNote *clone(CADrawableContext* newContext = 0); 00028 00029 void setDrawLedgerLines(bool ledgerLines) { _drawLedgerLines = ledgerLines; } 00030 bool drawLedgerLines() { return _drawLedgerLines; } 00031 00032 void setDrawableAccidental(CADrawableAccidental *acc) { _drawableAcc = acc; } 00033 CADrawableAccidental *drawableAccidental() { return _drawableAcc; } 00034 00035 private: 00036 bool _drawLedgerLines; 00037 bool _shadowNote; 00038 CADrawableAccidental *_drawableAcc; 00039 CANote::CAStemDirection _stemDirection; 00040 double _stemLength; 00041 double _noteHeadWidth; 00042 double _penWidth; // pen width for stem 00043 QString _noteHeadGlyphName; // Feta glyph name for the notehead symbol. 00044 QString _flagUpGlyphName; // likewise for stem flags 00045 QString _flagDownGlyphName; 00046 static const double HUNDREDTWENTYEIGHTH_STEM_LENGTH; 00047 static const double SIXTYFOURTH_STEM_LENGTH; 00048 static const double THIRTYSECOND_STEM_LENGTH; 00049 static const double SIXTEENTH_STEM_LENGTH; 00050 static const double EIGHTH_STEM_LENGTH; 00051 static const double QUARTER_STEM_LENGTH; 00052 static const double HALF_STEM_LENGTH; 00053 static const double QUARTER_YPOS_DELTA; 00054 static const double HALF_YPOS_DELTA; 00055 }; 00056 00057 #endif /* DRAWABLENOTE_H_ */
1.8.0