Canorus 0.0
Public Member Functions | Protected Attributes | List of all members
CAPlayable Class Referenceabstract

Playable instances of music elements. More...

#include <playable.h>

Inheritance diagram for CAPlayable:
Inheritance graph
[legend]

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 ()
 
- Public Member Functions inherited from CAMusElement
 CAMusElement (CAContext *context, int timeStart, int timeLength=0)
 
virtual ~CAMusElement ()
 
virtual CAMusElementclone (CAContext *context=0)=0
 
virtual int compare (CAMusElement *elt)=0
 
CAMusElementType musElementType ()
 
CAContextcontext ()
 
void setContext (CAContext *context)
 
virtual int timeStart () const
 
void setTimeStart (int time)
 
virtual int timeLength () const
 
void setTimeLength (int length)
 
int timeEnd ()
 
virtual int realTimeStart ()
 
virtual int realTimeLength ()
 
int realTimeEnd ()
 
const QString name ()
 
void setName (const QString name)
 
const bool isVisible ()
 
void setVisible (const bool v)
 
const QColor color ()
 
void setColor (const QColor c)
 
const QList< CAMark * > markList ()
 
void addMark (CAMark *mark)
 
void addMarks (QList< CAMark * > marks)
 
void removeMark (CAMark *mark)
 
const QList< CANoteCheckerError * > & noteCheckerErrorList ()
 
void addNoteCheckerError (CANoteCheckerError *nce)
 
void removeNoteCheckerError (CANoteCheckerError *nce)
 
bool isPlayable ()
 

Protected Attributes

CAPlayableLength _playableLength
 
CAVoice_voice
 
CATuplet_tuplet
 
- Protected Attributes inherited from CAMusElement
CAMusElementType _musElementType
 
QList< CAMark * > _markList
 
QList< CANoteCheckerError * > _noteCheckerErrorList
 
CAContext_context
 
int _timeStart
 
int _timeLength
 
bool _visible
 
QColor _color
 
QString _name
 

Additional Inherited Members

- Public Types inherited from CAMusElement
enum  CAMusElementType {
  Undefined = 0 , Note , Rest , MidiNote ,
  Barline , Clef , TimeSignature , KeySignature ,
  Slur , Tuplet , Syllable , FunctionMark ,
  FiguredBassMark , Mark
}
 
- Static Public Member Functions inherited from CAMusElement
static const QString musElementTypeToString (CAMusElementType)
 
static CAMusElementType musElementTypeFromString (const QString)
 
- Protected Member Functions inherited from CAMusElement
void setMusElementType (CAMusElementType type)
 

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.

See also
CAMusElement, CAPlayableLength

Constructor & Destructor Documentation

◆ CAPlayable()

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(), setVoice(), CAMusElement::timeLength(), and voice().

Here is the call graph for this function:

◆ ~CAPlayable()

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

◆ calculateTimeLength()

void CAPlayable::calculateTimeLength ( )

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

Here is the call graph for this function:
Here is the caller graph for this function:

◆ clone() [1/2]

virtual CAPlayable * CAPlayable::clone ( CAContext context)
inlinevirtual

Clones a music element with exact properties including the context.

Implements CAMusElement.

References clone(), CAMusElement::context(), and CAMusElement::setContext().

Referenced by clone(), CAStaff::clone(), CAMainWin::copySelection(), and CAMainWin::pasteAt().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ clone() [2/2]

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

Implemented in CAMidiNote, CANote, and CARest.

◆ isFirstInTuplet()

bool CAPlayable::isFirstInTuplet ( )
inline

References _tuplet, and CATuplet::firstNote().

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

Here is the call graph for this function:
Here is the caller graph for this function:

◆ isLastInTuplet()

bool CAPlayable::isLastInTuplet ( )
inline

References _tuplet, and CATuplet::lastNote().

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

Here is the call graph for this function:
Here is the caller graph for this function:

◆ playableLength()

CAPlayableLength & CAPlayable::playableLength ( )
inline

◆ resetTime()

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.

See also
calculateTimeLength()

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

Here is the call graph for this function:

◆ setPlayableLength()

void CAPlayable::setPlayableLength ( CAPlayableLength l)
inline

References _playableLength.

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

Here is the caller graph for this function:

◆ setTuplet()

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:

◆ setVoice()

void CAPlayable::setVoice ( CAVoice v)

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:

◆ staff()

CAStaff * CAPlayable::staff ( )
inline

◆ tuplet()

CATuplet * CAPlayable::tuplet ( )
inline

◆ voice()

CAVoice * CAPlayable::voice ( )
inline

Member Data Documentation

◆ _playableLength

CAPlayableLength CAPlayable::_playableLength
protected

◆ _tuplet

CATuplet* CAPlayable::_tuplet
protected

◆ _voice

CAVoice* CAPlayable::_voice
protected

Referenced by setVoice(), and voice().


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