2 using System.Collections.Generic;
\r
11 // var xmlsl = new System.Xml.Serialization.XmlSerializer(typeof(AppSetting));
\r
12 // FileStream fs = new FileStream(設定ファイル名, FileMode.Create);
\r
13 // xmlsl.Serialize(fs, this.アプリ設定);
\r
19 // var xmlsl = new System.Xml.Serialization.XmlSerializer(typeof(AppSetting));
\r
20 // FileStream fs = new FileStream(設定ファイル名, FileMode.Open);
\r
21 // this.アプリ設定 = (AppSetting)xmlsl.Deserialize(fs);
\r
24 // catch (Exception)
\r
26 // Debug.WriteLine("アプリ設定ファイルの読み込みに失敗しました。");
\r
30 public class AppSetting
\r
36 this._SoundListColumnWidth[ 0 ] = 80;
\r
37 this._SoundListColumnWidth[ 1 ] = 28;
\r
38 this._SoundListColumnWidth[ 2 ] = 80;
\r
39 this._SoundListColumnWidth[ 3 ] = 40;
\r
40 this._SoundListColumnWidth[ 4 ] = 60;
\r
41 this._GraphicListColumnWidth[ 0 ] = 34;
\r
42 this._GraphicListColumnWidth[ 1 ] = 127;
\r
43 this._GraphicListColumnWidth[ 2 ] = 28;
\r
44 this._GraphicListColumnWidth[ 3 ] = 120;
\r
45 this._MovieListColumnWidth[ 0 ] = 127;
\r
46 this._MovieListColumnWidth[ 1 ] = 28;
\r
47 this._MovieListColumnWidth[ 2 ] = 120;
\r
48 this._LastWorkFolder = Directory.GetCurrentDirectory();
\r
49 this._ViewerInfo = new Viewer();
\r
50 this._InitialOperationMode = false;
\r
55 // プロパティ(1) オプション項目関連
\r
57 #region [ List<string> RecentUsedFile - 最近使ったファイル名のリスト ]
\r
59 public List<string> RecentUsedFile
\r
61 get { return _RecentUsedFile; }
\r
62 set { _RecentUsedFile = value; }
\r
64 private List<string> _RecentUsedFile = new List<string>();
\r
68 public void AddRecentUsedFile( string fileName )
\r
70 for( int i = 0; i < this._RecentUsedFile.Count; i++ )
\r
72 if( this._RecentUsedFile[ i ].Equals( fileName ) )
\r
74 this._RecentUsedFile.RemoveAt( i );
\r
78 this._RecentUsedFile.Insert( 0, fileName );
\r
79 if( this._RecentUsedFile.Count > 10 )
\r
81 int num2 = this._RecentUsedFile.Count - 10;
\r
82 for( int j = 0; j < num2; j++ )
\r
84 this._RecentUsedFile.RemoveAt( 10 + j );
\r
89 #region [ List<Lanes> LanesInfo - レーンの表示/非表示 ]
\r
91 public List<Lanes> LanesInfo
\r
93 get { return _LanesInfo; }
\r
94 set { _LanesInfo = value; }
\r
96 private List<Lanes> _LanesInfo = new List<Lanes>();
\r
100 public void AddLanesInfo( string Name, bool Checked )
\r
102 this._LanesInfo.Add( new Lanes( Name, Checked ) );
\r
105 public bool bSameVersion()
\r
107 return ( this._ConfigVersion == _ConfigSchemaVersion );
\r
109 public void Confirm()
\r
111 if( this._RecentFilesNum <= 0 )
\r
113 this._RecentFilesNum = 5;
\r
114 this._ShowRecentFiles = false;
\r
116 else if( this._RecentFilesNum > 10 )
\r
118 this._RecentFilesNum = 10;
\r
122 public bool AutoFocus
\r
126 return this._AutoFocus;
\r
130 this._AutoFocus = value;
\r
133 public int ConfigVersion
\r
137 return this._ConfigVersion;
\r
141 this._ConfigVersion = value;
\r
144 public int[] GraphicListColumnWidth
\r
148 return this._GraphicListColumnWidth;
\r
152 this._GraphicListColumnWidth = value;
\r
155 public int GuideIndex
\r
159 return this._GuideIndex;
\r
163 this._GuideIndex = value;
\r
164 if( this._GuideIndex < 0 )
\r
166 this._GuideIndex = 0;
\r
168 else if( this._GuideIndex > 8 )
\r
170 this._GuideIndex = 8;
\r
178 return this._Height;
\r
182 this._Height = value;
\r
183 if( this._Height < 0 )
\r
189 public int HViewScaleIndex
\r
193 return this._HViewScaleIndex;
\r
197 this._HViewScaleIndex = value;
\r
198 if( this._HViewScaleIndex < 0 )
\r
200 this._HViewScaleIndex = 0;
\r
202 else if( this._HViewScaleIndex > 9 )
\r
204 this._HViewScaleIndex = 9;
\r
208 public string LastWorkFolder
\r
212 return this._LastWorkFolder;
\r
216 this._LastWorkFolder = value;
\r
219 public bool Maximized
\r
223 return this._Maximized;
\r
227 this._Maximized = value;
\r
230 public int[] MovieListColumnWidth
\r
234 return this._MovieListColumnWidth;
\r
238 this._MovieListColumnWidth = value;
\r
241 public bool NoPreviewBGM
\r
245 return this._NoPreviewBGM;
\r
249 this._NoPreviewBGM = value;
\r
252 public bool PlaySoundOnWAVChipAllocated
\r
256 return this._PlaySoundOnWAVChipAllocated;
\r
260 this._PlaySoundOnWAVChipAllocated = value;
\r
263 public int RecentFilesNum
\r
267 return this._RecentFilesNum;
\r
271 this._RecentFilesNum = value;
\r
274 public bool ShowRecentFiles
\r
278 return this._ShowRecentFiles;
\r
282 this._ShowRecentFiles = value;
\r
285 public int[] SoundListColumnWidth
\r
289 return this._SoundListColumnWidth;
\r
293 this._SoundListColumnWidth = value;
\r
296 public int SplitterDistance
\r
300 return this._SplitterDistance;
\r
304 this._SplitterDistance = value;
\r
307 public Viewer ViewerInfo
\r
311 return this._ViewerInfo;
\r
315 this._ViewerInfo = value;
\r
322 return this._Width;
\r
326 this._Width = value;
\r
327 if( this._Width < 0 )
\r
361 public bool InitialOperationMode
\r
365 return this._InitialOperationMode;
\r
369 this._InitialOperationMode = value;
\r
373 //public enum ViewerSoundType
\r
380 public class Viewer
\r
382 private const string PathDTXV = "DTXV.exe";
\r
383 private const string PathDTXM = "DTXManiaGR.exe";
\r
385 public string Path = PathDTXM;
\r
386 public string PlayStartFromOption = "-N";
\r
387 public string PlayStartOption = "-N-1";
\r
388 public string PlayStopOption = "-S";
\r
389 // public ViewerSoundType SoundType = ( FDK.COS.bIsVistaOrLater ) ? ViewerSoundType.WASAPI : ViewerSoundType.DirectSound;
\r
390 public FDK.ESoundDeviceType SoundType = ( FDK.COS.bIsVistaOrLater ) ? FDK.ESoundDeviceType.ExclusiveWASAPI : FDK.ESoundDeviceType.DirectSound;
\r
391 public int ASIODeviceNo = 0;
\r
392 public bool GRmode;
\r
393 public bool TimeStretch;
\r
394 public bool VSyncWait = true;
\r
396 // 引数無しのコンストラクタがないとSerializeできないのでダミー定義する
\r
400 PlayStartFromOption = "-N";
\r
401 PlayStartOption = "-N-1";
\r
402 PlayStopOption = "-S";
\r
403 //SoundType = (FDK.COS.bIsVistaOrLater)? ViewerSoundType.WASAPI : ViewerSoundType.DirectSound;
\r
404 SoundType = ( FDK.COS.bIsVistaOrLater ) ? FDK.ESoundDeviceType.ExclusiveWASAPI : FDK.ESoundDeviceType.DirectSound;
\r
407 TimeStretch = false;
\r
410 public bool bViewerIsDTXV
\r
414 return ( this.Path == PathDTXV );
\r
418 this.Path = value ? PathDTXV : PathDTXM;
\r
422 public string PlaySoundOption
\r
427 if ( bViewerIsDTXV )
\r
433 string soundtypeopt = "";
\r
434 switch ( SoundType )
\r
436 //case ViewerSoundType.DirectSound:
\r
437 case FDK.ESoundDeviceType.DirectSound:
\r
438 soundtypeopt = "D";
\r
440 //case ViewerSoundType.WASAPI:
\r
441 case FDK.ESoundDeviceType.ExclusiveWASAPI:
\r
442 soundtypeopt = "W";
\r
444 //case ViewerSoundType.ASIO:
\r
445 case FDK.ESoundDeviceType.ASIO:
\r
446 soundtypeopt = "A";
\r
447 soundtypeopt += ASIODeviceNo.ToString();
\r
451 opt = "-D" + soundtypeopt;
\r
452 opt += GRmode ? "Y" : "N"; // この辺は手抜き
\r
453 opt += TimeStretch? "Y" : "N"; //
\r
454 opt += VSyncWait ? "Y" : "N"; //
\r
462 /// レーン名と表示/非表示の状態の保持/復元
\r
466 public string Name;
\r
467 public bool Checked;
\r
469 // 引数無しのコンストラクタがないとSerializeできないのでダミー定義する
\r
475 public Lanes( string Name_, bool Checked_ )
\r
478 Checked = Checked_;
\r
482 #region [ private ]
\r
483 //-----------------
\r
484 private bool _AutoFocus = true;
\r
485 private static int _ConfigSchemaVersion = 0x69;
\r
486 private int _ConfigVersion = _ConfigSchemaVersion;
\r
487 private int[] _GraphicListColumnWidth = new int[ 4 ];
\r
488 private int _GuideIndex = 3;
\r
489 private int _Height = 0x1db;
\r
490 private int _HViewScaleIndex;
\r
491 private string _LastWorkFolder = "";
\r
492 private bool _Maximized;
\r
493 private int[] _MovieListColumnWidth = new int[ 3 ];
\r
494 private bool _NoPreviewBGM = true;
\r
495 private bool _PlaySoundOnWAVChipAllocated = true;
\r
496 private int _RecentFilesNum = 5;
\r
497 private bool _ShowRecentFiles = true;
\r
498 private int[] _SoundListColumnWidth = new int[ 5 ];
\r
499 private int _SplitterDistance = 0x128;
\r
500 private Viewer _ViewerInfo;
\r
501 private int _Width = 600;
\r
504 private bool _InitialOperationMode;
\r
505 //-----------------
\r