2 using System.Collections.Generic;
4 using System.Windows.Forms;
6 namespace DTXCreator.オプション関連
8 internal class Cオプション管理
10 public Cオプション管理( Cメインフォーム pメインフォーム )
12 this.formメインフォーム = pメインフォーム;
14 public void tオプションダイアログを開いて編集し結果をアプリ設定に格納する()
16 Cオプションダイアログ cオプションダイアログ = new Cオプションダイアログ();
18 cオプションダイアログ.checkBoxオートフォーカス.CheckState = this.formメインフォーム.appアプリ設定.AutoFocus ? CheckState.Checked : CheckState.Unchecked;
19 cオプションダイアログ.checkBox最近使用したファイル.CheckState = this.formメインフォーム.appアプリ設定.ShowRecentFiles ? CheckState.Checked : CheckState.Unchecked;
20 cオプションダイアログ.numericUpDown最近使用したファイルの最大表示個数.Value = this.formメインフォーム.appアプリ設定.RecentFilesNum;
21 cオプションダイアログ.checkBoxPreviewBGM.CheckState = this.formメインフォーム.appアプリ設定.NoPreviewBGM ? CheckState.Checked : CheckState.Unchecked;
22 cオプションダイアログ.checkBoxPlaySoundOnChip.CheckState = this.formメインフォーム.appアプリ設定.PlaySoundOnWAVChipAllocated ? CheckState.Checked : CheckState.Unchecked;
23 cオプションダイアログ.radioButton_SelectMode.Checked = this.formメインフォーム.appアプリ設定.InitialOperationMode;
24 cオプションダイアログ.radioButton_EditMode.Checked = !this.formメインフォーム.appアプリ設定.InitialOperationMode;
27 if ( !cオプションダイアログ.bレーンリストの内訳が生成済みである )
29 cオプションダイアログ.tレーンリストの内訳を生成する( this.formメインフォーム.mgr譜面管理者.listレーン );
33 cオプションダイアログ.radioButton_UseDTXViewer.Checked = this.formメインフォーム.appアプリ設定.ViewerInfo.bViewerIsDTXV;
34 cオプションダイアログ.radioButton_UseDTXManiaGR.Checked = !this.formメインフォーム.appアプリ設定.ViewerInfo.bViewerIsDTXV;
36 cオプションダイアログ.groupBox_SoundDeviceSettings.Enabled = !this.formメインフォーム.appアプリ設定.ViewerInfo.bViewerIsDTXV;
37 cオプションダイアログ.radioButton_DirectSound.Checked = this.formメインフォーム.appアプリ設定.ViewerInfo.SoundType == FDK.ESoundDeviceType.DirectSound;
38 cオプションダイアログ.radioButton_WASAPI_Exclusive.Checked = this.formメインフォーム.appアプリ設定.ViewerInfo.SoundType == FDK.ESoundDeviceType.ExclusiveWASAPI;
39 cオプションダイアログ.radioButton_WASAPI_Shared.Checked = this.formメインフォーム.appアプリ設定.ViewerInfo.SoundType == FDK.ESoundDeviceType.SharedWASAPI;
40 cオプションダイアログ.radioButton_ASIO.Checked = this.formメインフォーム.appアプリ設定.ViewerInfo.SoundType == FDK.ESoundDeviceType.ASIO;
42 int nASIOdevs = cオプションダイアログ.tASIOデバイスリストの内訳を生成する();
43 if ( nASIOdevs <= this.formメインフォーム.appアプリ設定.ViewerInfo.ASIODeviceNo ) // ASIOの構成が変わった(機器が減った)場合は、ASIOを使わない
45 this.formメインフォーム.appアプリ設定.ViewerInfo.ASIODeviceNo = 0;
46 cオプションダイアログ.radioButton_ASIO.Checked = false;
47 cオプションダイアログ.radioButton_DirectSound.Checked = true;
49 cオプションダイアログ.comboBox_ASIOdevices.SelectedIndex = this.formメインフォーム.appアプリ設定.ViewerInfo.ASIODeviceNo;
50 if ( nASIOdevs == 1 && cオプションダイアログ.comboBox_ASIOdevices.Items[ 0 ].ToString() == "None" )
52 cオプションダイアログ.radioButton_ASIO.Enabled = false;
55 cオプションダイアログ.checkBox_GRmode.Checked = this.formメインフォーム.appアプリ設定.ViewerInfo.GRmode;
56 cオプションダイアログ.checkBox_TimeStretch.Checked = this.formメインフォーム.appアプリ設定.ViewerInfo.TimeStretch;
57 cオプションダイアログ.checkBox_VSyncWait.Checked = this.formメインフォーム.appアプリ設定.ViewerInfo.VSyncWait;
62 if( cオプションダイアログ.ShowDialog() == DialogResult.OK )
64 this.formメインフォーム.appアプリ設定.AutoFocus = cオプションダイアログ.checkBoxオートフォーカス.Checked;
65 this.formメインフォーム.appアプリ設定.ShowRecentFiles = cオプションダイアログ.checkBox最近使用したファイル.Checked;
66 this.formメインフォーム.appアプリ設定.RecentFilesNum = (int) cオプションダイアログ.numericUpDown最近使用したファイルの最大表示個数.Value;
67 this.formメインフォーム.appアプリ設定.NoPreviewBGM = cオプションダイアログ.checkBoxPreviewBGM.Checked;
68 this.formメインフォーム.appアプリ設定.PlaySoundOnWAVChipAllocated = cオプションダイアログ.checkBoxPlaySoundOnChip.Checked;
70 this.formメインフォーム.appアプリ設定.InitialOperationMode = cオプションダイアログ.radioButton_SelectMode.Checked;
72 for ( int i = 0; i < this.formメインフォーム.mgr譜面管理者.listレーン.Count; i++ )
74 DTXCreator.譜面.Cレーン.ELaneType e = this.formメインフォーム.mgr譜面管理者.listレーン[ i ].eLaneType;
75 int index = cオプションダイアログ.checkedListBoxLaneSelectList.FindStringExact( e.ToString() );
76 bool ch = cオプションダイアログ.checkedListBoxLaneSelectList.GetItemChecked( index );
77 this.formメインフォーム.mgr譜面管理者.listレーン[ i ].bIsVisible = ch;
81 this.formメインフォーム.appアプリ設定.ViewerInfo.bViewerIsDTXV = cオプションダイアログ.radioButton_UseDTXViewer.Checked;
83 //AppSetting.ViewerSoundType vst = ( FDK.COS.bIsVistaOrLater ) ? AppSetting.ViewerSoundType.WASAPI : AppSetting.ViewerSoundType.DirectSound;
84 FDK.ESoundDeviceType vst = ( FDK.COS.bIsVistaOrLater() ) ? FDK.ESoundDeviceType.ExclusiveWASAPI : FDK.ESoundDeviceType.DirectSound;
85 if ( cオプションダイアログ.radioButton_DirectSound.Checked )
87 //vst = AppSetting.ViewerSoundType.DirectSound;
88 vst = FDK.ESoundDeviceType.DirectSound;
90 else if ( cオプションダイアログ.radioButton_WASAPI_Exclusive.Checked )
92 //vst = AppSetting.ViewerSoundType.WASAPI;
93 vst = FDK.ESoundDeviceType.ExclusiveWASAPI;
95 else if ( cオプションダイアログ.radioButton_WASAPI_Shared.Checked )
97 //vst = AppSetting.ViewerSoundType.WASAPI;
98 vst = FDK.ESoundDeviceType.SharedWASAPI;
100 else if ( cオプションダイアログ.radioButton_ASIO.Checked )
102 //vst = AppSetting.ViewerSoundType.ASIO;
103 vst = FDK.ESoundDeviceType.ASIO;
105 this.formメインフォーム.appアプリ設定.ViewerInfo.SoundType = vst;
107 this.formメインフォーム.appアプリ設定.ViewerInfo.ASIODeviceNo = cオプションダイアログ.comboBox_ASIOdevices.SelectedIndex;
109 this.formメインフォーム.appアプリ設定.ViewerInfo.GRmode = cオプションダイアログ.checkBox_GRmode.Checked;
110 this.formメインフォーム.appアプリ設定.ViewerInfo.TimeStretch = cオプションダイアログ.checkBox_TimeStretch.Checked;
111 this.formメインフォーム.appアプリ設定.ViewerInfo.VSyncWait = cオプションダイアログ.checkBox_VSyncWait.Checked;
113 this.formメインフォーム.tDTXV演奏関連のボタンとメニューのEnabledの設定();
117 this.formメインフォーム.t最近使ったファイルをFileメニューへ追加する();
123 private Cメインフォーム formメインフォーム;