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

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

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

hongmingniat
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 should be called to hide the title, author, image and other extra info(just like MuseScore for iOS and android), can you help me? Thank you very much.

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();
Loading...