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

		ListOfStrings lstrs; // (1); std::vector test impl
		lstrs.AddTail( (
			"S,type,treble,r")); // old:;F,size,1.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)
		{
			TagParameterString * tps =  TagParameterString::cast(rtpl->RemoveHead());
			assert(tps);
			setName(tps->getValue());
			delete tps;
		}
		delete rtpl;
	}
	else
	{
		// failure
	}
	tpl.RemoveAll();
}
Example #2
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();
}
Example #3
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();
}
Example #4
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;


}
Example #5
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();
}
Example #6
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();
}
Example #7
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();
}
Example #8
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();
}
Example #9
0
void ARVolta::setTagParameterList(TagParameterList & tpl)
{
	if (ltpls.empty()) {
		ListOfStrings lstrs;
		lstrs.AddTail( "S,pass,,r;S,m,,r;S,format,,o" );
		CreateListOfTPLs(ltpls,lstrs);
	}
	TagParameterList * rtpl = NULL;
	int ret = MatchListOfTPLsWithTPL(ltpls,tpl,&rtpl);

	if( ret >= 0 && rtpl ) {
		if( ret == 0 ) {
			TagParameterString * tps = TagParameterString::cast(rtpl->RemoveHead());
			if (tps) mPass = tps->getValue();
			tps = TagParameterString::cast(rtpl->RemoveHead());
			if (tps) mMark = tps->getValue();
			tps = TagParameterString::cast(rtpl->RemoveHead());
			if (tps) mFormat = tps->getValue();
		}	
		delete rtpl;
	}
	tpl.RemoveAll();
}
Example #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();

}
Example #11
0
void ARKey::setTagParameterList(TagParameterList & tpl)
{
	if (ltpls.GetCount() == 0)
	{
		// create a list of string ...
		ListOfStrings lstrs; // (1); std::vector test impl

		// either a key-string ("G") or a key-number key=3
		lstrs.AddTail(( "S,key,,r"));
		lstrs.AddTail(( "I,key,,r"));
		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);

			NVstring name = tps->getValue();

			// ist free-Tag gesetzt?
			if (name.substr(0, 5) == "free=" ) {
				mIsFree = true;
//				getKeyArray(name.substr(5, name.length()-5));
				newgetKeyArray (name.substr(5, name.length()-5));
			}
			else {
                if (name.size() == 0)
                    name = "C"; // C by default

				mIsFree = false;
				int t = (int)name[0];
				int major = (t == toupper(t));

				t = toupper(t);				
				switch (t) 
				{
					case 'F': 	fKeyNumber = -1;	break;
					case 'C': 	fKeyNumber = 0;	break;
					case 'G': 	fKeyNumber = 1;	break;
					case 'D': 	fKeyNumber = 2;	break;
					case 'A': 	fKeyNumber = 3;	break;
					case 'E': 	fKeyNumber = 4;	break;
					case 'H':
					case 'B':	fKeyNumber = 5;	break;
					default:
                        major = true;
                        fKeyNumber = 0;
				}
				
				if (!major)				fKeyNumber -= 3;		// minus 3 accidentals  (A-Major ->  a-minor ...)				
				if (name.length() > 1)
				{
					t = name[1];
					if (t == '#')		fKeyNumber += 7;
					else if (t == '&')	fKeyNumber -= 7;
				}
			}
		}
		else if (ret == 1)
		{
			// 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);
			fKeyNumber = tpi->getValue();
		}
		delete rtpl;
	}
	else
	{
		// failure
	}
	tpl.RemoveAll();
}
Example #12
0
void ARGlissando::setTagParameterList(TagParameterList & tpl)
{
	if (ltpls.GetCount() == 0)
	{
		ListOfStrings lstrs; // (1); std::vector test impl
		
		lstrs.AddTail( "U,dx1,0,o;U,dy1,0,o;"
			"U,dx2,0,o;U,dy2,0,o;"
			"S,fill,false,o;U,thickness,0.3,o"
			//";S,lineStyle,line,o"
            );
		
		CreateListOfTPLs(ltpls,lstrs);
	}

	TagParameterList * rtpl = 0;
	int ret = MatchListOfTPLsWithTPL(ltpls,tpl,&rtpl);
	if (ret>=0 && rtpl)
	{
		// we found a match!
		if (ret == 0)
		{
			TagParameterFloat *f = TagParameterFloat::cast(rtpl->RemoveHead());
            fDx1 = f->getValue();
            delete f;

			f = TagParameterFloat::cast(rtpl->RemoveHead());
            fDy1 = f->getValue();
            delete f;

			f = TagParameterFloat::cast(rtpl->RemoveHead());
            fDx2 = f->getValue();
            delete f;

			f = TagParameterFloat::cast(rtpl->RemoveHead());
            fDy2 = f->getValue();
            delete f;

            TagParameterString *s = TagParameterString::cast(rtpl->RemoveHead());
            s->getBool(fFill);
            delete s;

			f = TagParameterFloat::cast(rtpl->RemoveHead());
            fThickness = f->getValue();
            delete f;

			/*s = TagParameterString::cast(rtpl->RemoveHead());
			string wavyLine("wavy");
			if (wavyLine == s->getValue())
				fWavy = true;*/
		}

		delete rtpl;
	}
	else
	{
		// failure
	}

	tpl.RemoveAll();

	return;
}
Example #13
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();
}