Canorus  0.7
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Member Functions | Protected Attributes
CAPlayable Class Reference

Playable instances of music elements. More...

#include <playable.h>

Inheritance diagram for CAPlayable:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 CAPlayable (CAPlayableLength length, CAVoice *voice, int timeStart, int timeLength=-1)
virtual ~CAPlayable ()
CAPlayableLengthplayableLength ()
void setPlayableLength (CAPlayableLength &l)
virtual CAPlayableclone (CAContext *context)
virtual CAPlayableclone (CAVoice *voice=0)=0
CATuplettuplet ()
void setTuplet (CATuplet *t)
CAVoicevoice ()
void setVoice (CAVoice *v)
CAStaffstaff ()
bool isFirstInTuplet ()
bool isLastInTuplet ()
void resetTime ()
void calculateTimeLength ()

Protected Attributes

CAPlayableLength _playableLength
CAVoice_voice
CATuplet_tuplet

Detailed Description

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

Constructor & Destructor Documentation

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.

See also:
CAPlayableLength, CAVoice, CAMusElement

References calculateTimeLength(), setPlayableLength(), setTuplet(), and setVoice().

Here is the call graph for this function:

CAPlayable::~CAPlayable ( ) [virtual]

Destroys the playable element.

The element is removed from any voice, if part of.

Note:
Non-playable signs are not shifted back when removing the element from the voice.

References CAVoice::remove(), CATuplet::removeNote(), tuplet(), and voice().

Here is the call graph for this function:


Member Function Documentation

Calculates the new timeLength depending on the playableLength.

Tuplets and other time transformations are not recognized.

See also:
playableLength(), resetTime()

References playableLength(), CAPlayableLength::playableLengthToTimeLength(), and CAMusElement::setTimeLength().

Referenced by CAPlayable(), CACanorusMLImport::endElement(), CAMainWin::on_uiPlayableLength_toggled(), resetTime(), and CAMainWin::scoreViewPortKeyPress().

Here is the call graph for this function:

Here is the caller graph for this function:

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().

Here is the call graph for this function:

Here is the caller graph for this function:

virtual CAPlayable* CAPlayable::clone ( CAVoice voice = 0) [pure virtual]

Implemented in CANote, and CARest.

bool CAPlayable::isFirstInTuplet ( ) [inline]

References _tuplet, and CATuplet::firstNote().

Referenced by CALilyPondExport::exportPlayable(), CACanorusMLExport::exportVoiceImpl(), and CAKeybdInput::midiInEventToScore().

Here is the call graph for this function:

Here is the caller graph for this function:

bool CAPlayable::isLastInTuplet ( ) [inline]

References _tuplet, and CATuplet::lastNote().

Referenced by CAStaff::clone(), and CALilyPondExport::exportPlayable().

Here is the call graph for this function:

Here is the caller graph for this function:

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.

See also:
calculateTimeLength()

References calculateTimeLength(), CAMusElement::setTimeStart(), CAMusElement::timeEnd(), CAMusElement::timeStart(), and voice().

Here is the call graph for this function:

References _playableLength.

Referenced by CAVoice::addNoteToChord(), CAPlayable(), CACanorusMLImport::endElement(), and CAMainWin::on_uiPlayableLength_toggled().

Here is the caller graph for this function:

void CAPlayable::setTuplet ( CATuplet t) [inline]

References _tuplet.

Referenced by CAPlayable(), CAMainWin::deleteSelection(), CAVoice::insertInTupletAndVoiceAt(), and CACanorusMLImport::startElement().

Here is the caller graph for this function:

References CAMusElement::_context, _voice, CAVoice::staff(), and voice().

Referenced by CAPlayable().

Here is the call graph for this function:

Here is the caller graph for this function:

CAStaff* CAPlayable::staff ( ) [inline]
CAVoice* CAPlayable::voice ( ) [inline]

Member Data Documentation

Referenced by setVoice(), and voice().


The documentation for this class was generated from the following files: