|
Canorus
0.0
|
Class used for tuplets (triplets, duols etc.) More...
#include <tuplet.h>

Private Member Functions | |
| void | resetTimes () |
| QList< QList< CASlur * > > | getNoteSlurs () |
| void | assignNoteSlurs (QList< QList< CASlur * > >) |
Private Attributes | |
| int | _number |
| int | _actualNumber |
| QList< CAPlayable * > | _noteList |
Additional Inherited Members | |
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 inherited from CAMusElement | |
| static const QString | musElementTypeToString (CAMusElementType) |
| static CAMusElementType | musElementTypeFromString (const QString) |
Protected Member Functions inherited from CAMusElement | |
| void | setMusElementType (CAMusElementType type) |
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 |
Class used for tuplets (triplets, duols etc.)
Copyright (c) 2008, 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.
Tuplets are a rhythmic specialty. They are used to shorten the set of notes for a specified multiplier.
Most used tuplets are triplets (multiplier 2/3) and duols (multiplier 3/4).
| CATuplet::CATuplet | ( | int | number, |
| int | actualNumber, | ||
| QList< CAPlayable * > | noteList | ||
| ) |
Constructs a tuplet.
number is the existing number of notes and actualNumber is the desired length of the notes expressed in number of them. These parameters are used to calculate the multiplier of the notes. eg. number=3, actualNumber=2 multiplies all notes by a factor of 2/3.
noteList is a sorted list of rests and notes under the tuplet. Elements should already be part of the voice.
References assignTimes(), CAMusElement::setMusElementType(), and CAMusElement::Tuplet.
Referenced by clone().


| CATuplet::CATuplet | ( | int | number, |
| int | actualNumber | ||
| ) |
Constructs an empty tuplet.
Add notes and rests under it manually by calling addNote(). Call assignTimes() to apply the actual times then.
References CAMusElement::setMusElementType(), and CAMusElement::Tuplet.

|
virtual |
|
inline |
References _actualNumber.
Referenced by assignTimes(), clone(), CAStaff::clone(), compare(), CALilyPondExport::exportPlayable(), CACanorusMLExport::exportVoiceImpl(), and CAMainWin::insertMusElementAt().

| void CATuplet::addNote | ( | CAPlayable * | p | ) |
Adds a note to the tuplet.
References _noteList, CAMusElement::Note, noteList(), and CAMusElement::timeStart().
Referenced by CAMainWin::deleteSelection(), CAVoice::insertInTupletAndVoiceAt(), and CACanorusMLImport::startElement().


|
inline |
References _noteList.
|
private |
Assigns the given list of slurs per note index.
This function is usually called in combination with getNoteSlurs() when managing note timeStarts and notes are removed/readded to voices.
References noteList(), CAMusElement::setTimeLength(), CAMusElement::setTimeStart(), and CAMusElement::timeEnd().
Referenced by assignTimes(), and resetTimes().


| void CATuplet::assignTimes | ( | ) |
Transforms note times to tuplet-affected times.
The use case should be somewhat this: 1) Place ordinary notes and rests. 2) Create a tuplet containing them. This calls assignTimes() automatically to transform music elements times.
This function requires elements to be part of the voice.
References actualNumber(), assignNoteSlurs(), CAMusElement::context(), firstNote(), getNoteSlurs(), CAVoice::insert(), CAMusElement::musElementType(), CAVoice::next(), CAMusElement::Note, noteList(), number(), CAPlayableLength::playableLengthToTimeLength(), CAVoice::remove(), resetTimes(), CAMusElement::setContext(), CAMusElement::setTimeLength(), CAMusElement::timeEnd(), and timeStart().
Referenced by CATuplet(), CAMainWin::deleteSelection(), CACanorusMLImport::endElement(), and CAVoice::insertInTupletAndVoiceAt().


Clones a music element with exact properties including the context.
Implements CAMusElement.
References actualNumber(), CATuplet(), noteList(), and number().
Referenced by CAMainWin::copySelection(), and CAMainWin::pasteAt().


| CATuplet * CATuplet::clone | ( | QList< CAPlayable * > | newList | ) |
|
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 actualNumber(), CAMusElement::musElementType(), number(), and CAMusElement::Tuplet.

|
inline |
| CAPlayable * CATuplet::firstNote | ( | ) |
Returns the first note/rest in the first chord of the tuplet.
References CAMusElement::musElementType(), CAMusElement::Note, and noteList().
Referenced by assignTimes(), CAPlayable::isFirstInTuplet(), CAKeybdInput::midiInEventToScore(), and CALayoutEngine::reposit().


|
private |
Generates a list of pointers to slurs (slur start, slur end, phrasing slur start, phrasing slur end) per each note index.
If tuplet contains a rest, no slurs are present at that index.
References CAMusElement::musElementType(), CAMusElement::Note, and noteList().
Referenced by assignTimes(), and resetTimes().


| CAPlayable * CATuplet::lastNote | ( | ) |
Returns the last note/rest in the last chord of the tuplet.
References CAMusElement::musElementType(), CAMusElement::Note, and noteList().
Referenced by CAPlayable::isLastInTuplet(), and CALayoutEngine::reposit().


| CAPlayable * CATuplet::nextTimed | ( | CAPlayable * | p | ) |
Returns a pointer to the next member of tuplet with a greater timeStart. If it doesn't exist it returns 0.
References noteList(), and CAMusElement::timeStart().
Referenced by CAKeybdInput::midiInEventToScore().


|
inline |
References _noteList.
Referenced by addNote(), assignNoteSlurs(), assignTimes(), clone(), containsNote(), CAMainWin::copySelection(), firstNote(), getNoteSlurs(), CAMainWin::insertMusElementAt(), lastNote(), nextTimed(), CAMainWin::pasteAt(), resetTimes(), timeLength(), and timeStart().

|
inline |
References _number.
Referenced by assignTimes(), clone(), CAStaff::clone(), compare(), CALilyPondExport::exportPlayable(), CACanorusMLExport::exportVoiceImpl(), and CAMainWin::insertMusElementAt().

|
inline |
References _noteList.
Referenced by CAMainWin::deleteSelection(), CAVoice::insertInTupletAndVoiceAt(), and CAPlayable::~CAPlayable().

|
private |
Resets the notes times back to their original values before placing the tuplet.
This is usually called from the destructor of the tuplet.
References assignNoteSlurs(), getNoteSlurs(), CAVoice::insert(), CAMusElement::musElementType(), CAVoice::next(), CAMusElement::Note, noteList(), and CAVoice::remove().
Referenced by assignTimes(), and ~CATuplet().


|
inline |
References _actualNumber.
|
inline |
References _number.
| int CATuplet::timeLength | ( | ) |
References noteList(), CAMusElement::timeEnd(), and timeStart().

| int CATuplet::timeStart | ( | ) |
References noteList().
Referenced by assignTimes(), and timeLength().


|
private |
Referenced by actualNumber(), and setActualNumber().
|
private |
Referenced by addNote(), addNotes(), noteList(), and removeNote().
|
private |
Referenced by number(), and setNumber().