use of com.xenoage.zong.io.musicxml.opus.Score in project Zong by Xenoage.
the class CompressedFileInput method loadScore.
/**
* Loads and returns the {@link com.xenoage.zong.core.Score} at the given path.
*/
public com.xenoage.zong.core.Score loadScore(String path) throws InvalidFormatException, IOException {
BufferedInputStream bis = new BufferedInputStream(zip.openFile(path));
// XML or compressed?
bis.mark();
FileType fileType = FileTypeReader.getFileType(bis);
bis.reset();
bis.unmark();
if (fileType == null)
throw new InvalidFormatException("Score has invalid format: " + path);
com.xenoage.zong.core.Score ret = null;
switch(fileType) {
case Compressed:
ret = loadCompressedScore(path);
break;
case XMLScorePartwise:
ret = new MusicXmlScoreFileInput().read(bis, path);
break;
case XMLScoreTimewise:
throw new IllegalStateException("score-timewise is currently not implemented");
default:
throw new InvalidFormatException("Score has invalid format: " + path);
}
bis.close();
return ret;
}
use of com.xenoage.zong.io.musicxml.opus.Score in project Zong by Xenoage.
the class OpusFileInput method readScore.
private Score readScore(XmlReader reader) {
String href = reader.getAttribute("href");
Boolean newPage = Parser.parseBooleanNullYesNo(reader.getAttribute("new-page"));
return new Score(new LinkAttributes(href), newPage);
}
Aggregations