|
Canorus
0.7
|
Musical length of notes and rests. More...
#include <playablelength.h>
Public Types | |
| enum | CAMusicLength { Undefined = -1, Breve = 0, Whole = 1, Half = 2, Quarter = 4, Eighth = 8, Sixteenth = 16, ThirtySecond = 32, SixtyFourth = 64, HundredTwentyEighth = 128 } |
Public Member Functions | |
| CAPlayableLength () | |
| CAPlayableLength (CAMusicLength l, int dotted=0) | |
| const CAMusicLength | musicLength () |
| const int | dotted () |
| void | setMusicLength (const CAMusicLength l) |
| void | setDotted (const int d) |
| bool | operator== (CAPlayableLength) |
| bool | operator!= (CAPlayableLength) |
Static Public Member Functions | |
| static const QString | musicLengthToString (CAMusicLength length) |
| static CAMusicLength | musicLengthFromString (const QString length) |
| static const int | playableLengthToTimeLength (CAPlayableLength length) |
| static const int | musicLengthToTimeLength (CAMusicLength l) |
| static QList< CAPlayableLength > | timeLengthToPlayableLengthList (int timeLength, bool longNotesFirst=true, int dotsLimit=4) |
| static QList< CAPlayableLength > | matchToBars (CAPlayableLength len, int timeStart, CABarline *lastBarline, CATimeSignature *ts, int dotsLimit=4) |
Private Attributes | |
| CAMusicLength | _musicLength |
| int | _dotted |
Musical length of notes and rests.
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.
This class represents a musical length (quarter, half, whole etc.) of notes and rests with number of dots.
It consists of two properties:
Playable length can be easily converted to timeLength. Vice-versa is a bit more difficult.
| CAPlayableLength::CAPlayableLength | ( | ) |
References setDotted(), setMusicLength(), and Undefined.
Referenced by matchToBars(), musicLengthToTimeLength(), and timeLengthToPlayableLengthList().


| CAPlayableLength::CAPlayableLength | ( | CAMusicLength | l, |
| int | dotted = 0 |
||
| ) |
|
inline |
References _dotted.
Referenced by CAMusElementFactory::addPlayableDotted(), CADrawableNote::CADrawableNote(), CADrawableRest::CADrawableRest(), CADrawableRest::draw(), CADrawableNote::draw(), CACanorusMLExport::exportPlayableLength(), operator==(), CALilyPondImport::playableLengthFromLilyPond(), CAMidiImport::playableLengthFromLilyPond(), CALilyPondExport::playableLengthToLilyPond(), playableLengthToTimeLength(), CAMainWin::scoreViewPortKeyPress(), and CAMainWin::updateTempoToolBar().

|
static |
Split a playable to match a given bar border and bar length.
References CATimeSignature::beat(), CATimeSignature::beats(), CAPlayableLength(), playableLengthToTimeLength(), timeLengthToPlayableLengthList(), and CAMusElement::timeStart().
Referenced by CAKeybdInput::midiInEventToScore().


|
inline |
References _musicLength.
Referenced by CAMusElementFactory::addPlayableDotted(), CADrawableNote::CADrawableNote(), CADrawableRest::CADrawableRest(), CALilyPondExport::doAnacrusisCheck(), CACanorusMLExport::exportPlayableLength(), CALilyPondImport::importVoiceImpl(), operator==(), CALilyPondExport::playableLengthToLilyPond(), playableLengthToTimeLength(), CAMainWin::updatePlayableToolBar(), and CAMainWin::updateTempoToolBar().

|
static |
References Breve, Eighth, Half, HundredTwentyEighth, Quarter, Sixteenth, SixtyFourth, ThirtySecond, Undefined, and Whole.
Referenced by CACanorusMLImport::importMark(), and CACanorusMLImport::startElement().

|
static |
References Breve, Eighth, Half, HundredTwentyEighth, Quarter, Sixteenth, SixtyFourth, ThirtySecond, Undefined, and Whole.
Referenced by CACanorusMLExport::exportPlayableLength().

|
inlinestatic |
References CAPlayableLength(), and playableLengthToTimeLength().
Referenced by CAMainWin::scoreViewPortMouseMove(), and timeLengthToPlayableLengthList().


| bool CAPlayableLength::operator!= | ( | CAPlayableLength | l | ) |
Compares two playable lengths.
| bool CAPlayableLength::operator== | ( | CAPlayableLength | l | ) |
Compares two playable lengths.
References dotted(), and musicLength().

|
static |
Converts internal enum playableLength to actual timeLength.
References Breve, dotted(), Eighth, Half, HundredTwentyEighth, musicLength(), Quarter, Sixteenth, SixtyFourth, ThirtySecond, and Whole.
Referenced by CATuplet::assignTimes(), CAPlayable::calculateTimeLength(), CAMainWin::deleteSelection(), CALilyPondExport::doAnacrusisCheck(), CAMainWin::insertMusElementAt(), matchToBars(), musicLengthToTimeLength(), CAMainWin::on_uiPlayableLength_toggled(), CAMusElementFactory::placeAutoBar(), CAPlayback::run(), and timeLengthToPlayableLengthList().


|
inline |
References _dotted.
Referenced by CAMusElementFactory::addPlayableDotted(), CAPlayableLength(), CALilyPondImport::playableLengthFromLilyPond(), CAMidiImport::playableLengthFromLilyPond(), and CAMainWin::scoreViewPortKeyPress().

|
inline |
References _musicLength.
Referenced by CAPlayableLength(), CALilyPondImport::playableLengthFromLilyPond(), and CAMidiImport::playableLengthFromLilyPond().

|
static |
Compute for a given time length the CAPlayableLengths. In the general case this could result in several notes. In the canorus GUI we have can have max. 4 dots. By default longer notes appear first in the list, but with negating longNotesFirst the short ones appear first. This is useful for end of bar notes.
To make this computation fast we take in account that note durations are a binary presentation of the time duration. The breve value is not exactly a log2 value, so we do this singular nonlinear operation through the method of computation (see **).
Limitations: Maximum four dots per note, and the smallest resulting time duration is SixtyFourth;
Todo: Allow change of limitations as function parameters, which are longest note and number of dots.
References Breve, CAPlayableLength(), HundredTwentyEighth, musicLengthToTimeLength(), and playableLengthToTimeLength().
Referenced by matchToBars(), CAMusicXmlImport::readNote(), and CAMidiImport::writeMidiChannelEventsToVoice().


|
private |
Referenced by dotted(), and setDotted().
|
private |
Referenced by musicLength(), and setMusicLength().
1.8.3