本文整理汇总了C++中Note::fret方法的典型用法代码示例。如果您正苦于以下问题:C++ Note::fret方法的具体用法?C++ Note::fret怎么用?C++ Note::fret使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Note
的用法示例。
在下文中一共展示了Note::fret方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: drop
Element* ChordRest::drop(const DropData& data)
{
Element* e = data.element;
Measure* m = measure();
switch (e->type()) {
case Element::Type::BREATH:
{
Breath* b = static_cast<Breath*>(e);
b->setTrack(staffIdx() * VOICES);
// TODO: insert automatically in all staves?
Segment* seg = m->undoGetSegment(Segment::Type::Breath, tick());
b->setParent(seg);
score()->undoAddElement(b);
}
return e;
case Element::Type::BAR_LINE:
{
BarLine* bl = static_cast<BarLine*>(e);
bl->setTrack(staffIdx() * VOICES);
if (tick() == m->tick())
return m->drop(data);
Segment* seg = m->undoGetSegment(Segment::Type::BarLine, tick());
bl->setParent(seg);
score()->undoAddElement(bl);
}
return e;
case Element::Type::CLEF:
score()->cmdInsertClef(static_cast<Clef*>(e), this);
break;
case Element::Type::TEMPO_TEXT:
{
TempoText* tt = static_cast<TempoText*>(e);
tt->setParent(segment());
TextStyleType st = tt->textStyleType();
tt->setTextStyleType(st);
score()->undoAddElement(tt);
}
return e;
case Element::Type::DYNAMIC:
{
Dynamic* d = static_cast<Dynamic*>(e);
d->setTrack(track());
TextStyleType st = d->textStyleType();
d->setTextStyleType(st);
d->setParent(segment());
score()->undoAddElement(d);
}
return e;
case Element::Type::FRET_DIAGRAM:
case Element::Type::SYMBOL:
e->setTrack(track());
e->setParent(segment());
score()->undoAddElement(e);
return e;
case Element::Type::NOTE:
{
Note* note = static_cast<Note*>(e);
NoteVal nval;
nval.pitch = note->pitch();
nval.headGroup = note->headGroup();
nval.fret = note->fret();
nval.string = note->string();
score()->setNoteRest(segment(), track(), nval, data.duration, MScore::Direction::AUTO);
delete e;
}
break;
case Element::Type::HARMONY:
static_cast<Harmony*>(e)->render();
// fall through
case Element::Type::TEXT:
case Element::Type::STAFF_TEXT:
case Element::Type::STAFF_STATE:
case Element::Type::INSTRUMENT_CHANGE:
case Element::Type::REHEARSAL_MARK:
e->setParent(segment());
e->setTrack((track() / VOICES) * VOICES);
{
Text* f = static_cast<Text*>(e);
TextStyleType st = f->textStyleType();
if (st >= TextStyleType::DEFAULT)
f->setTextStyleType(st);
}
score()->undoAddElement(e);
return e;
case Element::Type::FIGURED_BASS:
{
bool bNew;
FiguredBass * fb = static_cast<FiguredBass *>(e);
fb->setParent( segment() );
//.........这里部分代码省略.........