当前位置: 首页>>代码示例>>C++>>正文


C++ Note::GetActualDur方法代码示例

本文整理汇总了C++中Note::GetActualDur方法的典型用法代码示例。如果您正苦于以下问题:C++ Note::GetActualDur方法的具体用法?C++ Note::GetActualDur怎么用?C++ Note::GetActualDur使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Note的用法示例。


在下文中一共展示了Note::GetActualDur方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: DrawLigatureNote


//.........这里部分代码省略.........
    /*
     else			// handle obliques
     {
     if (!View::s_drawingLigObliqua)	// 1st pass: Initial flagStemHeight
     {
     DrawVerticalLine (dc,y3,y4,x1, m_doc->GetDrawingStemWidth(staff->m_drawingStaffSize));
     View::s_drawingLigObliqua = true;
     //oblique = false;
     //			if (val == DUR_1)	// left tail up if DUR_1
     //				queue_lig = true;
     }
     else	// 2nd pass: oblique lines and final flagStemHeighte
     {
     x1 -=  m_doc->m_drawingBrevisWidth[staff->m_drawingStaffSize] * 2;	// auto advance

     y1 = *View::s_drawingLigY - m_doc->GetDrawingUnit(staff->m_drawingStaffSize);	// ligat_y contains original y
     yy2 = y2;
     y5 = y1+ m_doc->GetDrawingDoubleUnit(staff->m_drawingStaffSize); y2 +=
     m_doc->GetDrawingDoubleUnit(staff->m_drawingStaffSize);            // go up a
     INTERL

     if (note->GetColored()==BOOLEAN_true)
     DrawObliquePolygon (dc,  x1,  y1,  x2,  yy2, m_doc->GetDrawingDoubleUnit(staff->m_drawingStaffSize));
     else
     {	DrawObliquePolygon (dc,  x1,  y1,  x2,  yy2, 5);
     DrawObliquePolygon (dc,  x1,  y5,  x2,  y2, -5);
     }
     DrawVerticalLine (dc,y3,y4,x2,m_doc->GetDrawingStemWidth(staff->m_drawingStaffSize));	// enclosure
     flagStemHeighte

     View::s_drawingLigObliqua = false;
     //			queue_lig = false;	// ??defuses alg.queue DUR_BR??

     }
     }

     if (note->m_lig)	// remember positions from one note to another; connect notes by bars
     {
     *(View::s_drawingLigX+1) = x2; *(View::s_drawingLigY+1) = y;	// connect ligature beamed notes by bar
     flagStemHeightes
     //if (in(x1,(*View::s_drawingLigX)-2,(*View::s_drawingLigX)+2) || (this->fligat && this->lat && !Note1::marq_obl))
     // the latest conditions to allow previous ligature flagStemHeighte
     //	DrawVerticalLine (dc, *ligat_y, y1, (this->fligat && this->lat) ? x2: x1, m_doc->m_parameters.m_stemWidth); //
     ax2 - drawing flagStemHeight
     lines missing
     *View::s_drawingLigX = *(View::s_drawingLigX + 1);
     *View::s_drawingLigY = *(View::s_drawingLigY + 1);
     }


     y3 = y2 - m_doc->GetDrawingUnit(staff->m_drawingStaffSize)*6;

     if (note->m_lig)
     {
     if (note->m_dur == DUR_BR) //  && this->queue_lig)	// tail left bottom: initial downward DUR_BR // ax2 - no
     support for queue_lig (see WG
     corrigeLigature)
     {
     DrawVerticalLine (dc, y2, y3, x1, m_doc->GetDrawingStemWidth(staff->m_drawingStaffSize));
     }
     else if (note->m_dur == DUR_LG) // && !this->queue_lig) // DUR_LG ligature, tail right down // ax2 - no support
     for queue_lig
     {
     DrawVerticalLine (dc, y2, y3, x2, m_doc->GetDrawingStemWidth(staff->m_drawingStaffSize));
     }
     else if (note->m_dur == DUR_1) // && this->queue_lig)	// queue gauche haut // ax2 - no support for queue_lig
     {
     y2 = y1 + m_doc->GetDrawingUnit(staff->m_drawingStaffSize)*6;
     DrawVerticalLine (dc, y1, y2, x1, m_doc->GetDrawingStemWidth(staff->m_drawingStaffSize));
     }
     }
     else if (note->m_dur == DUR_LG)		// isolated DUR_LG: tail like normal notes
     */
    if (note->GetActualDur() == DUR_LG) {
        verticalCenter = staff->GetDrawingY() - m_doc->GetDrawingDoubleUnit(staff->m_drawingStaffSize) * 2;
        // ENZ
        up = (y < verticalCenter) ? true : false;
        // ENZ
        if (note->GetDrawingStemDir() != STEMDIRECTION_NONE) {
            if (note->GetDrawingStemDir() == STEMDIRECTION_up) {
                up = true;
            }
            else {
                up = false;
            }
        }

        if (!up) {
            y3 = y1 - m_doc->GetDrawingUnit(staff->m_drawingStaffSize) * 8;
            y2 = y1;
        }
        else {
            y3 = y1 + m_doc->GetDrawingUnit(staff->m_drawingStaffSize) * 6;
            y2 = y1;
        }
        DrawVerticalLine(dc, y2, y3, x2, m_doc->GetDrawingStemWidth(staff->m_drawingStaffSize));
    }

    return;
}
开发者ID:DDMAL,项目名称:verovio,代码行数:101,代码来源:view_mensural.cpp

示例2: DrawLigature


//.........这里部分代码省略.........
        }
        else
            DrawFullRectangle( dc,x1,y1,x2,y2);	// dessine val carree pleine // ENZ correction de x2
        
        DrawVerticalLine ( dc, y3, y4, x1, m_doc->GetDrawingStemWidth(staff->m_drawingStaffSize) );	// corset lateral
        DrawVerticalLine ( dc, y3, y4, x2, m_doc->GetDrawingStemWidth(staff->m_drawingStaffSize) );
    }
    /*
     else			// traitement des obliques
     {
     if (!View::s_drawingLigObliqua)	// 1e passage: ligne flagStemHeighte initiale
     {
     DrawVerticalLine (dc,y3,y4,x1, m_doc->GetDrawingStemWidth(staff->m_drawingStaffSize) );
     View::s_drawingLigObliqua = true;
     //oblique = OFF;
     //			if (val == DUR_1)	// queue gauche haut si DUR_1
     //				queue_lig = ON;
     }
     else	// 2e passage: lignes obl. et flagStemHeighte finale
     {
     x1 -=  m_doc->m_drawingBrevisWidth[staff->m_drawingStaffSize]*2;	// avance auto
     
     y1 = *View::s_drawingLigY - m_doc->GetDrawingUnit(staff->m_drawingStaffSize);	// ligat_y contient y original
     yy2 = y2;
     y5 = y1+ m_doc->GetDrawingDoubleUnit(staff->m_drawingStaffSize); y2 += m_doc->GetDrawingDoubleUnit(staff->m_drawingStaffSize);	// on monte d'un INTERL
     
     if (note->GetColored()==BOOLEAN_true)
     DrawObliquePolygon ( dc,  x1,  y1,  x2,  yy2, m_doc->GetDrawingDoubleUnit(staff->m_drawingStaffSize));
     else
     {	DrawObliquePolygon ( dc,  x1,  y1,  x2,  yy2, 5);
     DrawObliquePolygon ( dc,  x1,  y5,  x2,  y2, -5);
     }
     DrawVerticalLine ( dc,y3,y4,x2,m_doc->GetDrawingStemWidth(staff->m_drawingStaffSize));	//cloture flagStemHeighte
     
     View::s_drawingLigObliqua = false;
     //			queue_lig = OFF;	//desamorce alg.queue DUR_BR
     
     }
     }
     
     if (note->m_lig)	// memoriser positions d'une note a l'autre; relier notes par barres
     {
     *(View::s_drawingLigX+1) = x2; *(View::s_drawingLigY+1) = y;	// relie notes ligaturees par barres flagStemHeightes
     //if (in(x1,(*View::s_drawingLigX)-2,(*View::s_drawingLigX)+2) || (this->fligat && this->lat && !Note1::marq_obl))
     // les dernieres conditions pour permettre ligature flagStemHeighte ancienne
     //	DrawVerticalLine (dc, *ligat_y, y1, (this->fligat && this->lat) ? x2: x1, m_doc->m_parameters.m_stemWidth); // ax2 - drawing flagStemHeight lines missing
     *View::s_drawingLigX = *(View::s_drawingLigX + 1);
     *View::s_drawingLigY = *(View::s_drawingLigY + 1);
     }
     
     
     y3 = y2 - m_doc->GetDrawingUnit(staff->m_drawingStaffSize)*6;
     
     if (note->m_lig)
     {
     if (note->m_dur == DUR_BR) //  && this->queue_lig)	// queue gauche bas: DUR_BR initiale descendante // ax2 - no support of queue_lig (see WG corrigeLigature)
     {
     DrawVerticalLine ( dc, y2, y3, x1, m_doc->GetDrawingStemWidth(staff->m_drawingStaffSize) );
     }
     else if (note->m_dur == DUR_LG) // && !this->queue_lig) // DUR_LG en ligature, queue droite bas // ax2 - no support of queue_lig
     {
     DrawVerticalLine (dc, y2, y3, x2, m_doc->GetDrawingStemWidth(staff->m_drawingStaffSize) );
     }
     else if (note->m_dur == DUR_1) // && this->queue_lig )	// queue gauche haut // ax2 - no support of queue_lig
     {
     y2 = y1 + m_doc->GetDrawingUnit(staff->m_drawingStaffSize)*6;
     DrawVerticalLine ( dc, y1, y2, x1, m_doc->GetDrawingStemWidth(staff->m_drawingStaffSize) );
     }
     }
     else if (note->m_dur == DUR_LG)		// DUR_LG isolee: queue comme notes normales
     */
    if (note->GetActualDur() == DUR_LG)
    {
        verticalCenter = staff->GetDrawingY() - m_doc->GetDrawingDoubleUnit(staff->m_drawingStaffSize)*2;
        // ENZ
        up = (y < verticalCenter) ? ON : OFF;
        // ENZ
        if ( note->GetDrawingStemDir() != STEMDIRECTION_NONE ) {
            if ( note->GetDrawingStemDir() == STEMDIRECTION_up) {
                up = ON;
            }
            else {
                up = OFF;
            }
        }
        
        if (!up)
        {
            y3 = y1 - m_doc->GetDrawingUnit(staff->m_drawingStaffSize)*8;
            y2 = y1;
        }
        else {
            y3 = y1 + m_doc->GetDrawingUnit(staff->m_drawingStaffSize)*6;
            y2 = y1;
        }
        DrawVerticalLine ( dc, y2,y3,x2, m_doc->GetDrawingStemWidth(staff->m_drawingStaffSize) );
    }
    
    return;
}
开发者ID:rondini,项目名称:verovio,代码行数:101,代码来源:view_mensural.cpp

示例3: DrawMaximaToBrevis

void View::DrawMaximaToBrevis(DeviceContext *dc, int y, LayerElement *element, Layer *layer, Staff *staff)
{
    assert(dc);
    assert(element);
    assert(layer);
    assert(staff);

    Note *note = dynamic_cast<Note *>(element);
    assert(note);

    int xn, xLeft, xRight, yTop, yBottom, y3, y4;
    // int yy2, y5; // unused
    int verticalCenter, up, height;
    bool mensural_black = (staff->m_drawingNotationType == NOTATIONTYPE_mensural_black);
    bool fillNotehead = (mensural_black || note->GetColored()) && !(mensural_black && note->GetColored());
    height = m_doc->GetDrawingBeamWidth(staff->m_drawingStaffSize, false) / 2;
    xn = element->GetDrawingX();

    // Calculate size of the rectangle
    xLeft = xn - m_doc->GetDrawingBrevisWidth(staff->m_drawingStaffSize);
    xRight = xn + m_doc->GetDrawingBrevisWidth(staff->m_drawingStaffSize);
    if (note->GetActualDur() == DUR_MX) {
        // Maxima is twice the width of brevis
        xLeft -= m_doc->GetDrawingBrevisWidth(staff->m_drawingStaffSize);
        xRight += m_doc->GetDrawingBrevisWidth(staff->m_drawingStaffSize);
    }
    yTop = y + m_doc->GetDrawingUnit(staff->m_drawingStaffSize);
    yBottom = y - m_doc->GetDrawingUnit(staff->m_drawingStaffSize);

    y3 = yTop;
    y4 = yBottom;
    if (!mensural_black) {
        y3 += (int)m_doc->GetDrawingUnit(staff->m_drawingStaffSize) / 2; // partie d'encadrement qui depasse
        y4 -= (int)m_doc->GetDrawingUnit(staff->m_drawingStaffSize) / 2;
    }

    if (!fillNotehead) {
        //	double the bases of rectangles
        DrawObliquePolygon(dc, xLeft, yTop, xRight, yTop, -height);
        DrawObliquePolygon(dc, xLeft, yBottom, xRight, yBottom, height);
    }
    else {
        DrawFilledRectangle(dc, xLeft, yTop, xRight, yBottom);
    }

    DrawVerticalLine(dc, y3, y4, xLeft, m_doc->GetDrawingStemWidth(staff->m_drawingStaffSize)); // corset lateral
    DrawVerticalLine(dc, y3, y4, xRight, m_doc->GetDrawingStemWidth(staff->m_drawingStaffSize));

    // stem
    if (note->GetActualDur() < DUR_BR) {
        verticalCenter = staff->GetDrawingY() - m_doc->GetDrawingDoubleUnit(staff->m_drawingStaffSize) * 2;
        up = (y < verticalCenter) ? true : false;
        if (note->GetDrawingStemDir() != STEMDIRECTION_NONE) {
            if (note->GetDrawingStemDir() == STEMDIRECTION_up) {
                up = true;
            }
            else {
                up = false;
            }
        }

        if (!up) {
            y3 = yTop - m_doc->GetDrawingUnit(staff->m_drawingStaffSize) * 8;
            yBottom = yTop;
        }
        else {
            y3 = yTop + m_doc->GetDrawingUnit(staff->m_drawingStaffSize) * 6;
            yBottom = yTop;
        }
        DrawVerticalLine(dc, yBottom, y3, xRight, m_doc->GetDrawingStemWidth(staff->m_drawingStaffSize));
    }

    return;
}
开发者ID:DDMAL,项目名称:verovio,代码行数:74,代码来源:view_mensural.cpp

示例4: DrawMaximaToBrevis

void View::DrawMaximaToBrevis( DeviceContext *dc, int y, LayerElement *element, Layer *layer, Staff *staff )
{
    assert( dc );
    assert( element );
    assert( layer );
    assert( staff );
    
    Note *note = dynamic_cast<Note*>(element);
    assert( note );
    
    int xn, x1, x2, y1, y2, y3, y4;
    // int yy2, y5; // unused
    int verticalCenter, up, height;
    
    height = m_doc->GetDrawingBeamWidth(staff->m_drawingStaffSize, false) / 2 ;
    xn = element->GetDrawingX();
    
    // calcul des dimensions du rectangle
    x1 = xn - m_doc->GetDrawingBrevisWidth( staff->m_drawingStaffSize );
    x2 = xn +  m_doc->GetDrawingBrevisWidth( staff->m_drawingStaffSize );
    if (note->GetActualDur() == DUR_MX) {
        x1 -= m_doc->GetDrawingBrevisWidth( staff->m_drawingStaffSize );
        x2 += m_doc->GetDrawingBrevisWidth( staff->m_drawingStaffSize );
    }
    y1 = y + m_doc->GetDrawingUnit(staff->m_drawingStaffSize);
    y2 = y - m_doc->GetDrawingUnit(staff->m_drawingStaffSize);
    y3 = (int)(y1 + m_doc->GetDrawingUnit(staff->m_drawingStaffSize)/2);	// partie d'encadrement qui depasse
    y4 = (int)(y2 - m_doc->GetDrawingUnit(staff->m_drawingStaffSize)/2);
    
    if (note->GetColored()!=BOOLEAN_true) {
        //	double base des carrees
        DrawObliquePolygon ( dc, x1,  y1,  x2,  y1, -height );
        DrawObliquePolygon ( dc, x1,  y2,  x2,  y2, height );
    }
    else {
        DrawFullRectangle( dc,x1,y1,x2,y2);
    }
    
    DrawVerticalLine ( dc, y3, y4, x1, m_doc->GetDrawingStemWidth(staff->m_drawingStaffSize) );	// corset lateral
    DrawVerticalLine ( dc, y3, y4, x2, m_doc->GetDrawingStemWidth(staff->m_drawingStaffSize) );

    // stem
    if (note->GetActualDur() < DUR_BR)
    {
        verticalCenter = staff->GetDrawingY() - m_doc->GetDrawingDoubleUnit(staff->m_drawingStaffSize)*2;
        up = (y < verticalCenter) ? true : false;
        if ( note->GetDrawingStemDir() != STEMDIRECTION_NONE ) {
            if ( note->GetDrawingStemDir() == STEMDIRECTION_up) {
                up = true;
            }
            else {
                up = false;
            }
        }
        
        if (!up) {
            y3 = y1 - m_doc->GetDrawingUnit(staff->m_drawingStaffSize)*8;
            y2 = y1;
        }
        else {
            y3 = y1 + m_doc->GetDrawingUnit(staff->m_drawingStaffSize)*6;
            y2 = y1;
        }
        DrawVerticalLine ( dc, y2,y3,x2, m_doc->GetDrawingStemWidth(staff->m_drawingStaffSize) );
    }
    
    return;
}
开发者ID:rondini,项目名称:verovio,代码行数:68,代码来源:view_mensural.cpp


注:本文中的Note::GetActualDur方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。