本文整理汇总了C++中Chord::PositionInChord方法的典型用法代码示例。如果您正苦于以下问题:C++ Chord::PositionInChord方法的具体用法?C++ Chord::PositionInChord怎么用?C++ Chord::PositionInChord使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Chord
的用法示例。
在下文中一共展示了Chord::PositionInChord方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DrawSlurInitial
//.........这里部分代码省略.........
}
// Now this is the case when the tie is split but we are drawing the end of it
else if (spanningType == SPANNING_END) {
stemDir = endStemDir;
}
// Finally, slur accross an entire system; use the staff position and up (see below)
else {
stemDir = STEMDIRECTION_down;
}
/************** direction **************/
data_STEMDIRECTION layerStemDir;
// first should be the tie @curvedir
if (slur->HasCurvedir()) {
drawingCurveDir
= (slur->GetCurvedir() == curvature_CURVEDIR_above) ? curvature_CURVEDIR_above : curvature_CURVEDIR_below;
}
// grace notes - always below unless we have a drawing stem direction on the layer
else if (isGraceToNoteSlur && (layer->GetDrawingStemDir(layerElement) == STEMDIRECTION_NONE)) {
drawingCurveDir = curvature_CURVEDIR_below;
}
// the normal case
else if (slur->HasDrawingCurvedir()) {
drawingCurveDir = slur->GetDrawingCurvedir();
}
// then layer direction trumps note direction
else if (layer && ((layerStemDir = layer->GetDrawingStemDir(layerElement)) != STEMDIRECTION_NONE)) {
drawingCurveDir = (layerStemDir == STEMDIRECTION_up) ? curvature_CURVEDIR_above : curvature_CURVEDIR_below;
}
// look if in a chord
else if (startParentChord) {
if (startParentChord->PositionInChord(startNote) < 0) {
drawingCurveDir = curvature_CURVEDIR_below;
}
else if (startParentChord->PositionInChord(startNote) > 0) {
drawingCurveDir = curvature_CURVEDIR_above;
}
// away from the stem if odd number (center note)
else {
drawingCurveDir = (stemDir != STEMDIRECTION_up) ? curvature_CURVEDIR_above : curvature_CURVEDIR_below;
}
}
else if (stemDir == STEMDIRECTION_up) {
drawingCurveDir = curvature_CURVEDIR_below;
}
else if (stemDir == STEMDIRECTION_NONE) {
// no information from the note stem directions, look at the position in the notes
int center = staff->GetDrawingY() - m_doc->GetDrawingDoubleUnit(staff->m_drawingStaffSize) * 2;
drawingCurveDir = (start->GetDrawingY() > center) ? curvature_CURVEDIR_above : curvature_CURVEDIR_below;
}
/************** adjusting y position **************/
bool isShortSlur = false;
if (x2 - x1 < 1 * m_doc->GetDrawingDoubleUnit(staff->m_drawingStaffSize)) isShortSlur = true;
int yChordMax, yChordMin;
if ((spanningType == SPANNING_START_END) || (spanningType == SPANNING_START)) {
// first get the min max of the chord (if any)
if (startParentChord) {
startParentChord->GetYExtremes(yChordMax, yChordMin);
}
else if (startChord) {
startChord->GetYExtremes(yChordMax, yChordMin);