Planeshift
|
#include <pawssheetline.h>
Public Member Functions | |
Chord * | Advance (uint divisions) |
This function pushes a new empty chord at the end of the line and it returns. | |
SheetLine * | AttachNewLine (Measure *firstMeasure) |
If this is the last measure, this method creates a new empty line and attaches it after this one. | |
bool | Contains (Measure *measure) |
Check if this line contains the given measure. | |
void | DeleteMeasure (Measure *measure) |
Delete the given measure if it belongs to this line. | |
void | Draw (pawsSheetLine *pawsLine, Chord *selectedChord, int startPosition, int height) |
Draws this line. | |
Measure * | GetFirstMeasure () |
Returns the first measure of the line. | |
Measure * | GetLastMeasure () |
Returns the last measure of the line. | |
bool | HasFirstMeasure () |
Returns true if this line contains the first measure. | |
bool | HasLastMeasure () |
Returns true if this line contains the last measure. | |
bool | Hit (int x, Chord *&chord, Measure *&measure, bool &before) |
Check if a chord in this line is hit and return the chord and its measure. | |
Measure * | InsertNewMeasure (Measure *measureAfter) |
Inserts a new measure before the given one. | |
SheetLine * | Next () |
Returns the next SheetLine. | |
SheetLine * | Prev () |
Returns the previous SheetLine. | |
void | PushMeasure (Measure *measure) |
Push a measure at the end of the line. | |
bool | Resize () |
Fixes the measures of this line and their size. | |
void | ResizeAll (bool forceAll=false) |
Fixes the measures and their size of this line and all the following. | |
void | SetCallback (void *object, void(*function)(void *, SheetLine *)) |
Sets the callback function that will be called when a new sheet line is added or deleted. | |
bool | SetSize (uint size, pawsSheetLine *pawsLine) |
Set the size and drawing parameters for this line. | |
SheetLine (Measure *firstMeasure) | |
Constructor. | |
~SheetLine () | |
Destructor. |
Definition at line 473 of file pawssheetline.h.
SheetLine::SheetLine | ( | Measure * | firstMeasure | ) |
Constructor.
firstMeasure | the first measure of the SheetLine. |
SheetLine::~SheetLine | ( | ) |
Destructor.
It does not delete its measures.
Chord* SheetLine::Advance | ( | uint | divisions | ) |
This function pushes a new empty chord at the end of the line and it returns.
It should be called only to move the final cursor forward. If the line is completed, it creates a new line.
divisions | the number of sixteenths per measure. |
If this is the last measure, this method creates a new empty line and attaches it after this one.
The new line has the same size and the same callback as this one.
firstMeasure | the first measure of the new line. |
bool SheetLine::Contains | ( | Measure * | measure | ) |
Check if this line contains the given measure.
measure | the measure to look for. |
void SheetLine::DeleteMeasure | ( | Measure * | measure | ) |
Delete the given measure if it belongs to this line.
If it is the last measure, the method just empties it.
measure | the measure to delete. |
void SheetLine::Draw | ( | pawsSheetLine * | pawsLine, |
Chord * | selectedChord, | ||
int | startPosition, | ||
int | height | ||
) |
Draws this line.
pawsLine | the pawsSheetLine that store the font-dependent parameters. |
selectedChord | the current selected chord. |
startPosition | the horizontal position where the first measure must be drawn. |
height | the height of the staff. |
Measure* SheetLine::GetFirstMeasure | ( | ) | [inline] |
Returns the first measure of the line.
Definition at line 522 of file pawssheetline.h.
Measure* SheetLine::GetLastMeasure | ( | ) | [inline] |
Returns the last measure of the line.
Definition at line 528 of file pawssheetline.h.
bool SheetLine::HasFirstMeasure | ( | ) | [inline] |
Returns true if this line contains the first measure.
Definition at line 503 of file pawssheetline.h.
bool SheetLine::HasLastMeasure | ( | ) | [inline] |
Returns true if this line contains the last measure.
Definition at line 509 of file pawssheetline.h.
Check if a chord in this line is hit and return the chord and its measure.
x | the horizontal position of the input from the beginning of the line. |
chord | at the end this pointer will contain the hit chord or null if any chord has been hit. |
measure | at the end this pointer will contain the measure containing the hit chord or a null pointer if nothing is hit. |
before | at the end this boolean will be true if the click has happened before the selected chord, false if after. |
Inserts a new measure before the given one.
measureAfter | the measure after the new one. |
SheetLine* SheetLine::Next | ( | ) | [inline] |
Returns the next SheetLine.
Definition at line 491 of file pawssheetline.h.
SheetLine* SheetLine::Prev | ( | ) | [inline] |
Returns the previous SheetLine.
Definition at line 497 of file pawssheetline.h.
void SheetLine::PushMeasure | ( | Measure * | measure | ) |
Push a measure at the end of the line.
After this method a resize should be done.
measure | the measure to push. |
bool SheetLine::Resize | ( | ) |
Fixes the measures of this line and their size.
void SheetLine::ResizeAll | ( | bool | forceAll = false | ) |
Fixes the measures and their size of this line and all the following.
forceAll | if true all the sheet lines are resized, otherwise it continues only until the last measure is the same as before the resize. |
void SheetLine::SetCallback | ( | void * | object, |
void(*)(void *, SheetLine *) | function | ||
) |
Sets the callback function that will be called when a new sheet line is added or deleted.
object | the callback object. |
function | the callback function. |
bool SheetLine::SetSize | ( | uint | size, |
pawsSheetLine * | pawsLine | ||
) |
Set the size and drawing parameters for this line.
size | the new size. |
pawsLine | the pawsSheetLine with the drawing parameters. |