|
Canorus
0.7
|
#include <drawablestaff.h>

Private Attributes | |
| QList< CADrawableClef * > | _drawableClefList |
| QList< CADrawableKeySignature * > | _drawableKeySignatureList |
| QList< CADrawableTimeSignature * > | _drawableTimeSignatureList |
Static Private Attributes | |
| static const double | STAFFLINE_WIDTH = 0.8 |
Additional Inherited Members | |
Public Types inherited from CADrawableContext | |
| enum | CADrawableContextType { DrawableStaff, DrawableLyricsContext, DrawableFunctionMarkContext } |
Protected Member Functions inherited from CADrawableContext | |
| void | setDrawableContextType (CADrawableContextType type) |
Protected Attributes inherited from CADrawableContext | |
| CADrawableContextType | _drawableContextType |
| CAContext * | _context |
| QList< CADrawableMusElement * > | _drawableMusElementList |
Static Protected Attributes inherited from CADrawable | |
| static const int | SCALE_HANDLES_SIZE = 2 |
| CADrawableStaff::CADrawableStaff | ( | CAStaff * | staff, |
| double | x, | ||
| double | y | ||
| ) |
References CADrawableContext::_drawableContextType, CADrawableContext::DrawableStaff, CADrawable::setHeight(), and CADrawable::setWidth().
Referenced by clone().


| void CADrawableStaff::addClef | ( | CADrawableClef * | clef | ) |
Adds a clef clef to the clef list for faster search of the current clef in the staff.
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.
References _drawableKeySignatureList, and CADrawable::xPos().
Referenced by addMElement().


|
virtual |
Reimplemented from CADrawableContext.
References CADrawableContext::_drawableMusElementList, addClef(), addKeySignature(), addTimeSignature(), CADrawableMusElement::DrawableClef, CADrawableMusElement::DrawableKeySignature, CADrawableMusElement::drawableMusElementType(), and CADrawableMusElement::DrawableTimeSignature.

| 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.
References _drawableTimeSignatureList, and CADrawable::xPos().
Referenced by addMElement().


| double 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. |
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. |
References calculateCenterYCoord(), CANote::diatonicPitch(), and CADiatonicPitch::noteName().

| double CADrawableStaff::calculateCenterYCoord | ( | CANote * | note, |
| double | 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. |
References calculateCenterYCoord(), CANote::diatonicPitch(), getClef(), and CADiatonicPitch::noteName().

| double CADrawableStaff::calculateCenterYCoord | ( | int | pitch, |
| double | 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. |
References calculateCenterYCoord(), and getClef().

| double CADrawableStaff::calculateCenterYCoord | ( | double | 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.
References lineSpace(), and CADrawable::yPos().

| int CADrawableStaff::calculatePitch | ( | double | x, |
| double | 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. |
References CAClef::c1(), getClef(), CADrawable::height(), lineSpace(), and CADrawable::yPos().
Referenced by CAMainWin::insertMusElementAt(), and CAMainWin::scoreViewPortMouseMove().


|
virtual |
Implements CADrawableContext.
References CADrawableStaff(), staff(), CADrawable::xPos(), and CADrawable::yPos().

|
virtual |
Implements CADrawable.
References CADrawSettings::color, lineSpace(), CAStaff::numberOfLines(), staff(), STAFFLINE_WIDTH, CADrawSettings::w, CADrawSettings::y, and CADrawSettings::z.

| int CADrawableStaff::getAccs | ( | double | 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.
References CADrawableContext::_drawableMusElementList, CAKeySignature::accidentals(), CADrawableMusElement::DrawableBarline, CADrawableMusElement::DrawableKeySignature, CADrawableMusElement::DrawableNote, and getKeySignature().
Referenced by CAMainWin::scoreViewPortMouseMove().


| CAClef * CADrawableStaff::getClef | ( | double | x | ) |
Returns the pointer to the last clef placed before the given X-coordinate.
References _drawableClefList, and CADrawable::xPos().
Referenced by CADrawableKeySignature::CADrawableKeySignature(), calculateCenterYCoord(), and calculatePitch().


| CAKeySignature * CADrawableStaff::getKeySignature | ( | double | x | ) |
References _drawableKeySignatureList, and CADrawable::xPos().
Referenced by CADrawableKeySignature::CADrawableKeySignature(), and getAccs().


| CATimeSignature * CADrawableStaff::getTimeSignature | ( | double | x | ) |
Returns the pointer to the last time signature placed before the given X-coordinate.
References _drawableTimeSignatureList, and CADrawable::xPos().

|
inline |
References CADrawable::height(), and staff().
Referenced by CADrawableClef::CADrawableClef(), calculateCenterYCoord(), calculatePitch(), and draw().


| bool CADrawableStaff::removeClef | ( | CADrawableClef * | clef | ) |
Removes the given clef from the clefs-lookup list. Returns True, if the clef was successfully removed, False otherwise.
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.
References _drawableKeySignatureList.
Referenced by removeMElement().

|
virtual |
Reimplemented from CADrawableContext.
References CADrawableContext::_drawableMusElementList, CADrawableMusElement::DrawableClef, CADrawableMusElement::DrawableKeySignature, CADrawableMusElement::drawableMusElementType(), CADrawableMusElement::DrawableTimeSignature, removeClef(), removeKeySignature(), and removeTimeSignature().

| 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.
References _drawableTimeSignatureList.
Referenced by removeMElement().

|
inline |
References CADrawableContext::_context.
Referenced by CADrawableKeySignature::CADrawableKeySignature(), clone(), draw(), and lineSpace().

|
private |
Referenced by addClef(), getClef(), and removeClef().
|
private |
Referenced by addKeySignature(), getKeySignature(), and removeKeySignature().
|
private |
Referenced by addTimeSignature(), getTimeSignature(), and removeTimeSignature().
|
staticprivate |
Copyright (c) 2006-2009, 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.
Referenced by draw().
1.8.3