Planeshift
Public Member Functions

Measure< MeasureElementType >::MeasureAttributes Class Reference

Keep general attributes that can change from a measure to another like key signature, beats and tempo. More...

#include <scoreelements.h>

List of all members.

Public Member Functions

int GetBeats () const
 Get the numerator of the time signature.
int GetBeatType () const
 Get the denominator of the time signature.
int GetFifths () const
 Get the tonality as the number of accidentals in the key signature.
int GetTempo () const
 Get the tempo.
bool IsUndefined () const
 Check if all attributes are undefined.
 MeasureAttributes ()
 Initialize all attributes to UNDEFINED_MEASURE_ATTRIBUTE.
void SetBeats (int beats)
 Set the numerator of the time signature.
void SetBeatType (int beatType)
 Set the denominator of the time signature.
void SetFifths (int fifths)
 Set the key signature as the number of accidentals.
void SetTempo (int tempo)
 Set the tempo.
void UpdateAttributes (const MeasureAttributes &attributes)
 Update the measure context with the attributes of the given measure.

Detailed Description

template<typename MeasureElementType>
class Measure< MeasureElementType >::MeasureAttributes

Keep general attributes that can change from a measure to another like key signature, beats and tempo.

Some attributes can be undefined. This means that the specific attribute takes the same value of the same attribute in the previous measure. Undefined attributes take the value UNDEFINED_MEASURE_ATTRIBUTE.

Definition at line 309 of file scoreelements.h.


Constructor & Destructor Documentation

template<typename MeasureElementType>
Measure< MeasureElementType >::MeasureAttributes::MeasureAttributes ( )

Initialize all attributes to UNDEFINED_MEASURE_ATTRIBUTE.


Member Function Documentation

template<typename MeasureElementType>
int Measure< MeasureElementType >::MeasureAttributes::GetBeats ( ) const [inline]

Get the numerator of the time signature.

Returns:
The numerator of the time signature.

Definition at line 322 of file scoreelements.h.

template<typename MeasureElementType>
int Measure< MeasureElementType >::MeasureAttributes::GetBeatType ( ) const [inline]

Get the denominator of the time signature.

Returns:
The denominator of the time signature.

Definition at line 329 of file scoreelements.h.

template<typename MeasureElementType>
int Measure< MeasureElementType >::MeasureAttributes::GetFifths ( ) const [inline]

Get the tonality as the number of accidentals in the key signature.

Returns:
The number of accidentals in the key signature. Positive for sharps, negative for flats.

Definition at line 337 of file scoreelements.h.

template<typename MeasureElementType>
int Measure< MeasureElementType >::MeasureAttributes::GetTempo ( ) const [inline]

Get the tempo.

Returns:
The tempo in quarter notes per minute.

Definition at line 344 of file scoreelements.h.

template<typename MeasureElementType>
bool Measure< MeasureElementType >::MeasureAttributes::IsUndefined ( ) const

Check if all attributes are undefined.

Returns:
True if all attributes are undefined, false otherwise.
template<typename MeasureElementType>
void Measure< MeasureElementType >::MeasureAttributes::SetBeats ( int  beats) [inline]

Set the numerator of the time signature.

Parameters:
beatsThe new numerator of the time signature.

Definition at line 358 of file scoreelements.h.

template<typename MeasureElementType>
void Measure< MeasureElementType >::MeasureAttributes::SetBeatType ( int  beatType) [inline]

Set the denominator of the time signature.

Parameters:
beatTypeThe new denominator of the time signature.

Definition at line 365 of file scoreelements.h.

template<typename MeasureElementType>
void Measure< MeasureElementType >::MeasureAttributes::SetFifths ( int  fifths) [inline]

Set the key signature as the number of accidentals.

Parameters:
fifthsThe number of accidentals in the key signature. Positive for sharps, negative for flats.

Definition at line 373 of file scoreelements.h.

template<typename MeasureElementType>
void Measure< MeasureElementType >::MeasureAttributes::SetTempo ( int  tempo) [inline]

Set the tempo.

Parameters:
tempoThe new tempo.

Definition at line 380 of file scoreelements.h.

template<typename MeasureElementType>
void Measure< MeasureElementType >::MeasureAttributes::UpdateAttributes ( const MeasureAttributes attributes)

Update the measure context with the attributes of the given measure.

Attributes that are undefined in the given object are not updated.

Parameters:
measureThe measure with the new attributes.

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