Planeshift
Public Member Functions

Chord Class Reference

#include <pawssheetline.h>

List of all members.

Public Member Functions

void AddNote (int position, int alter, bool isRest)
 Adds a note to the chord.
void AddNote (csRef< iDocumentNode > pitch)
 Adds a not-rest note to this chord from a <pitch> XML node.
void AttachChord (Chord *chord)
 Inserts the given chord after this one.
 Chord ()
 Constructor.
 Chord (Chord *chord)
 Copy constructor.
void Draw (pawsSheetLine *pawsLine, Chord *selectedChord, int horizontalPos)
 Draws this chord.
void Empty ()
 Deletes all the notes in the chord.
int GetDuration ()
 Gets the duration of this chord.
bool IsEmpty ()
 Returns true if there are not notes in this chord.
bool IsRest ()
 Return true if this chord is a rest, false otherwise.
ChordNext ()
 Returns the next Chord.
ChordPrev ()
 Returns the previous Chord.
void SetDuration (int duration)
 Sets the duration of this chord.
csString ToXML ()
 Write this chord as a <note> XML node.
 ~Chord ()
 Destructor.

Detailed Description

Definition at line 84 of file pawssheetline.h.


Constructor & Destructor Documentation

Chord::Chord ( )

Constructor.

Default duration is a quarter.

Chord::Chord ( Chord chord)

Copy constructor.

It copies notes and duration.

Parameters:
chordthe Chord to copy.
Chord::~Chord ( )

Destructor.

It removes itself from the list.


Member Function Documentation

void Chord::AddNote ( int  position,
int  alter,
bool  isRest 
)

Adds a note to the chord.

If a note in the same position already exists this overwrites it (i.e. the alteration of the note is updated with the new one). If the added note is a rest and there are already other notes in the chord, these are deleted from the chord. Viceversa if the added note is not a rest and there is already a rest in the chord, the rest is removed.

Parameters:
positionthe position where the note (or the rest) must be drawn.
alterthe alteration of the note (-1 flat, 0 normal, 1 sharp).
isResttrue if it is a rest.
void Chord::AddNote ( csRef< iDocumentNode >  pitch)

Adds a not-rest note to this chord from a <pitch> XML node.

Parameters:
pitchthe <pitch> XML node.
void Chord::AttachChord ( Chord chord)

Inserts the given chord after this one.

Parameters:
chordthe chord to insert.
void Chord::Draw ( pawsSheetLine pawsLine,
Chord selectedChord,
int  horizontalPos 
)

Draws this chord.

Parameters:
pawsLinethe pawsSheetLine that store the font-dependent parameters.
selectedChordthe current selected chord.
horizontalPosthe horizontal position of the chord.
void Chord::Empty ( )

Deletes all the notes in the chord.

int Chord::GetDuration ( ) [inline]

Gets the duration of this chord.

Returns:
the duration of this chord.

Definition at line 137 of file pawssheetline.h.

bool Chord::IsEmpty ( ) [inline]

Returns true if there are not notes in this chord.

Returns:
true if this chord is empty, false otherwise.

Definition at line 130 of file pawssheetline.h.

bool Chord::IsRest ( ) [inline]

Return true if this chord is a rest, false otherwise.

Returns:
true if this is a rest.

Definition at line 123 of file pawssheetline.h.

Chord* Chord::Next ( ) [inline]

Returns the next Chord.

Returns:
the next Chord.

Definition at line 109 of file pawssheetline.h.

Chord* Chord::Prev ( ) [inline]

Returns the previous Chord.

Returns:
the previous Chord.

Definition at line 116 of file pawssheetline.h.

void Chord::SetDuration ( int  duration)

Sets the duration of this chord.

Parameters:
durationone of the values of the enum Duration.
csString Chord::ToXML ( )

Write this chord as a <note> XML node.

Returns:
the <note> XML node.

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