本文整理汇总了C++中Articulation::staffIdx方法的典型用法代码示例。如果您正苦于以下问题:C++ Articulation::staffIdx方法的具体用法?C++ Articulation::staffIdx怎么用?C++ Articulation::staffIdx使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Articulation
的用法示例。
在下文中一共展示了Articulation::staffIdx方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: layoutArticulations
//.........这里部分代码省略.........
Articulation* a = _articulations.at(i);
//
// determine MScore::Direction
//
if (a->direction() != MScore::Direction::AUTO) {
a->setUp(a->direction() == MScore::Direction::UP);
}
else {
if (a->anchor() == ArticulationAnchor::CHORD)
a->setUp(!up());
else
a->setUp(a->anchor() == ArticulationAnchor::TOP_STAFF || a->anchor() == ArticulationAnchor::TOP_CHORD);
}
}
//
// pass 1
// place tenuto and staccato
//
for (int i = 0; i < n; ++i) {
Articulation* a = _articulations.at(i);
a->layout();
ArticulationAnchor aa = a->anchor();
if ((a->articulationType() != ArticulationType::Tenuto)
&& (a->articulationType() != ArticulationType::Staccato))
continue;
if (aa != ArticulationAnchor::CHORD && aa != ArticulationAnchor::TOP_CHORD && aa != ArticulationAnchor::BOTTOM_CHORD)
continue;
bool bottom;
if ((aa == ArticulationAnchor::CHORD) && measure()->hasVoices(a->staffIdx()))
bottom = !up();
else
bottom = (aa == ArticulationAnchor::BOTTOM_CHORD) || (aa == ArticulationAnchor::CHORD && up());
bool headSide = bottom == up();
dy += distance1;
qreal y;
Chord* chord = static_cast<Chord*>(this);
if (bottom) {
int line = downLine();
y = chordBotY + dy;
if (!headSide && type() == Element::Type::CHORD && chord->stem()) {
Stem* stem = chord->stem();
y = chordTopY + stem->stemLen();
if (chord->beam())
y += score()->styleS(StyleIdx::beamWidth).val() * _spatium * .5;
x = stem->pos().x();
int line = lrint((y+0.5*_spatium) / _spatium);
if (line <= 4) // align between staff lines
y = line * _spatium + _spatium * .5;
else
y += _spatium;
}
else {
int lines = (staff()->lines() - 1) * 2;
if (line < lines)
y = (line & ~1) + 3;
else
y = line + 2;
y *= _spatium * .5;
}
}