Ejemplo n.º 1
0
        public ADPSheet Handle(string _path)
        {
            string tempExt = System.IO.Path.GetExtension(_path);

            if (tempExt.Equals(ext))
            {
                return(ReadFile(_path));
            }
            else
            {
                if (nextADPFileConverter == null)
                {
                    return(null);
                }
                else
                {
                    return(nextADPFileConverter.Handle(_path));
                }
            }
        }
Ejemplo n.º 2
0
        public void OpenFile() //Opens a filedialog where you can select a file to open, accepts: midi and lilypond files
        {
            OpenFileDialog openFileDialog = new OpenFileDialog()
            {
                Filter = "Midi Files(.mid)|*.mid|Lily files (*.ly*)|*.ly*"
            };

            if (openFileDialog.ShowDialog() == true)
            {
                txt_MidiFilePath.Text = openFileDialog.FileName;
                ADPSheet sheet = firstFileConverter.Handle(openFileDialog.FileName);
                if (sheet != null)
                {
                    showSheetVisualisation(sheet.getTrack());
                    NoteToLilypondConverter ntlc = new NoteToLilypondConverter();
                    lilypondText.Text = ntlc.GetLilypond(sheet);
                    SetNewState();
                }
            }
        }