void GRPositionTag::StaffBegin(GRStaff *grstaff) { // now we need to build a new staff if (!grstaff) return; GRSystemStartEndStruct * sse = new GRSystemStartEndStruct; GRSaveStruct * st = getNewGRSaveStruct(); sse->p = (void *) st; sse->grsystem = grstaff->getGRSystem(); sse->startflag = GRSystemStartEndStruct::OPENLEFT; sse->startpos = NULL; // ths startpos needs to be filled // by the next addAssociation call! // no need to call addAssociation (did that already ...)! sse->endflag = lastendflag; sse->endElement = lastendElement; sse->endpos = lastendpos; mStartEndList.AddTail(sse); if(error) { setStartElement(grstaff,NULL); setEndElement(grstaff,NULL); return; } setStartElement(grstaff, /*dynamic cast<GRNotationElement *>*/ (grstaff->getSecondGlue())); }
/** \brief Called after the new Staff has been created by the Staffmanager after a pbreak-Break. (It is ALWAYS called after a call to BreakTag) It is somewhat analogous to StaffBegin but uses the assocpos.` */ void GRPositionTag::ResumeTag(GRStaff * grstaff,GuidoPos assocpos) { if (!grstaff) return; GRSystemStartEndStruct * sse = new GRSystemStartEndStruct; sse->grsystem = grstaff->getGRSystem(); sse->startflag = GRSystemStartEndStruct::OPENLEFT; // here, we use the assocpos sse->startpos = assocpos; // no need to call addAssociation (did that already ...)! sse->endflag = lastendflag; sse->endElement = lastendElement; sse->endpos = lastendpos; GRSaveStruct * st = getNewGRSaveStruct(); sse->p = (void *) st; mStartEndList.AddTail(sse); if (error) { setStartElement(grstaff,NULL); setEndElement(grstaff,NULL); return; } setStartElement(grstaff, /*ynamic_cast<GRNotationElement *>*/(grstaff->getSecondGlue())); }
GRGrace::GRGrace( GRStaff * stf, ARGrace * argrc ) : GRARCompositeNotationElement(argrc), GRPositionTag(argrc->getEndPosition(), argrc ) { assert(stf); GRSystemStartEndStruct * sse = new GRSystemStartEndStruct; sse->grsystem = stf->getGRSystem(); sse->startflag = GRSystemStartEndStruct::LEFTMOST; sse->p = (void *) getNewGRSaveStruct(); mStartEndList.AddTail(sse); }
GRTremolo::GRTremolo( GRStaff * stf, ARTremolo * artrem ) : GRPTagARNotationElement(artrem) { assert(stf); GRSystemStartEndStruct * sse= new GRSystemStartEndStruct; sse->grsystem = stf->getGRSystem(); sse->startflag = GRSystemStartEndStruct::LEFTMOST; sse->p = (void *) getNewGRSaveStruct(); mStartEndList.AddTail(sse); }
GRTrill::GRTrill(GRStaff * inStaff, ARTrill * artrem ) : GRPTagARNotationElement(artrem) { assert(inStaff); GRSystemStartEndStruct * sse= new GRSystemStartEndStruct; sse->grsystem = inStaff->getGRSystem(); sse->startflag = GRSystemStartEndStruct::LEFTMOST; sse->p = (void *) getNewGRSaveStruct(); mStartEndList.AddTail(sse); ARTrill::TYPE mytype = artrem->getType(); bool ShowCautionaryAccidentals = artrem->getCautionary(); ARMusicalVoice::CHORD_TYPE chordType = artrem->getChordType(); ARMusicalVoice::CHORD_ACCIDENTAL chordAccidental = artrem->getChordAccidental(); // - Creation of the accidental symbol - switch (chordAccidental) { case ARMusicalVoice::NATURAL : fAccidental = new GRAccidental(0, 0, -10, 0.5f); break; case ARMusicalVoice::FLAT : fAccidental = new GRAccidental(0, 0, -1, 0.5f); break; case ARMusicalVoice::SHARP : fAccidental = new GRAccidental(0, 0, 1, 0.5f); break; case ARMusicalVoice::CAU_NATURAL : if (ShowCautionaryAccidentals) fAccidental = new GRAccidental(0, 0, 10, 0.5f); else fAccidental = new GRAccidental(0, 0, 0, 0.5f); break; case ARMusicalVoice::CAU_FLAT : if (ShowCautionaryAccidentals) fAccidental = new GRAccidental(0, 0, -3, 0.5f); else fAccidental = new GRAccidental(0, 0, 0, 0.5f); break; case ARMusicalVoice::CAU_SHARP : if (ShowCautionaryAccidentals) fAccidental = new GRAccidental(0, 0, 3, 0.5f); else fAccidental = new GRAccidental(0, 0, 0, 0.5f); break; default : fAccidental = new GRAccidental(0, 0, 0, 0.5f); } fAccidental->setOffsetX(this->getOffset().x + artrem->getadx()); fAccidental->setOffsetY(this->getOffset().y - artrem->getady()); // this offset affects each type of ornament switch ( mytype ) { case ARTrill::TRILL: switch (chordType) { case ARMusicalVoice::ERROR: setTrillSymbol( kNoneSymbol ); break; default : setupTrill(); } break; case ARTrill::TURN: switch (chordType) { case ARMusicalVoice::DOWN: setupInvertedTurn(); break; case ARMusicalVoice::DOWN_COMPLEX: setupInvertedTurnComplex(); break; case ARMusicalVoice::UP_COMPLEX: setupTurnComplex(); break; case ARMusicalVoice::ERROR: setTrillSymbol( kNoneSymbol ); break; default : setupTurn(); } break; case ARTrill::MORD: switch (chordType) { case ARMusicalVoice::DOWN_SIMPLE: setupInvertedMord(); break; case ARMusicalVoice::DOWN: setupPrallMordent(); break; case ARMusicalVoice::UP: setupPrallPrall(); break; case ARMusicalVoice::ERROR: setTrillSymbol( kNoneSymbol ); break; default : setupMord(); } break; } }