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

Private Member Functions | |
| void | resetTimes () |
Private Attributes | |
| int | _number |
| int | _actualNumber |
| QList< CAPlayable * > | _noteList |
Additional Inherited Members | |
Public Types inherited from CAMusElement | |
| enum | CAMusElementType { Undefined = 0, Note, Rest, Barline, Clef, TimeSignature, KeySignature, Slur, Tuplet, Syllable, FunctionMark, 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 | |
| QList< CAMark * > | _markList |
| CAMusElementType | _musElementType |
| 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 CAMusElement::Note, noteList(), and CAMusElement::timeStart().
Referenced by CAMainWin::deleteSelection(), CAVoice::insertInTupletAndVoiceAt(), and CACanorusMLImport::startElement().


|
inline |
| 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(), CAMusElement::context(), firstNote(), 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 |
|
inline |
References noteList().
Referenced by assignTimes(), CAPlayable::isFirstInTuplet(), and CAKeybdInput::midiInEventToScore().


|
inline |
References noteList().
Referenced by CAPlayable::isLastInTuplet().


| 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(), addNotes(), assignTimes(), clone(), containsNote(), CAMainWin::copySelection(), firstNote(), CAMainWin::insertMusElementAt(), lastNote(), nextTimed(), CAMainWin::pasteAt(), removeNote(), 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 CAVoice::insert(), CAMusElement::musElementType(), CAVoice::next(), CAMusElement::Note, noteList(), and CAVoice::remove().
Referenced by assignTimes(), and ~CATuplet().


|
inline |
References _actualNumber.
|
inline |
References _number.
|
virtual |
Returns the time how long the music element lasts in the score. The returned time is in absolute time units.
Reimplemented from CAMusElement.
References noteList(), CAMusElement::timeEnd(), and timeStart().

|
virtual |
Returns the time in the score when the music element appears in time. The returned time is in absolute time units.
Reimplemented from CAMusElement.
References noteList().
Referenced by assignTimes(), and timeLength().


|
private |
Referenced by actualNumber(), and setActualNumber().
|
private |
Referenced by noteList().
|
private |
Referenced by number(), and setNumber().
1.8.3