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(); }
float GRGlobalStem::changeStemLength( float inLen ) { if (stemlengthset) { GuidoWarn("Stemlength already set!"); if (theStem) return theStem->getStemLength(); } else if (theStem) { theStem->setStemLength( inLen ); return theStem->getStemLength(); } return 0; }
void GRGrace::tellPosition(GObject *caller, const NVPoint & inPos ) { if (mAssociated->GetCount() != 1) { GuidoWarn("More than one association for GRGrace"); return; } // this is called by the "super-event" const float graceOffset = 60; // Hardcoded setHPosition( inPos.x - graceOffset ); // mAssociated->setPosition(position); }