CADrawableNote Class Reference

#include <drawablenote.h>

Inheritance diagram for CADrawableNote:

Inheritance graph
[legend]

List of all members.

Public Member Functions

 CADrawableNote (CANote *note, CADrawableContext *drawableContext, int x, int y, bool shadowNote=false, CADrawableAccidental *acc=0)
 ~CADrawableNote ()
void draw (QPainter *p, CADrawSettings s)
CANotenote ()
CADrawableNoteclone (CADrawableContext *newContext=0)
void setDrawLedgerLines (bool ledgerLines)
bool drawLedgerLines ()
void setXPos (int xPos)
void setYPos (int yPos)
void setDrawableAccidental (CADrawableAccidental *acc)
CADrawableAccidentaldrawableAccidental ()

Private Attributes

bool _drawLedgerLines
bool _shadowNote
 Are the ledger lines drawn or not. True when ledger lines needed, False when the note is inside the staff.
CADrawableAccidental_drawableAcc
 Is the current note shadow note?
CANote::CAStemDirection _stemDirection
int _noteHeadWidth
 This value is StemUp or StemDown only, no StemPreferred or StemNeutral present. We generate this on CADrawableNote constructor.

Static Private Attributes

static const int HUNDREDTWENTYEIGHTH_STEM_LENGTH = 43
static const int SIXTYFOURTH_STEM_LENGTH = 43
static const int THIRTYSECOND_STEM_LENGTH = 37
static const int SIXTEENTH_STEM_LENGTH = 31
static const int EIGHTH_STEM_LENGTH = 31
static const int QUARTER_STEM_LENGTH = 31
static const int HALF_STEM_LENGTH = 31
static const int QUARTER_YPOS_DELTA = 21
static const int HALF_YPOS_DELTA = 23


Detailed Description

Definition at line 17 of file drawablenote.h.


Constructor & Destructor Documentation

CADrawableNote::CADrawableNote ( CANote n,
CADrawableContext drawableContext,
int  x,
int  y,
bool  shadowNote = false,
CADrawableAccidental drawableAcc = 0 
)

Default constructor.

Parameters:
x coordinate represents the left border of the notehead.
y coordinate represents the center of the notehead.

Definition at line 31 of file drawablenote.cpp.

References _drawableAcc, CADrawableMusElement::_drawableMusElementType, _drawLedgerLines, CADrawable::_height, CADrawable::_neededHeight, CADrawable::_neededWidth, _noteHeadWidth, _shadowNote, _stemDirection, CADrawable::_width, CADrawable::_xPos, CADrawable::_yPos, CANote::actualStemDirection(), CAPlayable::Breve, CAPlayable::dotted(), CADrawableMusElement::DrawableNote, CAPlayable::Eighth, CAPlayable::Half, CAPlayable::HundredTwentyEighth, note(), CAPlayable::playableLength(), CAPlayable::Quarter, CAPlayable::Sixteenth, CAPlayable::SixtyFourth, CAPlayable::ThirtySecond, and CAPlayable::Whole.

Referenced by clone().

Here is the call graph for this function:

Here is the caller graph for this function:

CADrawableNote::~CADrawableNote (  ) 

Definition at line 82 of file drawablenote.cpp.


Member Function Documentation

void CADrawableNote::draw ( QPainter *  p,
CADrawSettings  s 
) [virtual]

Todo:
Emmentaler font doesn't have 128th, 64th flag is drawn instead! Need to somehow compose the 128th flag? -Matevz

Implements CADrawable.

Definition at line 85 of file drawablenote.cpp.

References _drawLedgerLines, CADrawable::_height, _noteHeadWidth, _stemDirection, CAPlayable::Breve, CADrawSettings::color, CAPlayable::dotted(), CAPlayable::Eighth, EIGHTH_STEM_LENGTH, CAPlayable::Half, HALF_STEM_LENGTH, CADrawable::height(), CAPlayable::HundredTwentyEighth, HUNDREDTWENTYEIGHTH_STEM_LENGTH, note(), CANote::notePosition(), CAPlayable::Quarter, QUARTER_STEM_LENGTH, CAPlayable::Sixteenth, SIXTEENTH_STEM_LENGTH, CAPlayable::SixtyFourth, CANote::StemUp, CAPlayable::ThirtySecond, THIRTYSECOND_STEM_LENGTH, CAPlayable::Whole, CADrawSettings::x, CADrawSettings::y, and CADrawSettings::z.

Referenced by CADrawableMark::draw().

Here is the call graph for this function:

Here is the caller graph for this function:

CANote* CADrawableNote::note (  )  [inline]

Definition at line 25 of file drawablenote.h.

References CADrawableMusElement::_musElement.

Referenced by CADrawableNote(), clone(), draw(), and setYPos().

Here is the caller graph for this function:

CADrawableNote * CADrawableNote::clone ( CADrawableContext newContext = 0  )  [virtual]

Implements CADrawableMusElement.

Definition at line 317 of file drawablenote.cpp.

References CADrawableMusElement::_drawableContext, CADrawable::_height, CADrawable::_xPos, CADrawable::_yPos, CADrawableNote(), and note().

Here is the call graph for this function:

void CADrawableNote::setDrawLedgerLines ( bool  ledgerLines  )  [inline]

Definition at line 29 of file drawablenote.h.

References _drawLedgerLines.

bool CADrawableNote::drawLedgerLines (  )  [inline]

Definition at line 30 of file drawablenote.h.

References _drawLedgerLines.

void CADrawableNote::setXPos ( int  xPos  )  [virtual]

Reimplemented from CADrawable.

Definition at line 321 of file drawablenote.cpp.

References CADrawable::_xPos.

void CADrawableNote::setYPos ( int  yPos  )  [virtual]

Reimplemented from CADrawable.

Definition at line 325 of file drawablenote.cpp.

References CADrawable::_height, CADrawable::_yPos, CAPlayable::Breve, CAPlayable::Half, note(), CAPlayable::Quarter, and CAPlayable::Whole.

Here is the call graph for this function:

void CADrawableNote::setDrawableAccidental ( CADrawableAccidental acc  )  [inline]

Definition at line 34 of file drawablenote.h.

References _drawableAcc.

CADrawableAccidental* CADrawableNote::drawableAccidental (  )  [inline]

Definition at line 35 of file drawablenote.h.

References _drawableAcc.


Member Data Documentation

bool CADrawableNote::_drawLedgerLines [private]

Definition at line 38 of file drawablenote.h.

Referenced by CADrawableNote(), draw(), drawLedgerLines(), and setDrawLedgerLines().

bool CADrawableNote::_shadowNote [private]

Are the ledger lines drawn or not. True when ledger lines needed, False when the note is inside the staff.

Definition at line 39 of file drawablenote.h.

Referenced by CADrawableNote().

CADrawableAccidental* CADrawableNote::_drawableAcc [private]

Is the current note shadow note?

Definition at line 40 of file drawablenote.h.

Referenced by CADrawableNote(), drawableAccidental(), and setDrawableAccidental().

CANote::CAStemDirection CADrawableNote::_stemDirection [private]

Definition at line 41 of file drawablenote.h.

Referenced by CADrawableNote(), and draw().

int CADrawableNote::_noteHeadWidth [private]

This value is StemUp or StemDown only, no StemPreferred or StemNeutral present. We generate this on CADrawableNote constructor.

Definition at line 42 of file drawablenote.h.

Referenced by CADrawableNote(), and draw().

const int CADrawableNote::HUNDREDTWENTYEIGHTH_STEM_LENGTH = 43 [static, private]

Copyright (c) 2006, Matevž Jekovec, Canorus development team All Rights Reserved. See AUTHORS for a complete list of authors.

Licensed under the GNU GENERAL PUBLIC LICENSE. See COPYING for details.

Definition at line 43 of file drawablenote.h.

Referenced by draw().

const int CADrawableNote::SIXTYFOURTH_STEM_LENGTH = 43 [static, private]

Definition at line 44 of file drawablenote.h.

const int CADrawableNote::THIRTYSECOND_STEM_LENGTH = 37 [static, private]

Definition at line 45 of file drawablenote.h.

Referenced by draw().

const int CADrawableNote::SIXTEENTH_STEM_LENGTH = 31 [static, private]

Definition at line 46 of file drawablenote.h.

Referenced by draw().

const int CADrawableNote::EIGHTH_STEM_LENGTH = 31 [static, private]

Definition at line 47 of file drawablenote.h.

Referenced by draw().

const int CADrawableNote::QUARTER_STEM_LENGTH = 31 [static, private]

Definition at line 48 of file drawablenote.h.

Referenced by draw().

const int CADrawableNote::HALF_STEM_LENGTH = 31 [static, private]

Definition at line 49 of file drawablenote.h.

Referenced by draw().

const int CADrawableNote::QUARTER_YPOS_DELTA = 21 [static, private]

Definition at line 50 of file drawablenote.h.

const int CADrawableNote::HALF_YPOS_DELTA = 23 [static, private]

Definition at line 51 of file drawablenote.h.


The documentation for this class was generated from the following files:
Generated on Sat Feb 9 13:13:02 2008 for Canorus by  doxygen 1.5.3