use of com.xenoage.zong.musiclayout.settings.LayoutSettings in project Zong by Xenoage.
the class ScoreLayouterTest method testSampleFiles.
/**
* Try to layout all official MusicXML 1.1 and 2.0 sample files.
* We can not test for the correct layout of course, but at least
* we want to have no exceptions.
*/
@Test
public void testSampleFiles() throws Exception {
SymbolPool symbolPool = sync(new SymbolPoolReader("default"));
LayoutSettings layoutSettings = LayoutSettingsReader.read(jsePlatformUtils().openFile("data/test/layout/LayoutSettingsTest.xml"));
for (String file : MusicXmlScoreFileInputTest.getSampleFiles()) {
try {
// System.out.println(file);
Score score = new MusicXmlScoreFileInput().read(jsePlatformUtils().openFile(file), file);
Size2f areaSize = new Size2f(150, 10000);
Context context = new Context(score, symbolPool, layoutSettings);
Target target = Target.completeLayoutTarget(new ScoreLayoutArea(areaSize));
ScoreLayouter layouter = new ScoreLayouter(context, target);
layouter.createLayoutWithExceptions();
} catch (Exception ex) {
ex.printStackTrace();
fail("Failed to layout file: " + file);
}
}
}
Aggregations