private void btnImport_Click(object sender, EventArgs e) { OpenFileDialog o = new OpenFileDialog(); o.CheckFileExists = true; o.DefaultExt = ".wav"; o.Filter = "WAV sound file (*.wav)|*.wav"; o.Multiselect = false; if (o.ShowDialog() != DialogResult.OK) { return; } try { string imported = pluginHost.Get_TempFolder() + Path.DirectorySeparatorChar + Path.GetRandomFileName(); soundBase.Import(o.FileName); byte[] enc_data = soundBase.Encode(); soundBase.Write_File(imported, enc_data); wav_file = o.FileName; pluginHost.ChangeFile(soundBase.ID, imported); } catch (NotImplementedException ex) { MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void btnImport_Click(object sender, EventArgs e) { OpenFileDialog o = new OpenFileDialog(); o.CheckFileExists = true; o.DefaultExt = ".wav"; o.Filter = "WAV sound file (*.wav)|*.wav"; o.Multiselect = false; if (o.ShowDialog() != DialogResult.OK) { return; } string imported = pluginHost.Get_TempFolder() + Path.DirectorySeparatorChar + Path.GetRandomFileName(); soundBase.Import(wav_file); byte[] enc_data = soundBase.Encode(); soundBase.Write_File(wav_file, enc_data); wav_file = imported; }