private void tsmiSaveSongBalance_Click(object sender, EventArgs e) { try { Setting.Balance bln = parent.setting.balance.Copy(); PlayList.music ms = parent.GetPlayingMusicInfo(); if (ms == null) { MessageBox.Show("演奏情報が取得できませんでした。\r\n演奏中又は演奏完了直後に再度お試しください。", "情報取得失敗", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } SaveFileDialog sfd = new SaveFileDialog(); sfd.Filter = "ミキサーバランス(*.mbc)|*.mbc"; sfd.Title = "ミキサーバランスを保存"; sfd.InitialDirectory = System.IO.Path.GetDirectoryName(string.IsNullOrEmpty(ms.arcFileName) ? ms.fileName : ms.arcFileName); if (!parent.setting.autoBalance.SamePositionAsSongData) { sfd.InitialDirectory = System.IO.Path.Combine(Common.settingFilePath, "MixerBalance"); } sfd.RestoreDirectory = false; sfd.FileName = System.IO.Path.GetFileName(string.IsNullOrEmpty(ms.arcFileName) ? ms.fileName : ms.arcFileName) + ".mbc"; sfd.CheckPathExists = true; if (sfd.ShowDialog() != DialogResult.OK) { return; } bln.Save(sfd.FileName); } catch (Exception ex) { log.ForcedWrite(ex); MessageBox.Show(string.Format("{0}", ex.Message), "保存失敗", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void tsbDown_Click(object sender, EventArgs e) { if (dgvList.SelectedRows.Count != 1 || dgvList.SelectedRows[0].Index >= dgvList.Rows.Count - 1) { return; } int ind = dgvList.SelectedRows[0].Index; PlayList.music mus = playList.lstMusic[ind + 1]; DataGridViewRow row = dgvList.Rows[ind + 1]; if (ind == playIndex) { playIndex++; } else if (ind == playIndex - 1) { playIndex--; } if (ind == oldPlayIndex) { oldPlayIndex++; } else if (ind == oldPlayIndex - 1) { oldPlayIndex--; } playList.lstMusic.RemoveAt(ind + 1); dgvList.Rows.RemoveAt(ind + 1); playList.lstMusic.Insert(ind, mus); dgvList.Rows.Insert(ind, row); }