static void setTempo(Ms::Score* score, int tempo) { Ms::TempoText* tt = new Ms::TempoText(score); tt->setTempo(double(tempo)/60.0); tt->setTrack(0); QString tempoText = Ms::TempoText::duration2tempoTextString(Ms::TDuration::DurationType::V_QUARTER); tempoText += QString(" = %1").arg(tempo); tt->setPlainText(tempoText); Ms::Measure* measure = score->firstMeasure(); Ms::Segment* segment = measure->getSegment(Ms::Segment::Type::ChordRest, 0); segment->add(tt); }
static void setTempo(Ms::Score* score, int tempo) { Ms::TempoText* tt = new Ms::TempoText(score); tt->setTempo(double(tempo)/60.0); tt->setTrack(0); #if 0 // TODO WS Ms::QTextCursor* c = tt->startCursorEdit(); c->movePosition(QTextCursor::EndOfLine); addSymbolToText(SymCode(0xe105, 1), c); c->insertText(" = "); c->insertText(QString("%1").arg(tempo)); tt->endEdit(); #endif Ms::Measure* measure = score->firstMeasure(); Ms::Segment* segment = measure->getSegment(Ms::Segment::SegChordRest, 0); segment->add(tt); }