|
Canorus 0.0
|
#include <drawablestaff.h>

Static Public Member Functions | |
| static bool | xDrawableBarlineLessThan (const CADrawableBarline *a, const double x) |
Private Attributes | |
| QList< CADrawableClef * > | _drawableClefList |
| QList< CADrawableKeySignature * > | _drawableKeySignatureList |
| QList< CADrawableTimeSignature * > | _drawableTimeSignatureList |
| QList< CADrawableBarline * > | _drawableBarlineList |
Static Private Attributes | |
| static const double | STAFFLINE_WIDTH = 0.8 |
| CADrawableStaff::CADrawableStaff | ( | CAStaff * | staff, |
| double | x, | ||
| double | y | ||
| ) |
References CADrawableContext::_drawableContextType, CADrawableContext::DrawableStaff, CADrawable::setHeight(), and CADrawable::setWidth().
Referenced by clone().


| void CADrawableStaff::addBarline | ( | CADrawableBarline * | barline | ) |
Adds a barline barlineto the barline list for faster search when drawing the ruler.
References _drawableBarlineList, and CADrawable::xPos().
Referenced by addMElement().


| 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, addBarline(), addClef(), addKeySignature(), addTimeSignature(), CADrawableMusElement::DrawableAccidental, CADrawableMusElement::DrawableBarline, CADrawableMusElement::DrawableClef, CADrawableMusElement::DrawableFiguredBassNumber, CADrawableMusElement::DrawableFunctionMark, CADrawableMusElement::DrawableFunctionMarkSupport, CADrawableMusElement::DrawableKeySignature, CADrawableMusElement::DrawableMark, CADrawableMusElement::DrawableMidiNote, CADrawableMusElement::drawableMusElementType(), CADrawableMusElement::DrawableNote, CADrawableMusElement::DrawableRest, CADrawableMusElement::DrawableSlur, CADrawableMusElement::DrawableSyllable, CADrawableMusElement::DrawableTimeSignature, and CADrawableMusElement::DrawableTuplet.

| 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().


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 | ( | 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().

| 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(), calculateCenterYCoord(), and CALayoutEngine::reposit().


| 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().

| 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::scoreViewMouseMove().


|
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.

|
inline |
References _drawableBarlineList.
Referenced by CAScoreView::computeBarlinePositions().

|
inline |
References _drawableTimeSignatureList.
Referenced by CAScoreView::computeBarlinePositions().

| 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, getKeySignature(), and CADrawable::xPos().
Referenced by CAMainWin::scoreViewMouseMove().


| CABarline * CADrawableStaff::getBarline | ( | double | x | ) |
References _drawableBarlineList, and xDrawableBarlineLessThan().

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

| CAKeySignature * CADrawableStaff::getKeySignature | ( | double | x | ) |
References _drawableKeySignatureList.
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.
|
inline |
References CADrawable::height(), and staff().
Referenced by CADrawableClef::CADrawableClef(), CADrawableMidiNote::CADrawableMidiNote(), calculateCenterYCoord(), calculatePitch(), and draw().


| bool CADrawableStaff::removeBarline | ( | CADrawableBarline * | barline | ) |
Removes the given barline from the barline-lookup list. Returns True, if the barline was successfully removed, False otherwise.
References _drawableBarlineList.
| 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::DrawableAccidental, CADrawableMusElement::DrawableBarline, CADrawableMusElement::DrawableClef, CADrawableMusElement::DrawableFiguredBassNumber, CADrawableMusElement::DrawableFunctionMark, CADrawableMusElement::DrawableFunctionMarkSupport, CADrawableMusElement::DrawableKeySignature, CADrawableMusElement::DrawableMark, CADrawableMusElement::DrawableMidiNote, CADrawableMusElement::drawableMusElementType(), CADrawableMusElement::DrawableNote, CADrawableMusElement::DrawableRest, CADrawableMusElement::DrawableSlur, CADrawableMusElement::DrawableSyllable, CADrawableMusElement::DrawableTimeSignature, CADrawableMusElement::DrawableTuplet, 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().

|
static |
Helper function for getBarline() when doing the binary search over elements.
References CADrawable::xPos().
Referenced by getBarline().


|
private |
Referenced by addBarline(), drawableBarlineList(), getBarline(), and removeBarline().
|
private |
Referenced by addClef(), getClef(), and removeClef().
|
private |
Referenced by addKeySignature(), getKeySignature(), and removeKeySignature().
|
private |
Referenced by addTimeSignature(), drawableTimeSignatureList(), 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().