private void ExportButton_Click(object sender, EventArgs e) { string title = R._("保存するファイル名を選択してください"); string filter = R._("sound|*.s;*.mid|s|*.s|midi|*.mid|MusicalInstrument|*.instrument|All files|*"); string songname = "song" + U.ToHexString(AddressList.SelectedIndex); SaveFileDialog save = new SaveFileDialog(); save.Title = title; save.Filter = filter; save.AddExtension = true; Program.LastSelectedFilename.Load(this, "", save, songname); DialogResult dr = save.ShowDialog(); if (dr != DialogResult.OK) { return; } if (save.FileNames.Length <= 0 || !U.CanWriteFileRetry(save.FileNames[0])) { return; } Program.LastSelectedFilename.Save(this, "", save); string filename = save.FileNames[0]; int NumBlks = (int)B1.Value; int Priority = (int)B2.Value; int Reverb = (int)B3.Value; uint instrument_addr = (uint)P4.Value; string ext = U.GetFilenameExt(filename); if (ext == ".MID" || ext == ".MIDI") { SongUtil.ExportMidiFile(filename, songname , Tracks, NumBlks, Priority, Reverb, instrument_addr); } else if (ext == ".INSTRUMENT") { //少し時間がかかるので、しばらくお待ちください表示. using (InputFormRef.AutoPleaseWait pleaseWait = new InputFormRef.AutoPleaseWait(this)) { SongUtil.ExportInstrument(filename, instrument_addr); } } else { SongUtil.ExportSFile(filename, songname , Tracks, NumBlks, Priority, Reverb, instrument_addr); } //エクスプローラで選択しよう U.SelectFileByExplorer(filename); }