|
Canorus
0.7
|
Musical length of notes and rests. More...
#include <playablelength.h>
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:
- music length (quarter, half, whole etc.)
- number of dots
Playable length can be easily converted to timeLength. Vice-versa is a bit more
difficult.
\sa playableLengthToTimeLength(), CARest::composeRests()References setDotted(), setMusicLength(), and Undefined.
Referenced by matchToBars(), musicLengthToTimeLength(), and timeLengthToPlayableLengthList().


| CAPlayableLength::CAPlayableLength | ( | CAMusicLength | l, |
| int | dotted = 0 |
||
| ) |
| const int CAPlayableLength::dotted | ( | ) | [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().

| QList< CAPlayableLength > CAPlayableLength::matchToBars | ( | CAPlayableLength | len, |
| int | timeStart, | ||
| CABarline * | lastBarline, | ||
| CATimeSignature * | ts, | ||
| int | dotsLimit = 4 |
||
| ) | [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().


| const CAMusicLength CAPlayableLength::musicLength | ( | ) | [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().

| CAPlayableLength::CAMusicLength CAPlayableLength::musicLengthFromString | ( | const QString | length | ) | [static] |
References Breve, Eighth, Half, HundredTwentyEighth, Quarter, Sixteenth, SixtyFourth, ThirtySecond, Undefined, and Whole.
Referenced by CACanorusMLImport::importMark(), and CACanorusMLImport::startElement().

| const QString CAPlayableLength::musicLengthToString | ( | CAPlayableLength::CAMusicLength | length | ) | [static] |
References Breve, Eighth, Half, HundredTwentyEighth, Quarter, Sixteenth, SixtyFourth, ThirtySecond, Undefined, and Whole.
Referenced by CACanorusMLExport::exportPlayableLength().

| static const int CAPlayableLength::musicLengthToTimeLength | ( | CAMusicLength | l | ) | [inline, static] |
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().

| const int CAPlayableLength::playableLengthToTimeLength | ( | CAPlayableLength | length | ) | [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().


| void CAPlayableLength::setDotted | ( | const int | d | ) | [inline] |
References _dotted.
Referenced by CAMusElementFactory::addPlayableDotted(), CAPlayableLength(), CALilyPondImport::playableLengthFromLilyPond(), CAMidiImport::playableLengthFromLilyPond(), and CAMainWin::scoreViewPortKeyPress().

| void CAPlayableLength::setMusicLength | ( | const CAMusicLength | l | ) | [inline] |
References _musicLength.
Referenced by CAPlayableLength(), CALilyPondImport::playableLengthFromLilyPond(), and CAMidiImport::playableLengthFromLilyPond().

| QList< CAPlayableLength > CAPlayableLength::timeLengthToPlayableLengthList | ( | int | t, |
| bool | longNotesFirst = true, |
||
| int | dotsLimit = 4 |
||
| ) | [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().


int CAPlayableLength::_dotted [private] |
Referenced by dotted(), and setDotted().
CAMusicLength CAPlayableLength::_musicLength [private] |
Referenced by musicLength(), and setMusicLength().
1.8.0