use of com.xenoage.zong.musiclayout.stampings.StaffStamping in project Zong by Xenoage.
the class ScoreLayout method getScoreLP.
/**
* Computes the {@link ScoreLayoutPos} of the given {@link MP} at the given line position.
* If not found, null is returned.
*/
public ScoreLayoutPos getScoreLP(MP mp, float lp) {
int iFrame = getFrameIndexOf(mp.getMeasure());
if (iFrame > -1) {
ScoreFrameLayout sfl = frames.get(iFrame);
StaffStamping ss;
if (mp.getStaff() != MP.Companion.getUnknown())
ss = sfl.getStaffStamping(mp.getStaff(), mp.getMeasure());
else
ss = sfl.getStaffStamping(0, mp.getMeasure());
if (ss != null) {
float x = ss.positionMm.x + ss.system.getXMmAt(mp.getTime());
float y = ss.computeYMm(lp);
return new ScoreLayoutPos(iFrame, new Point2f(x, y));
}
}
return null;
}
Aggregations