#include <clef.h>

Public Types | |
| enum | CAPredefinedClefType { Undefined = -1, Treble, Bass, French, Soprano, Mezzosoprano, Alto, Tenor, Baritone, Varbaritone, Subbass, Percussion, Tablature } |
| enum | CAClefType { F, G, C, PercussionHigh, PercussionLow, Tab } |
Public Member Functions | |
| CAClef (CAPredefinedClefType type, CAStaff *staff, int time, int offsetInterval=0) | |
| CAClef (CAClefType type, int c1, CAStaff *staff, int time, int offset=0) | |
| CAClef * | clone () |
| void | setPredefinedType (CAPredefinedClefType type) |
| CAClefType | clefType () |
| const int | c1 () |
| const int | centerPitch () |
| int | compare (CAMusElement *elt) |
| void | setClefType (CAClefType type) |
| void | setOffset (int offset) |
| int | offset () |
Static Public Member Functions | |
| static const QString | clefTypeToString (CAClefType) |
| static CAClefType | clefTypeFromString (const QString) |
| static const int | offsetFromReadable (const int offsetInterval) |
| static const int | offsetToReadable (const int offset) |
Private Attributes | |
| CAClefType | _clefType |
| int | _c1 |
| int | _centerPitch |
| int | _offset |
Licensed under the GNU GENERAL PUBLIC LICENSE. See LICENSE.GPL for details.
Represents a clef in the score
This class represents every clef in the score. It directly inherits the base class CAMusElement. Element is not playable (_timeLength=0).
Definition at line 17 of file clef.h.
| enum CAClef::CAClefType |
| CAClef::CAClef | ( | CAPredefinedClefType | type, | |
| CAStaff * | staff, | |||
| int | time, | |||
| int | offsetInterval = 0 | |||
| ) |
Creates a new predefined clef with type type, parent staff and start time time. _timeLength is set to 0. offsetInterval can be custom -1,0,1 no offset, +8 or -8 etc. mean the 8 written above or below the clef which raises or lowers the clef for one octave or whichever interval. Offset is the musical interval, not the internal offset.
Definition at line 28 of file clef.cpp.
References CAMusElement::_musElementType, _offset, CAMusElement::Clef, offsetFromReadable(), and setPredefinedType().
Referenced by clone().


| CAClef::CAClef | ( | CAClefType | type, | |
| int | c1, | |||
| CAStaff * | staff, | |||
| int | time, | |||
| int | offset = 0 | |||
| ) |
Creates a new clef with type type, location of middle C c1, time start time and parent staff. offset is the internal clef offset 0, +7, -7 etc. It does not affect c1.
Definition at line 41 of file clef.cpp.
References _c1, CAMusElement::_musElementType, _offset, CAMusElement::Clef, and setClefType().

| CAClef * CAClef::clone | ( | ) | [virtual] |
Clones a music element with exact properties including the context.
Implements CAMusElement.
Definition at line 111 of file clef.cpp.
References _c1, _clefType, CAMusElement::_context, _offset, CAMusElement::_timeStart, CAMusElement::addMark(), CAClef(), CAMusElement::markList(), and CAMark::setAssociatedElement().

| void CAClef::setPredefinedType | ( | CAPredefinedClefType | type | ) |
| CAClefType CAClef::clefType | ( | ) | [inline] |
Definition at line 49 of file clef.h.
References _clefType.
Referenced by CALilyPondExport::exportVoiceImpl(), and CACanorusMLExport::exportVoiceImpl().

| const int CAClef::c1 | ( | ) | [inline] |
Definition at line 50 of file clef.h.
References _c1.
Referenced by CADrawableKeySignature::CADrawableKeySignature(), CADrawableStaff::calculateCenterYCoord(), CANote::calculateNotePosition(), CADrawableStaff::calculatePitch(), CALilyPondExport::exportVoiceImpl(), CACanorusMLExport::exportVoiceImpl(), and CAScoreViewPort::updateHelpers().

| const int CAClef::centerPitch | ( | ) | [inline] |
| int CAClef::compare | ( | CAMusElement * | elt | ) | [virtual] |
Compares the music element with the given elt and returns number of differences in their properties. Returns 0, if the music elements are exact; -1 if the music element type differs; otherwise number greater than 0.
This method is usually used when opening a score document where music elements are written in various voices (eg. barlines), but are eventually merged and written only once per staff.
Implements CAMusElement.
Definition at line 123 of file clef.cpp.
References _c1, _clefType, _offset, CAMusElement::Clef, and CAMusElement::musElementType().

| void CAClef::setClefType | ( | CAClefType | type | ) |
Sets the clef type to type and update _c1 and _centerPitch.
Definition at line 99 of file clef.cpp.
References _centerPitch, _clefType, C, F, G, and offset().
Referenced by CAClef(), and setPredefinedType().


| void CAClef::setOffset | ( | int | offset | ) | [inline] |
| int CAClef::offset | ( | ) | [inline] |
Definition at line 57 of file clef.h.
References _offset.
Referenced by CALilyPondExport::exportVoiceImpl(), CACanorusMLExport::exportVoiceImpl(), setClefType(), setPredefinedType(), and CAMainWin::updateClefToolBar().

| const QString CAClef::clefTypeToString | ( | CAClefType | type | ) | [static] |
Converts clef type to QString.
Definition at line 140 of file clef.cpp.
References C, F, G, PercussionHigh, PercussionLow, and Tab.
Referenced by CACanorusMLExport::exportVoiceImpl().

| CAClef::CAClefType CAClef::clefTypeFromString | ( | const | QString | ) | [static] |
Converts QString type to clef type.
Definition at line 157 of file clef.cpp.
References C, F, G, PercussionHigh, PercussionLow, and Tab.
Referenced by CACanorusMLImport::startElement().

| const int CAClef::offsetFromReadable | ( | const int | offset | ) | [static] |
Converts the musical interval offset to Canorus internal offset. This method is usually called where user inputs the offset interval and it needs to be stored.
Definition at line 191 of file clef.cpp.
Referenced by CAClef(), and CAMainWin::on_uiClefOffset_valueChanged().

| const int CAClef::offsetToReadable | ( | const int | offsetInterval | ) | [static] |
Converts the internal clef offset to the musical interval. eg. offset +1 means +2 (supper second), +7 means +8 (supper octave), -7 means -8 (sub octave), 0 is an exception and stays 0 (instead of prime)
This method is usually called when displaying the offset of the key (eg. when rendering it).
Definition at line 178 of file clef.cpp.
Referenced by CAMainWin::updateClefToolBar().

CAClefType CAClef::_clefType [private] |
Definition at line 66 of file clef.h.
Referenced by clefType(), clone(), compare(), and setClefType().
CAClef::_c1 [private] |
Location of the middle C:
Definition at line 67 of file clef.h.
Referenced by c1(), CAClef(), clone(), compare(), setOffset(), and setPredefinedType().
CAClef::_centerPitch [private] |
Location of the clefs physical center:
Definition at line 68 of file clef.h.
Referenced by centerPitch(), and setClefType().
int CAClef::_offset [private] |
1.5.3