示例#1
0
        private void Export()
        {
            if (txtInput.Text == String.Empty)
            {
                throw new ExportException("Please select an input folder.");
            }

            if (txtOutput.Text == String.Empty)
            {
                throw new ExportException("Please select an output folder.");
            }

            DirectoryInfo input = new DirectoryInfo(txtInput.Text);

            if (!input.Exists)
            {
                throw new ExportException("Could not find the input folder.");
            }

            FileInfo[] files = input.GetFiles("*.ath");

            if (files.Length <= 0)
            {
                throw new ExportException("Could not find any supported files in the input folder.");
            }

            DirectoryInfo output = new DirectoryInfo(txtOutput.Text);

            if (!output.Exists)
            {
                DialogResult result = MessageBox.Show("Output folder does not exist. Do you want to create it?", "Create new folder?", MessageBoxButtons.YesNo, MessageBoxIcon.Question);

                if (result == DialogResult.Yes)
                {
                    output.Create();
                }
                else
                {
                    throw new ExportException("Could not create the output folder.");
                }

                output.Refresh();
            }

            for (int i = 0; i < files.Length; i++)
            {
                ATHDocument athDoc = new ATHDocument(files[i].OpenRead());
                ATFDocument atfDoc = new ATFDocument(athDoc);

                atfDoc.SaveAllData(output);
            }

            MessageBox.Show("Export is complete.", "MGU Speech Exporter", MessageBoxButtons.OK, MessageBoxIcon.Information);
        }
示例#2
0
 public ATFEntry(ATHEntry header, ATFDocument document)
 {
     Document = document;
     Header   = header;
 }