Esempio n. 1
0
ARCluster *GRCluster::getARCluster() const
{
	return /*dynamic*/static_cast<ARCluster*>(getAbstractRepresentation());
}
Esempio n. 2
0
const ARNote * GRNote::getARNote() const
{
	return /*dynamic*/static_cast<const ARNote*>(getAbstractRepresentation());
}
Esempio n. 3
0
void GRDiminuendo::updateDiminuendo(GRStaff * inStaff)
{
	GRSystemStartEndStruct *sse = getSystemStartEndStruct(inStaff->getGRSystem());
	if (sse == 0)
        return;

    // Collects informations about the context
	fDimContext.staff = inStaff;
	getDiminuendoBeginingContext(&fDimContext, sse);
	getDiminuendoEndingContext(&fDimContext, sse);

    ARDiminuendo *arDim = static_cast<ARDiminuendo *>(getAbstractRepresentation());
	const float staffLSpace = inStaff->getStaffLSPACE();
	assert(arDim);
	
	/**** information gathering of parameters from the AR ****/

    const char* dynamicMarking = arDim->getDynamicMarking().c_str();
    if (!strcmp(dynamicMarking,"p"))
		fDimInfos->fMarkingSymbol = kIntensPSymbol;
	else if (!strcmp(dynamicMarking,"f"))
		fDimInfos->fMarkingSymbol = kIntensFSymbol;
	else if (!strcmp(dynamicMarking,"ff"))
		fDimInfos->fMarkingSymbol = kIntensFFSymbol;
	else if (!strcmp(dynamicMarking,"fff"))
		fDimInfos->fMarkingSymbol = kIntensFFFSymbol;
	else if (!strcmp(dynamicMarking,"ffff"))
		fDimInfos->fMarkingSymbol = kIntensFFFFSymbol;
	else if (!strcmp(dynamicMarking,"mf"))
		fDimInfos->fMarkingSymbol = kIntensMFSymbol;
	else if (!strcmp(dynamicMarking,"mp"))
		fDimInfos->fMarkingSymbol = kIntensMPSymbol;
	else if (!strcmp(dynamicMarking,"sf"))
		fDimInfos->fMarkingSymbol = kIntensSFSymbol;
	else if (!strcmp(dynamicMarking,"pp"))
		fDimInfos->fMarkingSymbol = kIntensPPSymbol;
	else if (!strcmp(dynamicMarking,"ppp"))
		fDimInfos->fMarkingSymbol = kIntensPPPSymbol;
	else if (!strcmp(dynamicMarking,"pppp"))
		fDimInfos->fMarkingSymbol = kIntensPPPPSymbol;
    else
        fDimInfos->fMarkingSymbol = 0;

    float dx1     = arDim->getDx1();
	float dx2     = arDim->getDx2();
    float dy      = arDim->getDy();
	float deltaY  = arDim->getDeltaY();

    float XLeft  = 0;
    float XRight = 0;

    if (fDimContext.leftHead)
        XLeft = fDimContext.leftHead->getPosition().x + fDimContext.leftNoteDX;
    else
        XLeft = sse->startElement->getPosition().x;
    if (fDimContext.rightHead)
        XRight = fDimContext.rightHead->getPosition().x + fDimContext.rightNoteDX;
    else
        XRight = sse->endElement->getPosition().x;

    fDimInfos->points[0].x = fDimInfos->points[2].x = XLeft + dx1;
    fDimInfos->points[1].x = XRight + dx2;

    if (fDimInfos->points[0].x > fDimInfos->points[1].x)
    {
        fDimInfos->points[0].x = fDimInfos->points[2].x = XLeft;
        fDimInfos->points[1].x = XRight;
    }

    mPosition.y = (GCoord)(6 * staffLSpace);

    fDimInfos->points[0].y = mPosition.y + dy + deltaY / 2;
	fDimInfos->points[1].y = mPosition.y + dy;
    fDimInfos->points[2].y = mPosition.y + dy - deltaY / 2;

    fDimInfos->thickness = arDim->getThickness();
}
Esempio n. 4
0
ARRest * GRRest::getARRest() const
{
	return /*dynamic*/static_cast<ARRest*>(getAbstractRepresentation());
}