#include <drawablestaff.h>

Definition at line 22 of file drawablestaff.h.
| CADrawableStaff::CADrawableStaff | ( | CAStaff * | staff, | |
| int | x, | |||
| int | y | |||
| ) |
Definition at line 22 of file drawablestaff.cpp.
References CADrawableContext::_drawableContextType, CADrawable::_height, CADrawable::_width, and CADrawableContext::DrawableStaff.
Referenced by clone().

| void CADrawableStaff::draw | ( | QPainter * | p, | |
| const CADrawSettings | s | |||
| ) | [virtual] |
Implements CADrawable.
Definition at line 28 of file drawablestaff.cpp.
References CADrawable::_height, CADrawSettings::color, CAStaff::numberOfLines(), staff(), STAFFLINE_WIDTH, CADrawSettings::w, CADrawSettings::y, and CADrawSettings::z.

| CADrawableStaff * CADrawableStaff::clone | ( | ) | [virtual] |
Implements CADrawableContext.
Definition at line 42 of file drawablestaff.cpp.
References CADrawable::_xPos, CADrawable::_yPos, CADrawableStaff(), and staff().

| CAStaff* CADrawableStaff::staff | ( | ) | [inline] |
Definition at line 27 of file drawablestaff.h.
References CADrawableContext::_context.
Referenced by CADrawableKeySignature::CADrawableKeySignature(), clone(), draw(), and lineSpace().

| float CADrawableStaff::lineSpace | ( | ) | [inline] |
Definition at line 29 of file drawablestaff.h.
References CADrawable::_height, and staff().
Referenced by CADrawableClef::CADrawableClef(), calculateCenterYCoord(), and calculatePitch().


| int CADrawableStaff::calculateCenterYCoord | ( | int | pitch, | |
| CAClef * | clef | |||
| ) |
Returns the center Y coordinate of the given note in this staff.
| pitch | Note pitch which the following coordinates are being calculated for. | |
| clef | Corresponding clef. |
Definition at line 55 of file drawablestaff.cpp.
References CAClef::c1(), CADrawable::height(), lineSpace(), and CADrawable::yPos().
Referenced by CADrawableKeySignature::CADrawableKeySignature(), and calculateCenterYCoord().


This is an overloaded member function, provided for convenience.
Returns the center Y coordinate of the given note in this staff.
| note | Note which the following coordinates are being calculated. | |
| clef | Corresponding clef. |
Definition at line 99 of file drawablestaff.cpp.
References calculateCenterYCoord(), and CANote::pitch().

| int CADrawableStaff::calculateCenterYCoord | ( | CANote * | note, | |
| int | x | |||
| ) |
This is an overloaded member function, provided for convenience.
Returns the center Y coordinate of the given note in this staff.
| note | Note which the following coordinates are being calculated. | |
| x | X coordinate of the note. |
Definition at line 71 of file drawablestaff.cpp.
References calculateCenterYCoord(), getClef(), and CANote::pitch().

| int CADrawableStaff::calculateCenterYCoord | ( | int | pitch, | |
| int | x | |||
| ) |
This is an overloaded member function, provided for convenience.
Returns the center Y coordinate of the given note in this staff.
| pitch | Note pitch which the following coordinates are being calculated for. | |
| x | X coordinate of the note. |
Definition at line 85 of file drawablestaff.cpp.
References calculateCenterYCoord(), and getClef().

| int CADrawableStaff::calculateCenterYCoord | ( | int | y | ) |
Rounds the given Y coordinate to the nearest one so it fits a line or a space (ledger lines too, if needed) in a staff.
Definition at line 108 of file drawablestaff.cpp.
References lineSpace(), and CADrawable::yPos().

| int CADrawableStaff::calculatePitch | ( | int | x, | |
| int | y | |||
| ) |
Calculates the note pitch on the given clef and absolute world Y coordinate.
| x | X coordinate in absolute world units. | |
| y | Y coordinate in absolute world units. |
Definition at line 123 of file drawablestaff.cpp.
References CAClef::c1(), getClef(), CADrawable::height(), lineSpace(), and CADrawable::yPos().
Referenced by CAMainWin::insertMusElementAt(), and CAMainWin::scoreViewPortMouseMove().


| void CADrawableStaff::addClef | ( | CADrawableClef * | clef | ) |
Adds a clef clef to the clef list for faster search of the current clef in the staff.
Definition at line 134 of file drawablestaff.cpp.
References _drawableClefList, and CADrawable::xPos().
Referenced by addMElement().


| void CADrawableStaff::addKeySignature | ( | CADrawableKeySignature * | keySig | ) |
Adds a key signature keySig to the key signatures list for faster search of the current key signature in the staff.
Definition at line 191 of file drawablestaff.cpp.
References _drawableKeySignatureList, and CADrawable::xPos().
Referenced by addMElement().


| void CADrawableStaff::addTimeSignature | ( | CADrawableTimeSignature * | timeSig | ) |
Adds a time signature timeSig to the time signatures list for faster search of the current time signature in the staff.
Definition at line 218 of file drawablestaff.cpp.
References _drawableTimeSignatureList, and CADrawable::xPos().
Referenced by addMElement().


| bool CADrawableStaff::removeClef | ( | CADrawableClef * | clef | ) |
Removes the given clef from the clefs-lookup list. Returns True, if the clef was successfully removed, False otherwise.
Definition at line 144 of file drawablestaff.cpp.
References _drawableClefList.
Referenced by removeMElement().

| bool CADrawableStaff::removeKeySignature | ( | CADrawableKeySignature * | keySig | ) |
Removes the given key signature from the key signatures-lookup list. Returns True, if the key signature was successfully removed, False otherwise.
Definition at line 201 of file drawablestaff.cpp.
References _drawableKeySignatureList.
Referenced by removeMElement().

| bool CADrawableStaff::removeTimeSignature | ( | CADrawableTimeSignature * | timeSig | ) |
Removes the given time signature from the time signatures-lookup list. Returns True, if the time signature was successfully removed, False otherwise.
Definition at line 228 of file drawablestaff.cpp.
References _drawableTimeSignatureList.
Referenced by removeMElement().

| CAClef * CADrawableStaff::getClef | ( | int | x | ) |
Returns the pointer to the last clef placed before the given X-coordinate.
Definition at line 151 of file drawablestaff.cpp.
References _drawableClefList, and CADrawable::xPos().
Referenced by CADrawableKeySignature::CADrawableKeySignature(), calculateCenterYCoord(), and calculatePitch().


| CAKeySignature * CADrawableStaff::getKeySignature | ( | int | x | ) |
Definition at line 208 of file drawablestaff.cpp.
References _drawableKeySignatureList, and CADrawable::xPos().
Referenced by CADrawableKeySignature::CADrawableKeySignature(), and getAccs().


| CATimeSignature * CADrawableStaff::getTimeSignature | ( | int | x | ) |
Returns the pointer to the last time signature placed before the given X-coordinate.
Definition at line 235 of file drawablestaff.cpp.
References _drawableTimeSignatureList, and CADrawable::xPos().

| int CADrawableStaff::getAccs | ( | int | x, | |
| int | pitch | |||
| ) |
Returns accidentals at the given X-coordinate and pitch. eg. -1 for one flat, 2 for two sharps. This is useful to determine the note's pitch to be placed in certain measure or part of the measure, if accidentals have been placed before.
Definition at line 163 of file drawablestaff.cpp.
References CADrawableContext::_drawableMusElementList, CAKeySignature::accidentals(), CADrawableMusElement::DrawableBarline, CADrawableMusElement::DrawableKeySignature, CADrawableMusElement::DrawableNote, and getKeySignature().
Referenced by CAMainWin::scoreViewPortMouseMove().

| void CADrawableStaff::addMElement | ( | CADrawableMusElement * | elt | ) | [virtual] |
Reimplemented from CADrawableContext.
Definition at line 242 of file drawablestaff.cpp.
References CADrawableContext::_drawableMusElementList, addClef(), addKeySignature(), addTimeSignature(), CADrawableMusElement::DrawableClef, CADrawableMusElement::DrawableKeySignature, CADrawableMusElement::drawableMusElementType(), and CADrawableMusElement::DrawableTimeSignature.

| int CADrawableStaff::removeMElement | ( | CADrawableMusElement * | elt | ) | [virtual] |
Reimplemented from CADrawableContext.
Definition at line 258 of file drawablestaff.cpp.
References CADrawableContext::_drawableMusElementList, CADrawableMusElement::DrawableClef, CADrawableMusElement::DrawableKeySignature, CADrawableMusElement::drawableMusElementType(), CADrawableMusElement::DrawableTimeSignature, removeClef(), removeKeySignature(), and removeTimeSignature().

QList<CADrawableClef *> CADrawableStaff::_drawableClefList [private] |
Definition at line 56 of file drawablestaff.h.
Referenced by addClef(), getClef(), and removeClef().
QList<CADrawableKeySignature *> CADrawableStaff::_drawableKeySignatureList [private] |
Definition at line 57 of file drawablestaff.h.
Referenced by addKeySignature(), getKeySignature(), and removeKeySignature().
QList<CADrawableTimeSignature *> CADrawableStaff::_drawableTimeSignatureList [private] |
Definition at line 58 of file drawablestaff.h.
Referenced by addTimeSignature(), getTimeSignature(), and removeTimeSignature().
const float CADrawableStaff::STAFFLINE_WIDTH = 0.8 [static, private] |
Copyright (c) 2006-2007, 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 59 of file drawablestaff.h.
Referenced by draw().
1.5.3