本文整理汇总了C++中Tuplet::SetNumbase方法的典型用法代码示例。如果您正苦于以下问题:C++ Tuplet::SetNumbase方法的具体用法?C++ Tuplet::SetNumbase怎么用?C++ Tuplet::SetNumbase使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Tuplet
的用法示例。
在下文中一共展示了Tuplet::SetNumbase方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: parseNote
void PaeInput::parseNote(NoteObject note) {
LayerElement *element;
if (note.rest) {
Rest *rest = new Rest();
rest->SetDots( note.dots );
rest->SetDur(note.duration);
if (note.fermata) {
rest->SetFermata(PLACE_above); // always above for now
}
element = rest;
} else {
Note *mnote = new Note();
mnote->SetPname(note.pitch);
mnote->SetOct(note.octave);
mnote->SetAccid(note.accidental);
mnote->SetDots( note.dots );
mnote->SetDur(note.duration);
if (note.fermata) {
mnote->SetFermata(PLACE_above); // always above for now
}
if (note.trill == true)
mnote->m_embellishment = EMB_TRILL;
if (m_last_tied_note != NULL) {
mnote->SetTie(TIE_t);
m_last_tied_note = NULL;
}
if (note.tie) {
if (mnote->GetTie()==TIE_t) mnote->SetTie(TIE_m);
else mnote->SetTie(TIE_i);
m_last_tied_note = mnote;
}
element = mnote;
}
// Does this note have a clef change? push it before everyting else
if (note.clef)
addLayerElement(note.clef);
// Same thing for time changes
// You can find this sometimes
if (note.meter)
addLayerElement(note.meter);
// Handle key change. Evil if done in a beam
if (note.key)
addLayerElement(note.key);
// Acciaccaturas are similar but do not get beamed (do they)
// this case is simpler. NOTE a note can not be acciacctura AND appoggiatura
// Acciaccatura rests do not exist
if (note.acciaccatura && (element->Is() == NOTE) ) {
Note *note = dynamic_cast<Note*>(element);
assert( note );
note->SetDur(DURATION_8);
note->SetGrace(GRACE_acc);
note->SetStemDir(STEMDIRECTION_up);
}
if ( (note.appoggiatura > 0) && (element->Is() == NOTE) ) {
Note *note = dynamic_cast<Note*>(element);
assert( note );
note->SetGrace(GRACE_unacc);
note->SetStemDir(STEMDIRECTION_up);
}
if (note.beam == BEAM_INITIAL) {
pushContainer(new Beam());
}
// we have a tuplet, the tuplet_note is > 0
// which means we are counting a tuplet
if (note.tuplet_note > 0 && note.tuplet_notes == note.tuplet_note) { // first elem in tuplet
Tuplet *newTuplet = new Tuplet();
newTuplet->SetNum(note.tuplet_notes);
newTuplet->SetNumbase(note.tuplet_notes);
pushContainer(newTuplet);
}
// Add the note to the current container
addLayerElement(element);
// the last note counts always '1'
// insert the tuplet elem
// and reset the tuplet counter
if (note.tuplet_note == 1)
popContainer();
//.........这里部分代码省略.........