Lomse library. API documentation
0.30.0
|
#include <lomse_fragment_mark.h>
FragmentMark is an ApplicationMark to display on any score brackets and vertical lines, spanning one or several staves, to define the start and end points of a score section or fragment.
FragmentMark objects are created by the Interactor associated to the View on which the mark is going to be displayed.
See:
The following picture displays the different types of FragmentMark markers that can be created. The markers were created with the code shown at the end of this description.
Marks of type k_mark_line
are positioned centered on the reference timepos vertical line.
For all other types:
open
are displayed with the inner bracket vertical border aligned with the timepos vertical line.close
are displayed with the outside bracket vertical border aligned with the timepos vertical line.It is possible to add an horizontal shift to the mark default position. See x_shift(). The horizontal shift can be modified when necessary.
But marks cannot be repositioned, that is, its reference timepos can not be changed. If this is needed, just delete current mark (by invoking Interactor::remove_mark() ) and create a new one at the new desired position.
By default, the mark will cover the whole staff from top line of first staff to bottom line of bottom staff, plus an additional height of the spacing between systems (half is added on top and half on bottom). This additional height to add can be chaged by method extra_height().
Methods top() and bottom() allows to define the vertical position and height of the mark by defining the reference instruments and staves that will be covered by the mark. When using any of these methods, the additional height will be changed to be the staves margin. You can later change this value by using method extra_height().
The height and vertical position of the mark can be changed at any moment. See top(), bottom() and extra_height() methods.
The marks in previous image were created with this code:
Public Member Functions | |
Customizable properties | |
FragmentMark * | x_shift (Tenths dx) |
FragmentMark * | top (int instr, int staff=0) |
FragmentMark * | bottom (int instr, int staff=-1) |
FragmentMark * | extra_height (Tenths value=0) |
FragmentMark * | color (Color value) |
FragmentMark * | type (EFragmentMark value) |
FragmentMark * | thickness (Tenths value) |
FragmentMark * | line_style (ELineStyle value) |
Access to current values | |
Color | get_color () const |
EFragmentMark | get_type () const |
ELineStyle | get_line_style () const |
FragmentMark* FragmentMark::bottom | ( | int | instr, |
int | staff = -1 |
||
) |
Place the bottom of the mark at first line of the specified staff of an instrument.
instr | The instrument number (0..n-1) of the instrument. |
staff | The staff number (0..m-1), relative to the number of staves in the instrument. Special value -1 means "the last staff of the instrument". |
When invoking this method, the extra height for the mark will be changed to be the staves margin. You can later change this value by using method extra_height().
|
inline |
Set the color of the mark.
FragmentMark* FragmentMark::extra_height | ( | Tenths | value = 0 | ) |
Define the additional height to add, at top and bottom of the mark line. Please note that the line heigth will be incremented in twice the passed value, as the extra height value will be added at top and also at bottom.
This extra lenght is specified in tenths, referred to the first staff in the system on which the mark is placed.
|
inline |
Return the current mark color.
|
inline |
Return the current line style in use for drawing the mark.
|
inline |
Return the current mark type.
|
inline |
Set the line style.
FragmentMark* FragmentMark::thickness | ( | Tenths | value | ) |
Change the thickness of the mark vertical line. When the mark is created, it has a default thickness of six tenths.
The thickness is specified in tenths, referred to the first staff in the system on which the mark is placed.
FragmentMark* FragmentMark::top | ( | int | instr, |
int | staff = 0 |
||
) |
Place the start of the mark at top line of the specified staff of an instrument.
instr | The instrument number (0..n-1) of the instrument. |
staff | The staff number (0..m-1), relative to the number of staves in the instrument. Special value -1 means "the last staff of the instrument". |
When invoking this method, the extra height for the mark will be changed to be the staves margin. You can later change this value by using method extra_height().
|
inline |
Set the type of the mark.
FragmentMark* FragmentMark::x_shift | ( | Tenths | dx | ) |
Define the horizontal shift to add to the default place for the mark.
dx | The shift to add. The shift is specified in tenths, referred to the first staff in the system on which the mark is placed. |