コード例 #1
0
        public void ShowStaff(string content)
        {
            if (content != null)
            {
                LilypondText = content;
            }
            Staff.Clear();
            Lilypond lily = new Lilypond("");

            Staff = lily.ReadLily(Staff, LilypondText);
            ShowStaff();
        }
コード例 #2
0
        public void OpenFile(string fileName)
        {
            Staff.Clear();
            Midi     midi = new Midi(fileName);
            Lilypond lily = new Lilypond(fileName);

            if (Path.GetExtension(fileName).EndsWith(".mid"))
            {
                midi.Open();
                midi.ReadMidi(Staff);
            }
            else if (Path.GetExtension(fileName).EndsWith(".ly"))
            {
                lily.Open();
                lily.ReadLily(Staff);
            }
            else
            {
                throw new NotSupportedException($"File extension {Path.GetExtension(fileName)} is not supported.");
            }
            originalLily = lily.GetLilyFromStaff(Staff);
            ShowStaff();
        }