本文整理汇总了C++中NoteDot类的典型用法代码示例。如果您正苦于以下问题:C++ NoteDot类的具体用法?C++ NoteDot怎么用?C++ NoteDot使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了NoteDot类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: toNote
void InspectorNote::dot4Clicked()
{
Note* note = toNote(inspector->element());
if (note == 0)
return;
if (note->dots().size() > 3) {
NoteDot* dot = note->dot(3);
dot->score()->select(dot);
inspector->setElement(dot);
dot->score()->update();
}
}
示例2:
void InspectorNote::dot3Clicked()
{
Note* note = static_cast<Note*>(inspector->element());
if (note == 0)
return;
NoteDot* dot = note->dot(2);
if (dot) {
dot->score()->select(dot);
inspector->setElement(dot);
dot->score()->end();
}
}
示例3: toRest
void InspectorRest::dotClicked(int n)
{
Rest* rest = toRest(inspector->element());
if (rest == 0)
return;
if (rest->dots() > n) {
NoteDot* dot = rest->dot(n);
dot->score()->select(dot);
dot->score()->update();
inspector->update();
}
}
示例4: readUChar
//.........这里部分代码省略.........
int strings = readUChar(); // used strings mask
Fraction l = len2fraction(len);
// Some beat effects could add a Chord before this
ChordRest* cr = segment->cr(track);
if (voice != 0 && pause == 0 && strings == 0)
cr = 0;
else {
if (strings == 0) {
if (cr) {
segment->remove(cr);
delete cr;
cr = 0;
}
cr = new Rest(score);
}
else {
if (!cr)
cr = new Chord(score);
}
cr->setTrack(track);
TDuration d(l);
d.setDots(dotted ? 1 : 0);
if (dotted)
l = l + (l/2);
if (tuple) {
Tuplet* tuplet = tuplets[staffIdx * 2 + voice];
if ((tuplet == 0) || (tuplet->elementsDuration() == tuplet->baseLen().fraction() * tuplet->ratio().numerator())) {
tuplet = new Tuplet(score);
// int track = staffIdx * 2 + voice;
tuplets[staffIdx * 2 + voice] = tuplet;
tuplet->setTrack(cr->track());
setTuplet(tuplet, tuple);
tuplet->setParent(measure);
}
tuplet->setTrack(cr->track());
tuplet->setBaseLen(l);
tuplet->setDuration(l * tuplet->ratio().denominator());
cr->setTuplet(tuplet);
tuplet->add(cr);
}
cr->setDuration(l);
if (cr->type() == Element::Type::REST && (pause == 0 || l == measure->len()))
cr->setDurationType(TDuration::DurationType::V_MEASURE);
else
cr->setDurationType(d);
if(!segment->cr(track))
segment->add(cr);
Staff* staff = cr->staff();
int numStrings = staff->part()->instr()->stringData()->strings();
bool hasSlur = false;
for (int i = 6; i >= 0; --i) {
if (strings & (1 << i) && ((6-i) < numStrings)) {
Note* note = new Note(score);
if (dotted) {
// there is at most one dotted note in this guitar pro version
NoteDot* dot = new NoteDot(score);
dot->setIdx(0);
dot->setParent(note);
dot->setTrack(track); // needed to know the staff it belongs to (and detect tablature)
dot->setVisible(true);
note->add(dot);
}
static_cast<Chord*>(cr)->add(note);
hasSlur = readNote(6-i, note);
note->setTpcFromPitch();
}
}
createSlur(hasSlur, staffIdx, cr);
if (lyrics)
cr->add(lyrics);
}
int rr = readChar();
if (cr && (cr->type() == Element::Type::CHORD)) {
Chord* chord = static_cast<Chord*>(cr);
applyBeatEffects(chord, beatEffects);
if (rr == ARPEGGIO_DOWN)
chord->setStemDirection(MScore::Direction::DOWN);
else if (rr == ARPEGGIO_UP)
chord->setStemDirection(MScore::Direction::UP);
}
int r = readChar();
if (r & 0x8) {
int rrr = readChar();
qDebug(" 3beat read 0x%02x", rrr);
}
if (cr && (cr->type() == Element::Type::CHORD) && slide > 0)
createSlide(slide, cr, staffIdx);
restsForEmptyBeats(segment, measure, cr, l, track, tick);
return cr ? cr->actualTicks() : measure->ticks();
}