Canorus  0.0
Public Types | Public Member Functions | Static Public Member Functions | Private Attributes | List of all members
CATimeSignature Class Reference

Represents a time signature in the staff. More...

#include <timesignature.h>

Inheritance diagram for CATimeSignature:
Inheritance graph
[legend]

Public Types

enum  CATimeSignatureType {
  Classical, Number, Mensural, Neomensural,
  Baroque
}
 
- Public Types inherited from CAMusElement
enum  CAMusElementType {
  Undefined = 0, Note, Rest, MidiNote,
  Barline, Clef, TimeSignature, KeySignature,
  Slur, Tuplet, Syllable, FunctionMark,
  FiguredBassMark, Mark
}
 

Public Member Functions

 CATimeSignature (int beats, int beat, CAStaff *staff, int startTime, CATimeSignatureType type=Classical)
 
CATimeSignatureclone (CAContext *context=0)
 
 ~CATimeSignature ()
 
CAStaffstaff ()
 
int beats ()
 
void setBeats (int beats)
 
int beat ()
 
void setBeat (int beat)
 
int barDuration ()
 
CATimeSignatureType timeSignatureType ()
 
const QString timeSignatureML ()
 
const QString timeSignatureTypeML ()
 
int compare (CAMusElement *elt)
 
- Public Member Functions inherited from CAMusElement
 CAMusElement (CAContext *context, int timeStart, int timeLength=0)
 
virtual ~CAMusElement ()
 
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 ()
 

Static Public Member Functions

static const QString timeSignatureTypeToString (CATimeSignatureType)
 
static CATimeSignatureType timeSignatureTypeFromString (const QString)
 
- Static Public Member Functions inherited from CAMusElement
static const QString musElementTypeToString (CAMusElementType)
 
static CAMusElementType musElementTypeFromString (const QString)
 

Private Attributes

int _beats
 
int _beat
 
CATimeSignatureType _timeSignatureType
 

Additional Inherited Members

- Protected Member Functions inherited from CAMusElement
void setMusElementType (CAMusElementType type)
 
- 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
 

Detailed Description

Represents a time signature in the staff.

Copyright (c) 2006-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 is used for different time signatures in the score. Every staff has its own time signature object. Time signatures are non-playable objects (timeLength=0) aka signs. Time signature object is common to all the voices in one staff

Time signature consists of the upper number - number of beats and the lower number - beat. Internal values _beats and _beat represent these values.

See also
CADrawableTimeSignature, CAKeySignature, CAClef, CAStaff

Member Enumeration Documentation

◆ CATimeSignatureType

Type of time signature to be shown.

Possible options:

  • Classical C for 4/4, C| for 2/2, numbers otherwise. This is default behaviour.
  • Number Always show beats/beat, for 4/4 as well
  • Mensural Taken from LilyPond. Mensural layout.
  • Neomensural Taken from LilyPond. Neomensural layout.
  • Baroque Taken from LilyPond. Baroque layout.
See also
timeSignatureType()
Enumerator
Classical 
Number 
Mensural 
Neomensural 
Baroque 

Constructor & Destructor Documentation

◆ CATimeSignature()

CATimeSignature::CATimeSignature ( int  beats,
int  beat,
CAStaff staff,
int  startTime,
CATimeSignatureType  type = Classical 
)

Creates a time signature with a beat beat, number of beats beats, parent staff, startTime and of given type.

eg. 3/4 time signature should be called new CATimeSignature(3, 4, staff, startTime);

References _beat, _beats, CAMusElement::_musElementType, _timeSignatureType, beat(), beats(), and CAMusElement::TimeSignature.

Referenced by clone().

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

◆ ~CATimeSignature()

CATimeSignature::~CATimeSignature ( )

Member Function Documentation

◆ barDuration()

int CATimeSignature::barDuration ( )

Returns the duration of a full measure in time units.

References _beat, _beats, and CAPlayableLength::musicLengthToTimeLength().

Referenced by CAScoreView::computeBarlinePositions(), and CAStaff::placeAutoBar().

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

◆ beat()

CATimeSignature::beat ( )
inline

◆ beats()

CATimeSignature::beats ( )
inline

◆ clone()

CATimeSignature * CATimeSignature::clone ( CAContext context = 0)
virtual

Clones a music element with exact properties including the context.

Implements CAMusElement.

References _beat, _beats, _timeSignatureType, CAMusElement::_timeStart, CAMusElement::addMark(), CATimeSignature(), CAMusElement::context(), and CAMusElement::markList().

Here is the call graph for this function:

◆ compare()

int CATimeSignature::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 _beat, _beats, _timeSignatureType, beat(), beats(), CAMusElement::musElementType(), CAMusElement::TimeSignature, and timeSignatureType().

Here is the call graph for this function:

◆ setBeat()

CATimeSignature::setBeat ( int  beat)
inline

Sets the beat to beat for this time signature.

See also
beat(), _beat, _beats

References _beat, and beat().

Referenced by CAMainWin::on_uiTimeSigBeat_valueChanged().

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

◆ setBeats()

CATimeSignature::setBeats ( int  beats)
inline

Sets the number of beats to beats for this time signature.

See also
beats(), _beats, _beat

References _beats, and beats().

Referenced by CAMainWin::on_uiTimeSigBeats_valueChanged().

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

◆ staff()

CAStaff* CATimeSignature::staff ( )
inline

References CAMusElement::context().

Here is the call graph for this function:

◆ timeSignatureML()

const QString CATimeSignature::timeSignatureML ( )
Deprecated:
New CanorusML parser uses beat and beats directly as integer. The following code should be moved to LilyPond parser. -Matevz

References _beat, and _beats.

◆ timeSignatureType()

CATimeSignature::timeSignatureType ( )
inline

Returns type of the time signature.

See also
_timeSignatureType, CATimeSignatureType

References _timeSignatureType.

Referenced by compare(), and CACanorusMLExport::exportVoiceImpl().

Here is the caller graph for this function:

◆ timeSignatureTypeFromString()

CATimeSignature::CATimeSignatureType CATimeSignature::timeSignatureTypeFromString ( const QString  type)
static

References Baroque, Classical, Mensural, Neomensural, and Number.

Referenced by CACanorusMLImport::startElement().

Here is the caller graph for this function:

◆ timeSignatureTypeML()

const QString CATimeSignature::timeSignatureTypeML ( )
Deprecated:
Use timeSignatureTypeToString() instead. This should be moved to LilyPond parser. -Matevz

References _timeSignatureType, Baroque, Classical, Mensural, Neomensural, and Number.

◆ timeSignatureTypeToString()

const QString CATimeSignature::timeSignatureTypeToString ( CATimeSignatureType  type)
static

References Baroque, Classical, Mensural, Neomensural, and Number.

Referenced by CACanorusMLExport::exportVoiceImpl().

Here is the caller graph for this function:

Member Data Documentation

◆ _beat

CATimeSignature::_beat
private

Beat of this time signature. That's the lower number in the time signature.

See also
beat(), setBeat(), _beats

Referenced by barDuration(), beat(), CATimeSignature(), clone(), compare(), setBeat(), and timeSignatureML().

◆ _beats

CATimeSignature::_beats
private

Number of beats of this time signature. That's the upper number in the time signature.

See also
beats(), setBeats(), _beat

Referenced by barDuration(), beats(), CATimeSignature(), clone(), compare(), setBeats(), and timeSignatureML().

◆ _timeSignatureType

CATimeSignature::_timeSignatureType
private

Stores the type of the time signature.

See also
timeSignatureType(), CATimeSignatureType

Referenced by CATimeSignature(), clone(), compare(), timeSignatureType(), and timeSignatureTypeML().


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