|
Canorus
0.7
|
Represents a rest in the score. More...
#include <rest.h>

Public Types | |
| enum | CARestType { Undefined = -1, Normal, Hidden } |
Public Member Functions | |
| CARest (CARestType type, CAPlayableLength length, CAVoice *voice, int timeStart, int timeLength=-1) | |
| ~CARest () | |
| CARest * | clone (CAVoice *voice=0) |
| CARestType | restType () |
| void | setRestType (CARestType type) |
| int | compare (CAMusElement *elt) |
Static Public Member Functions | |
| static const QString | restTypeToString (CARestType) |
| static CARestType | restTypeFromString (const QString) |
| static QList< CARest * > | composeRests (int timeLength, int timeStart, CAVoice *voice=0, CARestType=Hidden) |
Private Attributes | |
| CARestType | _restType |
Represents a rest in the score.
Copyright (c) 2006-2007, 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 rest in the score. It inherits the base class CAPlayable.
| enum CARest::CARestType |
| CARest::CARest | ( | CARestType | type, |
| CAPlayableLength | length, | ||
| CAVoice * | voice, | ||
| int | timeStart, | ||
| int | timeLength = -1 |
||
| ) |
Creates a new rest with given type, playable length length in voice voice with starting time in the score timeStart and number of dots dotted. timeLength is calculated automatically from the playable length.
References CAMusElement::_musElementType, _restType, and CAMusElement::Rest.
Referenced by clone(), and composeRests().

| CARest::~CARest | ( | ) |
Destroys the rest.
| CARest * CARest::clone | ( | CAVoice * | voice = 0 | ) | [virtual] |
Implements CAPlayable.
References CAMusElement::addMark(), CARest(), CAMusElement::markList(), CAPlayable::playableLength(), restType(), CAMusElement::timeLength(), and CAMusElement::timeStart().

| int CARest::compare | ( | CAMusElement * | elt | ) | [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 CAMusElement::musElementType(), CAPlayable::playableLength(), and CAMusElement::Rest.

| QList< CARest * > CARest::composeRests | ( | int | timeLength, |
| int | timeStart, | ||
| CAVoice * | voice = 0, |
||
| CARestType | type = Hidden |
||
| ) | [static] |
Generates a list of new rests in the total length of timeLength. Rests are sorted from the shortes to the longest one. The first rest has the given timeStart. Passing voice and restType is optional.
This function is usually called when a gap between two voices with shared elements appear in one voice and the gap with custom length needs to be filled with rests.
References CAPlayableLength::Breve, CARest(), CAMusElement::timeStart(), and CAPlayable::voice().
Referenced by CAMainWin::deleteSelection(), CAMainWin::insertMusElementAt(), CAMainWin::on_uiPlayableLength_toggled(), CAMusicXmlImport::readForward(), CAMainWin::scoreViewPortKeyPress(), and CAStaff::synchronizeVoices().


| CARestType CARest::restType | ( | ) | [inline] |
References _restType.
Referenced by clone(), CALilyPondExport::exportPlayable(), CACanorusMLExport::exportVoiceImpl(), and CAMainWin::updatePlayableToolBar().

| CARest::CARestType CARest::restTypeFromString | ( | const QString | type | ) | [static] |
Converts rest type from QString to CARestType. This is usually used when loading the score.
References Hidden, and Normal.
Referenced by CACanorusMLImport::startElement().

| const QString CARest::restTypeToString | ( | CARestType | type | ) | [static] |
Converts rest type CARestType to QString. This is usually used when saving the score.
References Hidden, and Normal.
Referenced by CACanorusMLExport::exportVoiceImpl().

| void CARest::setRestType | ( | CARestType | type | ) | [inline] |
References _restType.
Referenced by CAMainWin::on_uiHiddenRest_toggled().

CARest::_restType [private] |
Type of the rest.
Referenced by CARest(), restType(), and setRestType().
1.8.0