Main Page | Modules | Class Hierarchy | Class List | File List | Class Members | Related Pages

MusicSymbol Class Reference
[Musical Symbols]

#include <MusicSymbol.h>

Inheritance diagram for MusicSymbol:

BeamMS BraceMS CrossMS FifthsMS GraceSimpleStemMS GroupedStemsMS Half LyricMS MeasureSymbol SimpleMusicSymbol SimpleStemMS SlurMS TextSymbol TimeSymbol VerticalLineSymbol VoidSymbol List of all members.

Public Member Functions

MusicSymbolgetAttachedSymbol ()
void attachMusicSymbol (MusicSymbol *)
 MusicSymbol (QString name, float x, float y)
virtual void draw (Painter *)=0
virtual QString name ()
virtual QPoint getHotSpot ()
void setMark (QString)
virtual double getX ()
double getY ()
virtual void setX (double)
void setY (double)
void setIndexNoteMusic (void *)
void * getIndexNoteMusic ()
int getLineIndex ()
void setLineIndex (int)
int getPageIndex ()
void setPageIndex (int)
bool collide (MusicSymbol *)
virtual CollidergetCollider ()=0
QString getMark ()
double length ()
virtual QString toString ()
double xCollision ()
double yCollision ()
void drawTrajectory (Painter *)

Static Public Attributes

long nbcollisiondetectioncount = 0

Protected Attributes

MusicSymbolattachedSymbol
float x
float y
QString mark
double naturalLength
double graphicLength
double beginModifier
void * indexNoteMusic
int lineIndex
int pageIndex

Detailed Description

This class is inherited by every musical representation.

Todo:
*


Constructor & Destructor Documentation

MusicSymbol::MusicSymbol QString  n,
float  px,
float  py
 

Parameters:
name The name of the music Symbol
px x Coordinate
py y Coordinate
*


Member Function Documentation

void MusicSymbol::attachMusicSymbol MusicSymbol ms  ) 
 

This function attach a music symbol to the note head (Flat,Sharp, Neutral etc.) Maybe there could be several attached notes and this function will require other developpements

Parameters:
ms the music symbol you want to attach to the music symbol.

bool MusicSymbol::collide MusicSymbol ms  ) 
 

We test the collision of two symbol.

like stems could not be transformed

Returns:
true if the symbols collide with the arg musicSymbol

void MusicSymbol::draw Painter p  )  [pure virtual]
 

This method draw is defined but useless if we define it as pure virtual (As it should be)

Implemented in BeamMS, SlurMS, SmallClefSol, SmallClefFa, TimeSymbol, FifthsMS, CrossMS, BraceMS, LyricMS, MeasureSymbol, VerticalLineSymbol, SimpleMusicSymbol, VoidSymbol, Half, NoteHMS, SimpleStemMS, GraceSimpleStemMS, GroupedStemsMS, and TextSymbol.

void MusicSymbol::drawTrajectory Painter p  ) 
 

This draw the trajectory point this function is avalaible only if compiled with the DRAWTRAJECTORY, it shows the trajectory of the symbol before it is placed. A point is appended at the construction. Each time the setX or setY function is called, a point is appended to the vectors. The number of items in the xtrajectory vector and in the ytrajectory vector should be the same, but this is only warranted with the construction process. option set

MusicSymbol * MusicSymbol::getAttachedSymbol  ) 
 

Returns:
the attached symbol (A sharp, a flat etc.
Warning:
Do not use this function to perform your move. If you dont change the attachement distance from the Music Symbol. You should only call this function if you want to change the distance of the attached music symbol from the music symbol.

Collider * MusicSymbol::getCollider  )  [pure virtual]
 

Returns:
0 This méthod should be always overrided but we did not make it pure virtual to give this ASAP.

Implemented in BeamMS, SlurMS, TimeSymbol, FifthsMS, CrossMS, BraceMS, LyricMS, MeasureSymbol, VerticalLineSymbol, SimpleMusicSymbol, VoidSymbol, NoteHMS, SimpleStemMS, GraceSimpleStemMS, GroupedStemsMS, and TextSymbol.

QPoint MusicSymbol::getHotSpot  )  [virtual]
 

Returns:
the hot spot point of the music Symbol
Todo:
Make this function be pure abstract *

Reimplemented in MeasureSymbol, and SimpleMusicSymbol.

void * MusicSymbol::getIndexNoteMusic  ) 
 

Get the index of the noteMusic this is not typed to keep the separation clear between class sets

Returns:
a pointer to the note music

int MusicSymbol::getLineIndex  ) 
 

get the line index the line index

QString MusicSymbol::getMark  ) 
 

This function is useful for debug. A mark allow a music symbol to be localized on the page

int MusicSymbol::getPageIndex  ) 
 

get the line index the line index

double MusicSymbol::getX  )  [virtual]
 

Returns:
x

Reimplemented in NoteHMS.

double MusicSymbol::getY  ) 
 

Returns:
y of the music Symbol.

double MusicSymbol::length  ) 
 

Returns:
the maximum of graphical length and natural length

QString MusicSymbol::name  )  [virtual]
 

cette méthode est définie mais elle ne sert pas et il faudra la supprimer

void MusicSymbol::setIndexNoteMusic void *  p  ) 
 

Set the index of the noteMusic this is not typed to keep the separation clear between class sets

Parameters:
p a pointer to the note music

void MusicSymbol::setLineIndex int  i  ) 
 

Set the line index (For slur representation)

void MusicSymbol::setMark QString  n  ) 
 

This function is useful for debug. A mark allow a music symbol to be localized on the page

Parameters:
n is the text of the mark

void MusicSymbol::setPageIndex int  i  ) 
 

Set the line index (For slur representation)

void MusicSymbol::setX double  d  )  [virtual]
 

Sets the x position : Usefull for the expansion of the MS along the time line. If there is a symbol attached to the music symbol we keep the same distance from it

Reimplemented in NoteHMS.

void MusicSymbol::setY double  d  ) 
 

Sets the y position : Usefull for the resolution of the collision.

QString MusicSymbol::toString  )  [virtual]
 

For many symbols this function should be overrided.

Returns:
a string reprentation of the MusicSymbol (For a debug purpose).

Reimplemented in SlurMS, LyricMS, NoteHMS, and GroupedStemsMS.

double MusicSymbol::xCollision  ) 
 

Returns:
the x coord a a collision

double MusicSymbol::yCollision  ) 
 

Returns:
the y coord a collision


Member Data Documentation

double MusicSymbol::beginModifier [protected]
 

This make sense only to the subclass of music symbol that can be altered (Note and rests)

double MusicSymbol::graphicLength [protected]
 

The lenght that a symbol drawn berfore the skip of this length leads to a superposition of the symbol

double MusicSymbol::naturalLength [protected]
 

The natural length is used for the subclass of music symbol to which it make sense otherwhise it is set to 0


The documentation for this class was generated from the following files:
Generated on Tue Jun 1 21:13:34 2004 for Alternate Take by doxygen 1.3.6