how to use libmscore to create a scoreview without displaying title author info..(just like iOS or android version)

• Sep 14, 2015 - 03:28

Hi,

I am using libmscore to develop an app which just display musical score, without other extra info(such as title, author and image...etc.)

here is my code for initializing the score view, and i don't know which functions of Ms::Score can be called to hide the title, author, image and other extra info(just like MuseScore for iOS and android), can you help me?

score = new Ms::Score(Ms::MScore::defaultStyle());
score->setLayoutMode(Ms::LayoutMode::FLOAT);
Ms::PageFormat pageFormat;
pageFormat.setSize(QSizeF(parentWidth() / Ms::MScore::DPI, parentHeight() / Ms::MScore::DPI));
pageFormat.setPrintableWidth((parentWidth()-10) / Ms::MScore::DPI);
pageFormat.setEvenLeftMargin(5.0 / Ms::MScore::DPI);
pageFormat.setOddLeftMargin(5.0 / Ms::MScore::DPI);
pageFormat.setEvenTopMargin(0.0);
pageFormat.setEvenBottomMargin(0.0);
pageFormat.setOddTopMargin(0.0);
pageFormat.setOddBottomMargin(0.0);

pageFormat.setTwosided(false);

Ms::MStyle* style = score->style();
style->setPageFormat(pageFormat);
style->setSpatium(10.0);

score->setName(name);

if (Ms::Score::FileError::FILE_NO_ERROR != score->loadMsc(name, true)) {
delete score;
score = 0;
return;
}

score->doLayout();
score->setPrinting(true); // render only printable elements

Ms::Page* page = score->pages()[_currentPage];
QRectF rect(page->abbox());
mScale = qMin(parentWidth() / rect.width(), parentHeight() / rect.height());

_boundingRect = QRectF(0.0, 0.0, rect.width() * mScale, rect.height() * mScale);

setWidth(rect.width() * mScale);
setHeight(rect.height() * mScale);
update();

Do you still have an unanswered question? Please log in first to post your question.