use of com.xenoage.zong.core.music.StavesList in project Zong by Xenoage.
the class Test41c method test.
@Test
public void test() {
Score score = getScore();
StavesList stavesList = score.getStavesList();
StavesListTest.checkPartNames(stavesList, expectedPartNames);
StavesListTest.checkBracketGroups(stavesList, expectedBracketGroups);
StavesListTest.checkBarlineGroups(stavesList, expectedBarlineGroups);
}
use of com.xenoage.zong.core.music.StavesList in project Zong by Xenoage.
the class Test41d method test.
@Test
public void test() {
Score score = getScore();
StavesList stavesList = score.getStavesList();
StavesListTest.checkBracketGroups(stavesList, expectedBracketGroups);
StavesListTest.checkBarlineGroups(stavesList, expectedBarlineGroups);
}
use of com.xenoage.zong.core.music.StavesList in project Zong by Xenoage.
the class Test41e method test.
@Test
public void test() {
Score score = getScore();
StavesList stavesList = score.getStavesList();
StavesListTest.checkPartNames(stavesList, expectedPartNames);
StavesListTest.checkPartAbbreviations(stavesList, expectedPartAbbreviations);
}
use of com.xenoage.zong.core.music.StavesList in project Zong by Xenoage.
the class StavesListReaderTest method createStavesList.
private StavesList createStavesList(String filePath) {
MusicXMLDocument doc = null;
try {
doc = MusicXMLDocument.read(platformUtils().createXmlReader(jsePlatformUtils().openFile(filePath)));
} catch (FileNotFoundException ex) {
// file not there. ignore, since copyrighted file. - TODO: ask Michael Good for file license
return null;
} catch (Exception ex) {
fail(ex.toString());
}
StavesListReader stavesListReader = new StavesListReader(doc.getScore(), new ErrorHandling(Level.ThrowException));
StavesList stavesList = null;
try {
stavesList = stavesListReader.read();
} catch (Exception ex) {
fail(ex.toString());
}
return stavesList;
}
use of com.xenoage.zong.core.music.StavesList in project Zong by Xenoage.
the class StavesListReaderTest method testStavesList2.
/**
* Reads and checks the parts and staves of the file "ActorPreludeSample.xml"
* from the MusicXML 1.1 sample files.
*/
@Test
public void testStavesList2() {
String file = "data/test/scores/musicxml11/ActorPreludeSample.xml";
// proprietary file. if not there, ignore test
if (false == jsePlatformUtils().getFilesystemInput().existsFile(file))
return;
StavesList sl = createStavesList(file);
if (sl == null)
return;
assertEquals(22, sl.getParts().size());
assertEquals(23, sl.getStaves().size());
// barline groups
// (5, as can be seen on the first page of the PDF)
assertEquals(5, sl.getBarlineGroups().size());
for (int i = 0; i < 23; i++) {
assertNotNull("failed at " + i, sl.getBarlineGroupByStaff(i));
assertEquals("failed at " + i, BarlineGroup.Style.Common, sl.getBarlineGroupByStaff(i).getStyle());
}
// bracket groups
// (8, as can be seen on the first page of the PDF)
assertEquals(8, sl.getBracketGroups().size());
}
Aggregations