|
Canorus
0.0
|
Represents a note in the score. More...
#include <note.h>

Public Types | |
| enum | CAStemDirection { StemUndefined = -1, StemNeutral, StemUp, StemDown, StemPreferred } |
| Direction of the note's stem. More... | |
Public Types inherited from CAMusElement | |
| enum | CAMusElementType { Undefined = 0, Note, Rest, MidiNote, Barline, Clef, TimeSignature, KeySignature, Slur, Tuplet, Syllable, FunctionMark, FiguredBassMark, Mark } |
Static Public Member Functions | |
| static const QString | generateNoteName (int pitch, int accs) |
| static const QString | stemDirectionToString (CAStemDirection) |
| static CAStemDirection | stemDirectionFromString (const QString) |
Static Public Member Functions inherited from CAMusElement | |
| static const QString | musElementTypeToString (CAMusElementType) |
| static CAMusElementType | musElementTypeFromString (const QString) |
Private Attributes | |
| CADiatonicPitch | _diatonicPitch |
| CAStemDirection | _stemDirection |
| bool | _forceAccidentals |
| CASlur * | _tieStart |
| CASlur * | _tieEnd |
| CASlur * | _slurStart |
| CASlur * | _slurEnd |
| CASlur * | _phrasingSlurStart |
| CASlur * | _phrasingSlurEnd |
Additional Inherited Members | |
Protected Member Functions inherited from CAMusElement | |
| void | setMusElementType (CAMusElementType type) |
Protected Attributes inherited from CAPlayable | |
| CAPlayableLength | _playableLength |
| CAVoice * | _voice |
| CATuplet * | _tuplet |
Protected Attributes inherited from CAMusElement | |
| CAMusElementType | _musElementType |
| QList< CAMark * > | _markList |
| QList< CANoteCheckerError * > | _noteCheckerErrorList |
| CAContext * | _context |
| int | _timeStart |
| int | _timeLength |
| bool | _visible |
| QColor | _color |
| QString | _name |
Represents a note in the score.
Copyright (c) 2006-2010, Matevž Jekovec, Canorus development team All Rights Reserved. See AUTHORS for a complete list of authors.
Licensed under the GNU GENERAL PUBLIC LICENSE. See LICENSE.GPL for details.
This class represents every note in the score. It inherits the base class CAPlayable.
Chords in Canorus don't have its own class, but are represented as a list of notes. The first note in the chord identifies it and contains chord-level marks.
Direction of the note's stem.
This type represents the direction of the note's stem.
Possible values:
| Enumerator | |
|---|---|
| StemUndefined | |
| StemNeutral | |
| StemUp | |
| StemDown | |
| StemPreferred | |
| CANote::CANote | ( | CADiatonicPitch | pitch, |
| CAPlayableLength | length, | ||
| CAVoice * | voice, | ||
| int | timeStart, | ||
| int | timeLength = -1 |
||
| ) |
Creates a new note with playable length length in voice voice with pitch pitch and accidentals accs, with starting time in the score timeStart and number of dots dotted. timeLength is calculated automatically from the playable length.
References _forceAccidentals, CAMusElement::_musElementType, _stemDirection, CAMusElement::Note, setDiatonicPitch(), setPhrasingSlurEnd(), setPhrasingSlurStart(), setSlurEnd(), setSlurStart(), setTieEnd(), setTieStart(), and StemPreferred.
Referenced by clone().


|
virtual |
References CAMusElement::markList(), CASlur::setNoteEnd(), tieEnd(), and tieStart().

| CASlur::CASlurDirection CANote::actualSlurDirection | ( | ) |
Determines the right slur direction of the note. Slur should be on the other side of the stem, if the stem direction is neutral or on the same side if the stem direction is set strictly to up and down (or preferred).
References actualStemDirection(), CASlur::SlurDown, CASlur::SlurUp, stemDirection(), StemNeutral, StemPreferred, StemUp, and CAPlayable::voice().

| CANote::CAStemDirection CANote::actualStemDirection | ( | ) |
Returns the actual stem direction (the one which is drawn). Always returns stem up or stem down.
References notePosition(), CAPlayable::staff(), stemDirection(), CAVoice::stemDirection(), StemDown, StemNeutral, StemPreferred, StemUndefined, StemUp, and CAPlayable::voice().
Referenced by actualSlurDirection(), and CADrawableNote::CADrawableNote().


Clones the note with same pitch, voice, timeStart and other properties. Does not create clones of ties, slurs and phrasing slurs!
Implements CAPlayable.
References CAMusElement::addMark(), CANote(), diatonicPitch(), CAMusElement::markList(), CAPlayable::playableLength(), setStemDirection(), stemDirection(), CAMusElement::timeLength(), CAMusElement::timeStart(), and CAPlayable::voice().

|
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.
References diatonicPitch(), CAMusElement::musElementType(), CAMusElement::Note, and CAPlayable::playableLength().

|
inline |
References _diatonicPitch.
Referenced by CAVoice::addNoteToChord(), CADrawableStaff::calculateCenterYCoord(), clone(), compare(), CAMusicXmlExport::exportNote(), CALilyPondExport::exportPlayable(), CACanorusMLExport::exportVoiceImpl(), CALilyPondImport::importVoiceImpl(), CAVoice::insert(), CAMainWin::insertMusElementAt(), CAVoice::lastNotePitch(), notePosition(), CAPlayback::playSelectionImpl(), CAMusicXmlImport::readNote(), CATranspose::reinterpretAccidentals(), CALilyPondExport::relativePitchToString(), CALayoutEngine::reposit(), CAPlayback::run(), CAMainWin::scoreViewKeyPress(), and updateTies().

|
inline |
References _forceAccidentals.
Referenced by CALilyPondExport::exportPlayable().

|
static |
Generates the note name on the given pitch pitch with accidentals accs. Note name ranges are from C,, for sub-contra octave to c''''' for fifth octave. This method is usually used for showing the note pitch in status bar.
References CAMusElement::name().
Referenced by CAScoreView::paintEvent().


| QList< CANote * > CANote::getChord | ( | ) |
Generates a list of notes with the same start time - the whole chord - in the current voice. Notes in chord keep the order present in the voice. This is usually bottom-up.
Returns a single element in the list - only the note itself, if the note isn't part of the chord.
References CAVoice::musElementList(), CAMusElement::musElementType(), CAMusElement::Note, CAMusElement::timeStart(), and CAPlayable::voice().
Referenced by CAVoice::addNoteToChord(), CALilyPondExport::exportPlayable(), CAVoice::insert(), CAMainWin::insertMusElementAt(), CAMusicXmlImport::readNote(), CAVoice::remove(), and CAMainWin::scoreViewKeyPress().


| bool CANote::isFirstInChord | ( | ) |
Returns true, if the note is the first in the list of the chord; otherwise false.
References CAMusElement::_timeStart, CAVoice::musElementList(), CAMusElement::musElementType(), CAMusElement::Note, CAMusElement::timeStart(), and CAPlayable::voice().
Referenced by CACanorusMLExport::exportMarks(), CAMusicXmlExport::exportNote(), CALilyPondExport::exportPlayable(), CAPlayback::loopUntilPlayable(), CALayoutEngine::placeMarks(), and CAVoice::remove().


| bool CANote::isLastInChord | ( | ) |
Returns true, if the note is the last in the list of the chord; otherwise false.
References CAMusElement::_timeStart, CAVoice::musElementList(), CAMusElement::musElementType(), CAMusElement::Note, CAMusElement::timeStart(), and CAPlayable::voice().
Referenced by CALilyPondExport::exportPlayable().


| bool CANote::isPartOfChord | ( | ) |
Returns true, if the note is part of a chord; otherwise false.
References CAMusElement::_timeStart, CAVoice::musElementList(), CAMusElement::musElementType(), CAMusElement::Note, CAMusElement::timeStart(), and CAPlayable::voice().
Referenced by CAMainWin::deleteSelection(), CAMusicXmlExport::exportNote(), CALilyPondExport::exportPlayable(), CAMainWin::insertMusElementAt(), and CAVoice::remove().


|
inline |
References _diatonicPitch, and CADiatonicPitch::midiPitch().

|
inline |
References CAPlayable::_playableLength.
| int CANote::notePosition | ( | ) |
Dependent on the current clef calculates and returns the vertical note position in the staff looking bottom-up:
References CAClef::c1(), CAStaff::clefRefs(), diatonicPitch(), CADiatonicPitch::noteName(), CAPlayable::staff(), CAVoice::staff(), CAMusElement::timeStart(), and CAPlayable::voice().
Referenced by actualStemDirection(), and CADrawableNote::draw().


|
inline |
References _phrasingSlurEnd.
Referenced by CAMainWin::copySelection(), CALilyPondExport::exportPlayable(), CACanorusMLExport::exportVoiceImpl(), CAMainWin::insertMusElementAt(), CAMainWin::pasteAt(), CAVoice::remove(), and CALayoutEngine::reposit().

|
inline |
References _phrasingSlurStart.
Referenced by CAStaff::clone(), CAMainWin::copySelection(), CALilyPondExport::exportPlayable(), CACanorusMLExport::exportVoiceImpl(), CAMainWin::insertMusElementAt(), CAMainWin::pasteAt(), CAVoice::remove(), and CALayoutEngine::reposit().

|
inline |
References _diatonicPitch, and updateTies().
Referenced by CANote(), CACanorusMLImport::endElement(), CATranspose::reinterpretAccidentals(), and CAMainWin::scoreViewKeyPress().


|
inline |
References _forceAccidentals.
|
inline |
References _phrasingSlurEnd.
Referenced by CANote(), CAStaff::clone(), CAMusElementFactory::configureSlur(), CALilyPondImport::importVoiceImpl(), CAVoice::remove(), CACanorusMLImport::startElement(), and CASlur::~CASlur().

|
inline |
References _phrasingSlurStart.
Referenced by CANote(), CAMusElementFactory::configureSlur(), CAMainWin::copySelection(), CALilyPondImport::importVoiceImpl(), CAMainWin::pasteAt(), CAVoice::remove(), CACanorusMLImport::startElement(), and CASlur::~CASlur().

|
inline |
References _slurEnd, and slurEnd().
Referenced by CANote(), CAStaff::clone(), CAMusElementFactory::configureSlur(), CALilyPondImport::importVoiceImpl(), CAVoice::remove(), CACanorusMLImport::startElement(), and CASlur::~CASlur().


|
inline |
References _slurStart, and slurStart().
Referenced by CANote(), CAMusElementFactory::configureSlur(), CAMainWin::copySelection(), CALilyPondImport::importVoiceImpl(), CAMainWin::pasteAt(), CAVoice::remove(), CACanorusMLImport::startElement(), and CASlur::~CASlur().


| void CANote::setStemDirection | ( | CAStemDirection | dir | ) |
Sets the stem direction and update tie, slur and phrasing slur direction.
References _stemDirection.
Referenced by CAVoice::addNoteToChord(), clone(), CAMainWin::on_uiNoteStemDirection_toggled(), and CACanorusMLImport::startElement().

|
inline |
References _tieEnd, and tieEnd().
Referenced by CANote(), CAStaff::clone(), CAMusElementFactory::configureSlur(), CAMainWin::pasteAt(), CAMusicXmlImport::readNote(), updateTies(), and CASlur::~CASlur().


|
inline |
References _tieStart, and tieStart().
Referenced by CANote(), CAMusElementFactory::configureSlur(), CAMainWin::copySelection(), CALilyPondImport::importVoiceImpl(), CAMainWin::pasteAt(), CAMusicXmlImport::readNote(), CACanorusMLImport::startElement(), and CASlur::~CASlur().


|
inline |
References _slurEnd.
Referenced by CAMainWin::copySelection(), CALilyPondExport::exportPlayable(), CACanorusMLExport::exportVoiceImpl(), CAMainWin::insertMusElementAt(), CAMainWin::pasteAt(), CAVoice::remove(), CALayoutEngine::reposit(), and setSlurEnd().

|
inline |
References _slurStart.
Referenced by CAStaff::clone(), CAMainWin::copySelection(), CALilyPondExport::exportPlayable(), CACanorusMLExport::exportVoiceImpl(), CAMainWin::insertMusElementAt(), CAMainWin::pasteAt(), CAVoice::remove(), CALayoutEngine::reposit(), and setSlurStart().

|
inline |
References _stemDirection.
Referenced by actualSlurDirection(), actualStemDirection(), CAVoice::addNoteToChord(), clone(), CAMusicXmlExport::exportNote(), CACanorusMLExport::exportVoiceImpl(), and CAMainWin::updatePlayableToolBar().

|
static |
Converts stem direction in QString format to CAStemDirection. This is usually used when loading a score.
References StemDown, StemNeutral, StemPreferred, and StemUp.
Referenced by CACanorusMLImport::startElement().

|
static |
Converts stem direction CAStemDirection to QString. This is usually used when saving the score.
References StemDown, StemNeutral, StemPreferred, StemUndefined, and StemUp.
Referenced by CACanorusMLExport::exportDocumentImpl(), and CACanorusMLExport::exportVoiceImpl().

|
inline |
References _tieEnd.
Referenced by CAMainWin::copySelection(), CAMainWin::pasteAt(), CALayoutEngine::reposit(), CAPlayback::run(), setTieEnd(), updateTies(), and ~CANote().

|
inline |
References _tieStart.
Referenced by CAStaff::clone(), CAMainWin::copySelection(), CALilyPondExport::exportPlayable(), CACanorusMLExport::exportVoiceImpl(), CAMainWin::insertMusElementAt(), CAMainWin::pasteAt(), CAPlayback::run(), setTieStart(), updateTies(), and ~CANote().

| void CANote::updateTies | ( | ) |
Looks at the tieStart() and tieEnd() ties and unties the note and tie if the previous/next note pitch differs.
References diatonicPitch(), CAVoice::getNoteList(), CASlur::noteEnd(), CASlur::setNoteEnd(), setTieEnd(), tieEnd(), tieStart(), CAMusElement::timeEnd(), CAMusElement::timeStart(), and CAPlayable::voice().
Referenced by CACanorusMLImport::endElement(), CALilyPondImport::importVoiceImpl(), and setDiatonicPitch().


|
private |
Referenced by diatonicPitch(), midiPitch(), and setDiatonicPitch().
|
private |
Always draw notes accidentals.
Referenced by CANote(), forceAccidentals(), and setForceAccidentals().
|
private |
Referenced by phrasingSlurEnd(), and setPhrasingSlurEnd().
|
private |
Referenced by phrasingSlurStart(), and setPhrasingSlurStart().
|
private |
Referenced by setSlurEnd(), and slurEnd().
|
private |
Referenced by setSlurStart(), and slurStart().
|
private |
Direction of the note's stem, if any.
Referenced by CANote(), setStemDirection(), and stemDirection().
|
private |
Referenced by setTieEnd(), and tieEnd().
|
private |
Referenced by setTieStart(), and tieStart().