|
Canorus
0.7
|
Playable instances of music elements. More...
#include <playable.h>

Public Member Functions | |
| CAPlayable (CAPlayableLength length, CAVoice *voice, int timeStart, int timeLength=-1) | |
| virtual | ~CAPlayable () |
| CAPlayableLength & | playableLength () |
| void | setPlayableLength (CAPlayableLength &l) |
| virtual CAPlayable * | clone (CAContext *context) |
| virtual CAPlayable * | clone (CAVoice *voice=0)=0 |
| CATuplet * | tuplet () |
| void | setTuplet (CATuplet *t) |
| CAVoice * | voice () |
| void | setVoice (CAVoice *v) |
| CAStaff * | staff () |
| bool | isFirstInTuplet () |
| bool | isLastInTuplet () |
| void | resetTime () |
| void | calculateTimeLength () |
Protected Attributes | |
| CAPlayableLength | _playableLength |
| CAVoice * | _voice |
| CATuplet * | _tuplet |
Playable instances of music elements.
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.
CAPlayable class represents a base class for all the music elements which are
playable (timeLength property is greater than 0). It also adds other properties
like the music length (whole, half, quarter etc.), number of dots and instead
of contexts, playable elements voices for their parent objects.
Notes and rests inherit this class.
\sa CAMusElement, CAPlayableLength| CAPlayable::CAPlayable | ( | CAPlayableLength | length, |
| CAVoice * | voice, | ||
| int | timeStart, | ||
| int | timeLength = -1 |
||
| ) |
Creates a new playable element with playable length length, voice, timeStart and number of dots dotted.
References calculateTimeLength(), setPlayableLength(), setTuplet(), and setVoice().

| CAPlayable::~CAPlayable | ( | ) | [virtual] |
Destroys the playable element.
The element is removed from any voice, if part of.
References CAVoice::remove(), CATuplet::removeNote(), tuplet(), and voice().

| void CAPlayable::calculateTimeLength | ( | ) |
Calculates the new timeLength depending on the playableLength.
Tuplets and other time transformations are not recognized.
References playableLength(), CAPlayableLength::playableLengthToTimeLength(), and CAMusElement::setTimeLength().
Referenced by CAPlayable(), CACanorusMLImport::endElement(), CAMainWin::on_uiPlayableLength_toggled(), resetTime(), and CAMainWin::scoreViewPortKeyPress().


| virtual CAPlayable* CAPlayable::clone | ( | CAContext * | context | ) | [inline, virtual] |
Clones a music element with exact properties including the context.
Implements CAMusElement.
References clone(), and CAMusElement::setContext().
Referenced by clone(), CAStaff::clone(), and CAMainWin::copySelection().


| virtual CAPlayable* CAPlayable::clone | ( | CAVoice * | voice = 0 | ) | [pure virtual] |
| bool CAPlayable::isFirstInTuplet | ( | ) | [inline] |
References _tuplet, and CATuplet::firstNote().
Referenced by CALilyPondExport::exportPlayable(), CACanorusMLExport::exportVoiceImpl(), and CAKeybdInput::midiInEventToScore().


| bool CAPlayable::isLastInTuplet | ( | ) | [inline] |
References _tuplet, and CATuplet::lastNote().
Referenced by CAStaff::clone(), and CALilyPondExport::exportPlayable().


| CAPlayableLength& CAPlayable::playableLength | ( | ) | [inline] |
References _playableLength.
Referenced by CAVoice::addNoteToChord(), CADrawableNote::CADrawableNote(), CADrawableRest::CADrawableRest(), calculateTimeLength(), CARest::clone(), CANote::clone(), CARest::compare(), CANote::compare(), CAMainWin::deleteSelection(), CADrawableRest::draw(), CADrawableNote::draw(), CALilyPondExport::exportPlayable(), CACanorusMLExport::exportVoiceImpl(), CAMainWin::scoreViewPortKeyPress(), and CAMainWin::updatePlayableToolBar().

| void CAPlayable::resetTime | ( | ) |
Calculates both the new timeLength and timeStart according to the playableLength and the previous playable element timeEnd.
Element should be part of the voice.
Tuplets and other time transformations are not recognized.
References calculateTimeLength(), CAMusElement::setTimeStart(), CAMusElement::timeEnd(), CAMusElement::timeStart(), and voice().

| void CAPlayable::setPlayableLength | ( | CAPlayableLength & | l | ) | [inline] |
References _playableLength.
Referenced by CAVoice::addNoteToChord(), CAPlayable(), CACanorusMLImport::endElement(), and CAMainWin::on_uiPlayableLength_toggled().

| void CAPlayable::setTuplet | ( | CATuplet * | t | ) | [inline] |
References _tuplet.
Referenced by CAPlayable(), CAMainWin::deleteSelection(), CAVoice::insertInTupletAndVoiceAt(), and CACanorusMLImport::startElement().

| void CAPlayable::setVoice | ( | CAVoice * | v | ) |
References CAMusElement::_context, _voice, CAVoice::staff(), and voice().
Referenced by CAPlayable().


| CAStaff* CAPlayable::staff | ( | ) | [inline] |
References CAMusElement::_context.
Referenced by CANote::actualStemDirection(), CAMainWin::deleteSelection(), CALilyPondImport::importVoiceImpl(), CAMainWin::on_uiPlayableLength_toggled(), CAMusElementFactory::placeAutoBar(), CAMainWin::scoreViewPortKeyPress(), and CACanorusMLImport::startElement().

| CATuplet* CAPlayable::tuplet | ( | ) | [inline] |
References _tuplet.
Referenced by CAStaff::clone(), CAMainWin::copySelection(), CAMainWin::deleteSelection(), CACanorusMLImport::endElement(), CALilyPondExport::exportPlayable(), CACanorusMLExport::exportVoiceImpl(), CAVoice::insertInTupletAndVoiceAt(), CAKeybdInput::midiInEventToScore(), CAMainWin::pasteAt(), CAVoice::remove(), and ~CAPlayable().

| CAVoice* CAPlayable::voice | ( | ) | [inline] |
References _voice.
Referenced by CANote::actualSlurDirection(), CANote::actualStemDirection(), CARest::composeRests(), CAMainWin::copySelection(), CAMainWin::deleteSelection(), CANote::getChord(), CAVoice::insertInTupletAndVoiceAt(), CAMainWin::insertMusElementAt(), CANote::isFirstInChord(), CANote::isLastInChord(), CANote::isPartOfChord(), CANote::notePosition(), CAMainWin::on_uiPlayableLength_toggled(), CAMusElementFactory::placeAutoBar(), CAPlayback::playSelectionImpl(), resetTime(), CAPlayback::run(), CAMainWin::scoreViewPortKeyPress(), setVoice(), CAMainWin::updatePlayableToolBar(), CANote::updateTies(), and ~CAPlayable().

CAPlayableLength CAPlayable::_playableLength [protected] |
Referenced by CANote::noteLength(), playableLength(), and setPlayableLength().
CATuplet* CAPlayable::_tuplet [protected] |
Referenced by isFirstInTuplet(), isLastInTuplet(), setTuplet(), and tuplet().
CAVoice* CAPlayable::_voice [protected] |
Referenced by setVoice(), and voice().
1.8.0