Exemple #1
0
void ARMarcato::setTagParameterList(TagParameterList& tpl)
{
	if (ltpls.GetCount() == 0)
	{
		// create a list of string ...

		ListOfStrings lstrs; // (1); std::vector test impl
		lstrs.AddTail("S,position,,o");
        CreateListOfTPLs(ltpls,lstrs);
	}

	TagParameterList * rtpl = NULL;
	int ret = MatchListOfTPLsWithTPL(ltpls,tpl,&rtpl);

	if (ret>=0 && rtpl)
	{
		// we found a match!
		if (ret == 0)
		{
            TagParameterString * str = TagParameterString::cast(rtpl->RemoveHead());
            assert(str);

            std::string below ("below");
            std::string above ("above");

            if (str->TagIsSet() && (below == str->getValue()))
			{
				position = BELOW;
			}
			else if (str->TagIsSet() && (above == str->getValue()))
            {
                position = ABOVE;
            }

            delete str;

			// Get The TagParameters ...
			// text = 
			//	TagParameterString::cast(rtpl->RemoveHead());
			//assert(text);

		}

		delete rtpl;
	}
	else
	{
		// failure
	}

	tpl.RemoveAll();
}
Exemple #2
0
void ARFermata::setTagParameterList(TagParameterList & tpl)
{
	if (ltpls.GetCount() == 0)
	{
		ListOfStrings lstrs;
		lstrs.AddTail("S,type,short,o;S,position,above,o");
		CreateListOfTPLs(ltpls,lstrs);
	}

	TagParameterList * rtpl = NULL;
	int ret = MatchListOfTPLsWithTPL(ltpls, tpl, &rtpl);

	if (ret>=0 && rtpl)
	{
		// we found a match!
		if (ret == 0)
		{
			TagParameterString * str = TagParameterString::cast(rtpl->RemoveHead());
			assert(str);
			std::string shortstr ("short");
			std::string longstr ("long");
			std::string below ("below");
			if (str->TagIsSet())
			{
				if (shortstr == str->getValue())
					type = SHORT;
				else if (longstr == str->getValue())
					type = LONG;
				else type = REGULAR;
			}
			delete str;
		
			str = TagParameterString::cast(rtpl->RemoveHead());
			assert(str);
			if (str->TagIsSet() && (below == str->getValue()))
			{
				position = BELOW;
			}
			else  position = ABOVE;
			
			delete str;
		}

		delete rtpl;
	}

	tpl.RemoveAll();

}
Exemple #3
0
void ARABreak::setTagParameterList(TagParameterList & tpl)
{

	if (ltpls.empty())
	{
		ListOfStrings lstrs; // (1); std::vector test impl
		lstrs.AddTail(("S,page,on,o;S,system,on,o"));
		CreateListOfTPLs(ltpls,lstrs);
	}

	TagParameterList * rtpl = NULL;
	int ret = MatchListOfTPLsWithTPL(ltpls,tpl,&rtpl);

	if (ret>=0 && rtpl)
	{
		// we found a match!
		if (ret == 0)
		{
			TagParameterString * str = TagParameterString::cast(rtpl->RemoveHead());
			assert(str);
			std::string off ("off");
			if (str->TagIsSet())
			{
				if (off == str->getValue())
					mPageBreakState = OFF;
			}
			delete str;

			str =  TagParameterString::cast(rtpl->RemoveHead());
			assert(str);
			if (str->TagIsSet())
			{
				if (off == str->getValue())
					mSystemBreakState = OFF;
			}
			delete str;

		}

		delete rtpl;
	}
	// all Parameters are ignored ...
	// issue warning...
	tpl.RemoveAll();
	return;


}
Exemple #4
0
void ARStaccato::setTagParameterList(TagParameterList& tpl)
{
    if (ltpls.GetCount() == 0)
    {
        // create a list of string ...

        ListOfStrings lstrs; // (1); std::vector test impl
        lstrs.AddTail(("S,type,,o"));
        CreateListOfTPLs(ltpls,lstrs);
    }

    TagParameterList *rtpl = NULL;
    int ret = MatchListOfTPLsWithTPL(ltpls,tpl,&rtpl);

    if (ret>=0 && rtpl)
    {
        // we found a match!
        if (ret == 0)
        {
            TagParameterString * str = TagParameterString::cast(rtpl->RemoveHead());
            assert(str);
            if (str->TagIsSet())
            {
                if (str->getValue() == std::string("heavy"))
                    type = HEAVY;
                else type = REGULAR;
            }
            delete str;
        }
        delete rtpl;
    }
    tpl.RemoveAll();
}
Exemple #5
0
void ARPizzicato::setTagParameterList(TagParameterList & tpl)
{
	if (ltpls.GetCount() == 0)
	{
		ListOfStrings lstrs;
		lstrs.AddTail("S,type,lefthand,o");
		CreateListOfTPLs(ltpls, lstrs);
	}
	
	TagParameterList * rtpl = NULL;
	int ret = MatchListOfTPLsWithTPL(ltpls, tpl, &rtpl);
	
	if (ret>=0 && rtpl)
	{
		//we found a match !
		if (ret == 0)
		{
			TagParameterString * str = TagParameterString::cast(rtpl->RemoveHead());
			assert(str);
			if (str->TagIsSet())
			{
				std::string val(str->getValue());
				if (val == "buzz")
					type = BUZZ;
				else if (val == "snap" || val == "bartok")
					type = SNAP;
				else if (val == "fingernail")
					type = FINGERNAIL;
				else
                    type = LEFTHAND;
			}
			else
                type = LEFTHAND;
			
			delete str;
		}
		
		delete rtpl;
	}

	tpl.RemoveAll();
}
Exemple #6
0
void ARTuplet::setTagParameterList(TagParameterList & tpl)
{
	if (ltpls.GetCount() == 0)
	{
		// create a list of string ...

		ListOfStrings lstrs; // (1); std::vector test impl
		lstrs.AddTail(("S,format,,r;S,position,above,o;U,dy1,0,o;U,dy2,0,o;F,lineThickness,0.08,o;S,bold,,o;F,textSize,1,o;S,dispNote,,o"));
		CreateListOfTPLs(ltpls,lstrs);
	}

	TagParameterList * rtpl = 0;
	int ret = MatchListOfTPLsWithTPL(ltpls,tpl,&rtpl);

	if (ret >= 0 && rtpl)
	{
		// we found a match!
		if (ret == 0)
		{
			// then, we now the match for
			// the first ParameterList
			// w, h, ml, mt, mr, mb
			GuidoPos pos = rtpl->GetHeadPosition();

			TagParameterString *tps = TagParameterString::cast(rtpl->GetNext(pos));
			assert(tps);

			if (tps->TagIsSet()) {
				fTupletFormat = tps->getValue();
				parseTupletFormatString();
			}

            tps = TagParameterString::cast(rtpl->GetNext(pos));
            fPosition = tps->getValue();
			fPositionIsSet = true;

            TagParameterFloat *tpf = TagParameterFloat::cast(rtpl->GetNext(pos));
            fDy1 = tpf->getValue();
            if (tpf->TagIsSet())
                fDy1TagIsSet = true;

			tpf = TagParameterFloat::cast(rtpl->GetNext(pos));
            fDy2 = tpf->getValue();
            if (tpf->TagIsSet())
                fDy2TagIsSet = true;

            tpf = TagParameterFloat::cast(rtpl->GetNext(pos));
            fLineThickness = tpf->getValue() * LSPACE;

            tps = TagParameterString::cast(rtpl->GetNext(pos));
            tps->getBool(fTextBold);

            tpf = TagParameterFloat::cast(rtpl->GetNext(pos));
            fTextSize = tpf->getValue();

            tps = TagParameterString::cast(rtpl->GetNext(pos));
            fDispNote = tps->getValue();
		}

		delete rtpl;
	}
	else
	{
		// failure
	}

	tpl.RemoveAll();
}