Example #1
0
void GRSingleRest::updateBoundingBox()
{
    traceMethod("updateBoundingBox");
    const float extent = GetSymbolExtent(mType);
    const int theSize = getFontSize();
    const NVPoint & offset = getOffset();
    float scale = getSize();

    mBoundingBox.left = -extent/2 * scale;
    mBoundingBox.right = mBoundingBox.left + (extent * scale);

    switch (mType) {
    case P1:
        mBoundingBox.top = (LSPACE - mPosition.y) * scale;
        mBoundingBox.bottom = (theSize - LSPACE) * scale;
        break;
    case P2:
        mBoundingBox.top = (LSPACE * 1.5f - mPosition.y) * scale;
        mBoundingBox.bottom = (theSize - LSPACE * 1.5f) * scale;
        break;
    case P8:
    case P16:
        mBoundingBox.top = (LSPACE - mPosition.y) * scale;
        mBoundingBox.bottom = theSize * scale;
        break;
    default:
        mBoundingBox.top = -mPosition.y * scale;
        mBoundingBox.bottom = theSize * scale;
        break;
    }
    mMapping = mBoundingBox;
    mMapping += mPosition + offset;
}
Example #2
0
    void Debugger::_debugMethod(MethodEnv* env)
    {
        traceMethod(env->method);

        // can't debug native methods
        if (!env->method->isNative()
#ifdef VMCFG_AOT
            || env->method->isCompiledMethod()
#endif
            )
            debugMethod(env);
    }
Example #3
0
void GRSingleRest::setRestFormat( ARRestFormat * restfrmt )
{
    traceMethod("setRestFormat");
    if (restfrmt != 0) {
        // - Get the color
        if (restfrmt->getColor())
        {
            if (mColRef == 0 )
                mColRef = new unsigned char [4];

            if (restfrmt->getColor()->getRGB( mColRef ) == false )
            {
                delete [] mColRef;
                mColRef = 0;
            }
        }

        // - Get the offsets and size
        const TagParameterFloat * tpf1 = restfrmt->getDX();
        if (tpf1)
            mOffset.x = tpf1->getValue();

        const TagParameterFloat * tpf2 = restfrmt->getDY();
        if (tpf2)
            mOffset.y = tpf2->getValue();

        const TagParameterFloat * tpf = restfrmt->getSize();
        mSize = tpf ? tpf->getValue() : float(1.0);
    }

    NVPoint dotPos;
    switch (mType) {
    case P1:
        dotPos.Set( 0, 1.8f * mCurLSPACE );
        break;
    case P32:
    case P64:
    case P128:
        dotPos.Set( 0, 1 * mCurLSPACE);
        break;
    default:
        dotPos.Set( 0, 2 * mCurLSPACE);
    }
    createDots( getDuration(), 0, dotPos );
}
Example #4
0
void GRSingleRest::OnDraw( VGDevice & hdc ) const
{
    traceMethod("OnDraw");
    if (mType == P0) return;		// don't know how to draw it !

    GRRest::OnDrawSymbol( hdc, mType );
    DrawSubElements( hdc );		// - Draw elements (dots...)

    // Draw articulations (fermata...)
    const GRNEList * articulations = getArticulations();
    if( articulations ) {
        for( GRNEList::const_iterator ptr = articulations->begin(); ptr != articulations->end(); ++ptr )
        {
            GRNotationElement * el = *ptr;
            el->OnDraw(hdc);
        }
    }

    if (gBoundingBoxesMap & kEventsBB)
        DrawBoundingBox( hdc, kEventBBColor);
}
Example #5
0
void GRSingleRest::createRest(const TYPE_DURATION & duration)
{
    traceMethod("createRest");

    durtemplate = duration;
    mType = P0;
    mBoundingBox.Set( 0, 0, 0, 0 );
    mLeftSpace = 0;
    mRightSpace = 0;
    sRefpos.x = 0;

    // (JB) changed equal comparaisons (duration == DURATION_xxx) to
    // greater or equal: (duration >= DURATION_xxx), to catch dotted durations.
    if (duration >= DURATION_1)
    {
        mType = P1;
        mPosition.y = mCurLSPACE;
    }
    else if (duration >= DURATION_2)
    {
        mType = P2;
        mPosition.y = mCurLSPACE * 2;
    }
    else if (duration >= DURATION_4)
    {
        mType = P4;
        mPosition.y = (float)(2 * mCurLSPACE);
    }
    else if (duration >= DURATION_8)
    {
        mType = P8;
        mPosition.y = (float)(1.25f * mCurLSPACE);

    }
    else if (duration >= DURATION_16)
    {
        mType = P16;
        mPosition.y = (float)(2.25f * mCurLSPACE);
    }
    else if (duration >= DURATION_32)
    {
        mType = P32;
        mPosition.y = (float)(2.25f * mCurLSPACE);
    }
    else if (duration >= DURATION_64)
    {
        mType = P64;
        mPosition.y = (float)(3.25f * mCurLSPACE);
    }
    else  if (duration >= DURATION_128)
    {
        mType = P128;
        mPosition.y = (float)(4.25f * mCurLSPACE);
    }
    else
    {   // Unknown Duration ... what do we do know
        mType = P0;
        return;
    }

    const float extent = GetSymbolExtent(mType);
    mLeftSpace = (float)(extent * 0.5f * mSize);
    mRightSpace = (float)(extent * 0.5f * mSize);
}