Search in sources :

Example 6 with StavesList

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);
}
Also used : Score(com.xenoage.zong.core.Score) StavesList(com.xenoage.zong.core.music.StavesList) Test(org.junit.Test) StavesListTest(musicxmltestsuite.tests.utils.StavesListTest)

Example 7 with StavesList

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);
}
Also used : Score(com.xenoage.zong.core.Score) StavesList(com.xenoage.zong.core.music.StavesList) Test(org.junit.Test) StavesListTest(musicxmltestsuite.tests.utils.StavesListTest)

Example 8 with StavesList

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);
}
Also used : Score(com.xenoage.zong.core.Score) StavesList(com.xenoage.zong.core.music.StavesList) Test(org.junit.Test) StavesListTest(musicxmltestsuite.tests.utils.StavesListTest)

Example 9 with StavesList

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;
}
Also used : ErrorHandling(com.xenoage.zong.io.musicxml.in.util.ErrorHandling) StavesList(com.xenoage.zong.core.music.StavesList) FileNotFoundException(java.io.FileNotFoundException) MusicXMLDocument(com.xenoage.zong.musicxml.MusicXMLDocument) FileNotFoundException(java.io.FileNotFoundException)

Example 10 with 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());
}
Also used : StavesList(com.xenoage.zong.core.music.StavesList) Test(org.junit.Test)

Aggregations

StavesList (com.xenoage.zong.core.music.StavesList)13 Score (com.xenoage.zong.core.Score)9 Test (org.junit.Test)9 Part (com.xenoage.zong.core.music.Part)4 StavesListTest (musicxmltestsuite.tests.utils.StavesListTest)4 StavesRange (com.xenoage.zong.core.music.group.StavesRange)2 ErrorHandling (com.xenoage.zong.io.musicxml.in.util.ErrorHandling)2 InvalidFormatException (com.xenoage.utils.exceptions.InvalidFormatException)1 LayoutFormat (com.xenoage.zong.core.format.LayoutFormat)1 ScoreFormat (com.xenoage.zong.core.format.ScoreFormat)1 ScoreHeader (com.xenoage.zong.core.header.ScoreHeader)1 ScoreInfo (com.xenoage.zong.core.info.ScoreInfo)1 Staff (com.xenoage.zong.core.music.Staff)1 BracketGroup (com.xenoage.zong.core.music.group.BracketGroup)1 Tuplet (com.xenoage.zong.core.music.tuplet.Tuplet)1 FormattedTextElement (com.xenoage.zong.core.text.FormattedTextElement)1 FormattedTextString (com.xenoage.zong.core.text.FormattedTextString)1 FormattedTextStyle (com.xenoage.zong.core.text.FormattedTextStyle)1 LayoutFormatReader (com.xenoage.zong.io.musicxml.in.readers.LayoutFormatReader)1 ScoreFormatReader (com.xenoage.zong.io.musicxml.in.readers.ScoreFormatReader)1