lenmus / lomse

A C++ library for rendering, editing and playing back music scores.
MIT License
117 stars 28 forks source link

Add marker to highlight a measure #356

Closed cecilios closed 2 years ago

cecilios commented 2 years ago

This PR adds a new marker and methods to manage it. Example:

ClickPointData data = pInteractor->find_click_info_at(pos.x, pos.y);
Document* pDoc = pPresenter->get_document_raw_ptr();
ImoScore* pScore = dynamic_cast<ImoScore*>( pDoc->get_content_item(0) );

if (data.ml.is_valid() && pScore)
{
    ImoId scoreId = pScore->get_id();

    MeasureHighlight* mark = pInteractor->add_measure_highlight(scoreId, data.ml);

    .. now refresh the window so that the added marker is displayed
}

See API documentation: https://lenmus.github.io/lomse/classMeasureHighlight.html https://lenmus.github.io/lomse/classInteractor.html#add8f800d6e000146c0888b5c1160fe7e