public LilyPondFileHandler(LilyPondInterpreter interpreter) { this.interpreter = interpreter; this.fileType = "LilyPond"; this.possibleExtensions = new List <string> { ".ly" }; CanSave = true; CanLoad = true; CanGenerateSequence = false; }
protected override Score load(string fileName) { var midiSequence = new Sequence(); midiSequence.Load(fileName); Score res = interpreter.ConvertBack(midiSequence); LilypondText = new LilyPondInterpreter(new LilyPondNoteFactory()).Convert(res); return(res); }
private void RegenerateBasedOnEditor(object obj) { string lilypond = (string)obj; GenericHandler handler = handlers.First(h => h.fileType == "LilyPond"); var score = new LilyPondInterpreter(new LilyPondNoteFactory()).ConvertBack(lilypond); OwnEventmanager.Manager.DispatchEvent("setStaffs", score); var se = handlers.First(h => h.CanGenerateSequence).GenerateSequence(score); OwnEventmanager.Manager.DispatchEvent("setSequence", se); }