use of com.xenoage.zong.desktop.io.ogg.out.OggScoreDocFileOutput in project Zong by Xenoage.
the class Content method saveAs.
/**
* Saves the current score using the given format.
* pdf, png, mid and ogg is supported by this demo.
*/
public void saveAs(String format) {
FileOutput<ScoreDoc> out = null;
switch(format) {
case "pdf":
out = new PdfScoreDocFileOutput();
break;
case "png":
out = new PngScoreDocFileOutput();
break;
case "mid":
out = new MidiScoreDocFileOutput();
break;
case "ogg":
out = new OggScoreDocFileOutput();
break;
default:
return;
}
String filePath = "demo." + format;
try {
DocumentIO.write(scoreDoc, new File(filePath), out);
mainWindow.showMessageDialog(filePath + " saved.");
} catch (Exception ex) {
Err.handle(Report.Companion.error(ex));
}
}
Aggregations