Exemple #1
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 #2
0
void ARNewSystem::setTagParameterList(TagParameterList & tpl)
{
		if (ltpls.GetCount() == 0)
	{
		// create a list of string ...

		ListOfStrings lstrs; // (1); std::vector test impl
		lstrs.AddTail( ( "U,dy,0,o"));
		CreateListOfTPLs(ltpls,lstrs);

	}

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

	if (ret>=0 && rtpl)
	{
		// we found a match!
		if (ret == 0)
			mDy =  TagParameterFloat::cast(rtpl->RemoveHead());

		delete rtpl;
	}
	else
	{
		// failure
	}

	tpl.RemoveAll();

}
Exemple #3
0
void ARRestFormat::setTagParameterList(TagParameterList &tpl)
{
    if (ltpls.empty())
    {
        // create a list of string ...

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

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

    if (ret >= 0 && rtpl)
    {
        delete rtpl;
    }
    else
    {
        // failure
    }

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

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

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

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

		}

		delete rtpl;
	}
	else
	{
		// failure
	}

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

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

    TagParameterList * rtpl = NULL;
    const 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();

            mTpfLength = TagParameterFloat::cast( rtpl->RemoveHead());
        }
        delete rtpl;
    }
    else
    {
        // failure...
    }

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

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

	TagParameterList *rtpl = NULL;
	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
			// GuidoPos pos = rtpl->GetHeadPosition();

		}

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

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

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

	if (ret>=0 && rtpl)
	{
		// we found a match!
		if (ret == 0)
		{
			num = TagParameterInt::cast(rtpl->RemoveHead());
			assert(num);
		}

		delete rtpl;
	}
	else
	{
		// failure
	}

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

		ListOfStrings lstrs; // (1); std::vector test impl
		lstrs.AddTail((
			"I,dur,32,o"
			// "S,text,,r;U,dy,-1,o"
			));
		CreateListOfTPLs(ltpls,lstrs);
	}

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

	if (ret>=0 && rtpl)
	{
		// we found a match!
		if (ret == 0)
		{
		}

		delete rtpl;
	}
	else
	{
		// failure
	}

	tpl.RemoveAll();
}
Exemple #9
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 #10
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 #11
0
void ARStaff::setTagParameterList(TagParameterList& tpl)
{
	if (ltpls.GetCount() == 0)
	{
		// create a list of string ...
		ListOfStrings lstrs; // (1); std::vector test impl
		lstrs.AddTail( ("I,id,,r;U,dy,,o"));
		lstrs.AddTail( ("S,id,,r;U,dy,,o"));
		CreateListOfTPLs(ltpls,lstrs);

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

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

			if (idi->getValue() < 1)
			{
				GuidoWarn("Staff-Parameter-Value smaller than 1");
				idi->setValue(1);
			}
			mDy = TagParameterFloat::cast(rtpl->RemoveHead());
			assert(mDy);
		}
		else if (ret==1)
		{
			// we have a match with the second parameter ...
			ids = TagParameterString::cast(rtpl->RemoveHead());
			assert(ids);

			mDy = TagParameterFloat::cast(rtpl->RemoveHead());
			assert(mDy);
		}
		delete rtpl;
	}
	else
	{
		// failure ...
	}
	if (idi && idi->getValue() < 0)
		idi->setValue(0);
	tpl.RemoveAll();
}
Exemple #12
0
void ARTitle::setTagParameterList(TagParameterList & tpl)
{
	if (ltpls.GetCount() == 0)
	{
		// create a list of string ...
		ListOfStrings lstrs; // (1); std::vector test impl
		lstrs.AddTail((
			"S,name,,r;"
			"S,pageformat,c2,o;S,textformat,cc,o"));
		CreateListOfTPLs(ltpls,lstrs);
	}

	TagParameterList *rtpl = NULL;
	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 name
			delete name;
			delete pageformat;
			delete textformat;

			name = TagParameterString::cast(rtpl->RemoveHead());
			assert(name);

			// pageformat
			pageformat = TagParameterString::cast(rtpl->RemoveHead());
			assert(pageformat);	

			textformat = TagParameterString::cast(rtpl->RemoveHead());
			assert(textformat);
		}

		if (fsize && fsize->TagIsNotSet())
		{
			fsize->setValue(24);
			fsize->setUnit("pt");
		}
		delete rtpl;
	}
	else
	{
		// failure
	}
	tpl.RemoveAll();
}
Exemple #13
0
void ARStaffFormat::setTagParameterList(TagParameterList & tpl)
{
	if (ltpls.GetCount() == 0) {
		// create a list of string ...
		ListOfStrings lstrs; // (1); std::vector test impl
		lstrs.AddTail( ( "S,style,standard,o;U,size,3pt,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
			style = TagParameterString::cast(rtpl->RemoveHead());
			assert(style);
			if (style->TagIsSet() == false) {
				delete style;
				style = NULL;
			}

			size = TagParameterFloat::cast(rtpl->RemoveHead());
			assert(size);
			if (size->TagIsSet() == false) {
				delete size;
				size = NULL;
			}
			else
			{
				// one idea is to adjust the size, so that it matches an integer (internally)
				float intunits = size->getValue();		// per halfspace ...
				// Integer internal units 
				const int Iintunits = (int) (intunits + 0.5);
				const double cmunits = Iintunits * kVirtualToCm;
				const char * unit = size->getUnit();
				intunits = (float)gd_convertUnits(cmunits,"cm",unit);
				size->setValue( intunits );
			}
		}
		delete rtpl;
	}
	else {
		// failure
	}
	tpl.RemoveAll();
}
Exemple #14
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 #15
0
void ARAccolade::setTagParameterList(TagParameterList & tpl)
{
	if (ltpls.empty())
	{
		// create a list of string ...

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

	TagParameterList * rtpl = NULL;
	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
			sid = TagParameterString::cast(rtpl->RemoveHead());
			nid = NULL;

			range = TagParameterString::cast(rtpl->RemoveHead());
			type = TagParameterString::cast(rtpl->RemoveHead());
		}
		else if (ret == 1)
		{
			nid = TagParameterInt::cast(rtpl->RemoveHead());
			range = TagParameterString::cast(rtpl->RemoveHead());
			type = TagParameterString::cast(rtpl->RemoveHead());
		}

		delete rtpl;
	}
	else
	{
		// failure
	}

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

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

	}

	TagParameterList * rtpl = NULL;
	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

			style = TagParameterString::cast(rtpl->RemoveHead());
			assert(style);

			if( style->TagIsSet() == false )
			{
				delete style;
				style = NULL;
			}


		}

		delete rtpl;
	}
	else
	{
		// failure
	}

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

		ListOfStrings lstrs; // (1); std::vector test impl
		lstrs.AddTail(( "S,type,,r;F,value,-1.0,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);

			mIntensText = tps->getValue();

			TagParameterFloat * tpf = TagParameterFloat::cast(rtpl->GetNext(pos));
			assert(tpf);

			if (tpf->pflag != TagParameter::NOTSET)
			{
				value = tpf->getValue();
			}
		}

		delete rtpl;
	}
	else
	{
		// failure
	}

	tpl.RemoveAll();
}
Exemple #18
0
// --------------------------------------------------------------------------
void
ARTempo::setTagParameterList( TagParameterList & tpl )
{
	if( ltpls.GetCount() == 0 ) {
		ListOfStrings lstrs;
		// A required tempo string and an optional bpm string.
		lstrs.AddTail( "S,tempo,,r;S,bpm,,o;U,dy,0,o" );
		CreateListOfTPLs( ltpls, lstrs );
	}

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

	/*
		We may have :
		\tempo <s1, s2>		// s1 is pure graphical, s2 (optional) pure musical
		\tempo <"Andante [1/4]=60">					will be the kString type
		\tempo <"Andante","1/4=60">					will be the kBPM type
		\tempo <"Andante [1/4]=[1/8]","1/4=1/8">	will be the kNoteEquiv type
	*/
	if( ret >= 0 && rtpl )
	{
		// we found a match!
		if( ret == 0 )
		{
			// - extract tempo mark informations.
			TagParameterString * tps = TagParameterString::cast(rtpl->RemoveHead());
			if (tps && strlen(tps->getValue())) {
				FormatStringParser p;
				mTempoMark.clear();
				p.parse (tps->getValue(), mTempoMark);
			}
			delete tps;
//			ParseTempoMark( tps );

			// - extract bpm informations
			tps = TagParameterString::cast(rtpl->RemoveHead());
			ParseBpm( tps );
			delete tps;

			delete mDy;
			mDy = TagParameterFloat::cast(rtpl->RemoveHead());
		}
		delete rtpl;
	}
	tpl.RemoveAll();
}
Exemple #19
0
void ARDrHoos::setTagParameterList(TagParameterList & tpl)
{
	if (ltpls.GetCount() == 0)
	{
		// create a list of string ...

		ListOfStrings lstrs; // (1); std::vector test impl
		lstrs.AddTail(
			(
			"I,inverse,0,o"));
		CreateListOfTPLs(ltpls,lstrs);

	}

	TagParameterList *rtpl = NULL;
	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();

			TagParameterInt * tpi =TagParameterInt::cast(rtpl->GetNext(pos));
			assert(tpi);

			if (tpi->pflag != TagParameter::NOTSET)
			{
				inverse = tpi->getValue();
			}

		}

		delete rtpl;
	}
	else
	{
		// failure
	}

	tpl.RemoveAll();

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

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

	TagParameterList * rtpl = NULL;
	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
			// GuidoPos pos = rtpl->GetHeadPosition();

			labels = TagParameterString::cast(rtpl->RemoveHead());
		}

		else if (ret == 1)
		{
			// we have a label-number
			labeli = TagParameterInt::cast(rtpl->RemoveHead());
		}

		delete rtpl;
	}
		
	
	tpl.RemoveAll();
}
Exemple #21
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 #22
0
void ARUnits::setTagParameterList(TagParameterList & tpl)
{
	if (ltpls.GetCount() == 0)
	{
		// create a list of string ...

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

	TagParameterList * rtpl = NULL;
	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);

			sType = tps->getValue();


		}

		delete rtpl;
	}
	else
	{
		// failure
	}

	tpl.RemoveAll();
}
Exemple #23
0
void ARSpace::setTagParameterList(TagParameterList & tpl)
{
	if (ltpls.GetCount() == 0)
	{

		ListOfStrings lstrs; // (1); std::vector test impl
		lstrs.AddTail( ( "U,dd,,r"));
		CreateListOfTPLs(ltpls,lstrs);

	}
	TagParameterList * rtpl = NULL;
	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();

			TagParameterFloat * tpf = TagParameterFloat::cast(rtpl->GetNext(pos));
			assert(tpf);

			val = tpf->getValue();
		}
		delete rtpl;

	}
	else
	{
		// failure.
	}
	tpl.RemoveAll();
	
}
Exemple #24
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();
}
Exemple #25
0
// -----------------------------------------------------------------------------
void ARTremolo::setTagParameterList(TagParameterList& tpl)
{
	if (ltpls.GetCount() == 0)
	{
		// create a list of string ...

		ListOfStrings lstrs; // (1); std::vector test impl
		lstrs.AddTail((
            "S,style,///,o;"
			"I,speed,32,o;"
            "S,pitch,,o;"
            "U,dx,0,o;U,dy,0,o;"
            "U,thickness,0.75,o;"
            "S,text,,o"
			));
		CreateListOfTPLs(ltpls,lstrs);
	}

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

	if (ret>=0 && rtpl)
	{
		// we found a match!
		if (ret == 0)
		{
			fStyle = TagParameterString::cast(rtpl->RemoveHead());
			assert(fStyle);
			if (fStyle->TagIsSet())
				mParSet = true;

			fSpeed = TagParameterInt::cast(rtpl->RemoveHead());
			assert(fSpeed);
			if (fSpeed->TagIsSet())
				mParSet = true;

			fPitch = TagParameterString::cast(rtpl->RemoveHead());
			assert(fPitch);
			if (fPitch->TagIsSet())
				mParSet = true;
            
			dx = TagParameterFloat::cast(rtpl->RemoveHead());
			assert(dx);
			if (dx->TagIsSet())
				mParSet = true;

			dy = TagParameterFloat::cast(rtpl->RemoveHead());
			assert(dy);
			if (dy->TagIsSet())
				mParSet = true;

			fThickness = TagParameterFloat::cast(rtpl->RemoveHead());
			assert(fThickness);
			if (fThickness->TagIsSet())
				mParSet = true;

			fText = TagParameterString::cast(rtpl->RemoveHead());
			assert(fText);
			if (fText->TagIsSet())
				mParSet = true;
		}

		delete rtpl;
	}
	else
	{
		// failure
	}

	tpl.RemoveAll();
}