2 using System.Collections;
3 using System.Collections.Generic;
4 using System.Globalization;
7 using System.Windows.Forms;
9 using DTXCreator.Properties;
11 using DTXCreator.UndoRedo;
12 using DTXCreator.WAV_BMP_AVI;
14 using System.Diagnostics;
18 internal class CDTX入出力
20 internal CDTX入出力( Cメインフォーム mf )
24 public void tDTX出力( StreamWriter sw )
26 this.tDTX出力( sw, false );
28 public void tDTX出力( StreamWriter sw, bool bBGMのみ出力 )
30 sw.WriteLine( "; Created by DTXCreator " + Resources.DTXC_VERSION );
31 this.tDTX出力_タイトルと製作者とコメントその他( sw );
32 this.tDTX出力_自由入力欄( sw );
33 this.tDTX出力_WAVリスト( sw, bBGMのみ出力 );
34 this.tDTX出力_BMPリスト( sw );
35 this.tDTX出力_AVIリスト( sw );
36 this.tDTX出力_小節長倍率( sw );
37 this.tDTX出力_BPxリスト( sw );
38 this.tDTX出力_BEATチップのf値( sw );
39 this.tDTX出力_全チップ( sw );
41 this.tDTX出力_レーン割付チップ( sw );
42 this.tDTX出力_WAVリスト色設定( sw );
43 this.tDTX出力_BMPリスト色設定( sw );
44 this.tDTX出力_AVIリスト色設定( sw );
45 this.tDTX出力_チップパレット( sw );
47 public void tDTX入力( E種別 e種別, ref string str全入力文字列 )
50 if( str全入力文字列.Length != 0 )
52 this.dic小節長倍率 = new Dictionary<int, float>();
53 this.dicBEATチップf値 = new Dictionary<int, float>();
54 this.listチップパレット = new List<int>();
55 this.listBGMWAV番号 = new List<int>(); // #26775 2011.11.21 yyagi
56 this.nLastBarConverted = -1;
57 this.eDTXbgmChs = DTXbgmChs.GetEnumerator();
58 this._Form.listViewWAVリスト.BeginUpdate();
59 this._Form.listViewBMPリスト.BeginUpdate();
60 this._Form.listViewAVIリスト.BeginUpdate();
61 str全入力文字列 = str全入力文字列.Replace( Environment.NewLine, "\n" );
62 str全入力文字列 = str全入力文字列.Replace( '\t', ' ' );
63 StringBuilder builder = new StringBuilder();
64 CharEnumerator ce = str全入力文字列.GetEnumerator();
69 if( !this.tDTX入力_空白と改行をスキップする( ref ce ) )
73 if( ce.Current == '#' )
77 StringBuilder sbコマンド文字列 = new StringBuilder( 0x20 );
78 if( this.tDTX入力_コマンド文字列を抜き出す( ref ce, ref sbコマンド文字列 ) )
80 StringBuilder sbパラメータ文字列 = new StringBuilder( 0x400 );
81 if( this.tDTX入力_パラメータ文字列を抜き出す( ref ce, ref sbパラメータ文字列 ) )
83 StringBuilder sbコメント文字列 = new StringBuilder( 0x400 );
84 if( this.tDTX入力_コメント文字列を抜き出す( ref ce, ref sbコメント文字列 ) )
86 if( !this.tDTX入力_行解析( ref sbコマンド文字列, ref sbパラメータ文字列, ref sbコメント文字列 ) )
88 builder.Append( string.Concat( "#", sbコマンド文字列, ": ", sbパラメータ文字列 ) );
89 if( sbコメント文字列.Length > 0 )
91 builder.Append( "\t;" + sbコメント文字列 );
93 builder.Append( Environment.NewLine );
103 while( this.tDTX入力_コメントをスキップする( ref ce ) );
104 CUndoRedo管理.bUndoRedoした直後 = true;
105 this._Form.textBox自由入力欄.Text = this._Form.textBox自由入力欄.Text + builder.ToString();
106 this.tDTX入力_小節内のチップリストを発声位置でソートする();
107 this.tDTX入力_小節長倍率配列を昇順ソート済みの小節リストに適用する();
108 this.tDTX入力_BPMチップにBPx数値をバインドする();
109 this.tDTX入力_キャッシュからListViewを一括構築する();
110 this.tDTX入力_チップパレットのListViewを一括構築する();
111 //this.tDTX入力_BEATチップにf値をバインドする();
112 if ( this.listBGMWAV番号.Count > 0 ) // #26775 2011.11.21 yyagi
114 foreach ( int nBGMWAV番号 in listBGMWAV番号 ) // #26775 2011.11.21 yyagi
116 this._Form.mgrWAVリスト管理者.tWAVをキャッシュから検索して返す_なければ新規生成する( nBGMWAV番号 ).bBGMとして使用 = true;
119 this._Form.listViewWAVリスト.EndUpdate();
120 this._Form.listViewBMPリスト.EndUpdate();
121 this._Form.listViewAVIリスト.EndUpdate();
137 private Cメインフォーム _Form;
138 private int[] arr素数リスト = new int[] {
139 2, 3, 5, 7, 11, 13, 0x11, 0x13, 0x17, 0x1d, 0x1f, 0x25, 0x29, 0x2b, 0x2f, 0x35,
140 0x3b, 0x3d, 0x43, 0x47, 0x49, 0x4f, 0x53, 0x59, 0x61, 0x65, 0x67, 0x6b, 0x6d, 0x71, 0x7f, 0x83,
141 0x89, 0x8b, 0x95, 0x97, 0x9d, 0xa3, 0xa7, 0xad, 0xb3, 0xb5, 0xbf, 0xc1, 0xc5, 0xc7, 0xd3, 0xdf,
142 0xe3, 0xe5, 0xe9, 0xef, 0xf1, 0xfb, 0x101, 0x107, 0x10d, 0x10f, 0x115, 0x119, 0x11b, 0x125, 0x133, 0x137,
143 0x139, 0x13d, 0x14b, 0x151, 0x15b, 0x15d, 0x161, 0x167, 0x16f, 0x175, 0x17b, 0x17f
145 #region [ #25990; for BMS/BME to DTX conversion ]
146 // #25990 2011.8.12 yyagi: DTXのBGM用ch群(正確には効果音用ch群)
147 private readonly int[] DTXbgmChs = new int[] {
148 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69,
149 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79,
150 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89,
153 // #25990 2011.8.12 yyagi: BMS/BME→DTX チャネル変換テーブル(BGMとキーを除いて、右から左にそのまま変換)
154 private readonly int[] BMSgeneralChToDTXgeneralCh = {
155 0x00, -1, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F,
156 0x10, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
157 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2A, 0x2B, 0x2C, 0x2D, 0x2E, 0x2F,
158 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3A, 0x3B, 0x3C, 0x3D, 0x3E, 0x3F,
159 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4A, 0x4B, 0x4C, 0x4D, 0x4E, 0x4F,
160 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5A, 0x5B, 0x5C, 0x5D, 0x5E, 0x5F,
161 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6A, 0x6B, 0x6C, 0x6D, 0x6E, 0x6F,
162 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7A, 0x7B, 0x7C, 0x7D, 0x7E, 0x7F,
163 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8A, 0x8B, 0x8C, 0x8D, 0x8E, 0x8F,
164 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, 0x99, 0x9A, 0x9B, 0x9C, 0x9D, 0x9E, 0x9F,
165 0xA0, 0xA1, 0xA2, 0xA3, 0xA4, 0xA5, 0xA6, 0xA7, 0xA8, 0xA9, 0xAA, 0xAB, 0xAC, 0xAD, 0xAE, 0xAF,
166 0xB0, 0xB1, 0xB2, 0xB3, 0xB4, 0xB5, 0xB6, 0xB7, 0xB8, 0xB9, 0xBA, 0xBB, 0xBC, 0xBD, 0xBE, 0xBF,
167 0xC0, 0xC1, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7, 0xC8, 0xC9, 0xCA, 0xCB, 0xCC, 0xCD, 0xCE, 0xCF,
168 0xD0, 0xD1, 0xD2, 0xD3, 0xD4, 0xD5, 0xD6, 0xD7, 0xD8, 0xD9, 0xDA, 0xDB, 0xDC, 0xDD, 0xDE, 0xDF,
169 0xE0, 0xE1, 0xE2, 0xE3, 0xE4, 0xE5, 0xE6, 0xE7, 0xE8, 0xE9, 0xEA, 0xEB, 0xEC, 0xED, 0xEE, 0xEF,
170 0xF0, 0xF1, 0xF2, 0xF3, 0xF4, 0xF5, 0xF6, 0xF7, 0xF8, 0xF9, 0xFA, 0xFB, 0xFC, 0xFD, 0xFE, 0xFF
172 // #25990 2011.8.12 yyagi: BMS→DTXの、キー関係の変換表 (5鍵ならHH~LTとCYを使用)
173 private readonly int[] BMSkeyChToDTXdrumsCh = {
174 // 1key 2key, 3key, 4key, 5key, scr, free
175 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x53
176 // HC, SD, BD, HT, LT, CY, FI
178 // #25990 2011.8.12 yyagi: BME→DTXの、キー関係の変換表 (7鍵ならLC~FTとCYを使用)
179 private readonly int[] BMEkeyChToDTXdrumsCh = {
180 // 1key 2key, 3key, 4key, 5key, scr, free, 6key, 7key
181 0x1A, 0x11, 0x12, 0x13, 0x14, 0x16, 0x53, 0x15, 0x17
182 // LC, HC, SD, BD, HT, CY, FI, LT, FT
184 private int nLastBarConverted = -1; // #25990 2011.8.12 yyagi BMS/BME→DTX変換用
185 private IEnumerator eDTXbgmChs; // #25990 2011.8.12 yyagi BMS/BME→DTX変換用
187 private Dictionary<int, float> dic小節長倍率;
188 private Dictionary<int, float> dicBEATチップf値;
190 private List<int> listチップパレット;
191 private List<int> listBGMWAV番号 = null; // #26775 2011.11.21 yyagi
193 private void tDTX入力_BPMチップにBPx数値をバインドする()
195 foreach( KeyValuePair<int, C小節> pair in this._Form.mgr譜面管理者.dic小節 )
197 C小節 c小節 = pair.Value;
198 for( int i = 0; i < c小節.listチップ.Count; i++ )
200 Cチップ cチップ = c小節.listチップ[ i ];
202 if( ( cチップ.nチャンネル番号00toFF == 8 ) && this._Form.mgr譜面管理者.dicBPx.TryGetValue( cチップ.n値_整数1to1295, out num2 ) )
206 if( cチップ.nチャンネル番号00toFF == 3 )
208 cチップ.nチャンネル番号00toFF = 8;
209 cチップ.f値_浮動小数 = cチップ.n値_整数1to1295;
211 for( int j = 1; j <= 36 * 36 - 1; j++ )
213 if( !this._Form.mgr譜面管理者.dicBPx.ContainsKey( j ) )
215 this._Form.mgr譜面管理者.dicBPx.Add( j, cチップ.f値_浮動小数);
216 cチップ.n値_整数1to1295 = j;
224 //private void tDTX入力_BEATチップにf値をバインドする()
226 // foreach ( KeyValuePair<int, C小節> pair in this._Form.mgr譜面管理者.dic小節 )
228 // C小節 c小節 = pair.Value;
229 // for ( int i = 0; i < c小節.listチップ.Count; i++ )
231 // Cチップ cチップ = c小節.listチップ[ i ];
233 // if ( ( cチップ.nチャンネル番号00toFF == 0xF8 || cチップ.nチャンネル番号00toFF == 0xF3 )
234 // && this._Form.mgr譜面管理者.dicBPx.TryGetValue( cチップ.n値・整数1to1295, out num2 ) )
236 // cチップ.f値・浮動小数 = num2;
238 // if ( cチップ.nチャンネル番号00toFF == 3 )
240 // cチップ.nチャンネル番号00toFF = 8;
241 // cチップ.f値・浮動小数 = cチップ.n値・整数1to1295;
243 // for ( int j = 1; j <= 36 * 36 - 1; j++ )
245 // if ( !this._Form.mgr譜面管理者.dicBPx.ContainsKey( j ) )
247 // this._Form.mgr譜面管理者.dicBPx.Add( j, cチップ.f値・浮動小数 );
248 // cチップ.n値・整数1to1295 = j;
257 private void tDTX入力_キャッシュからListViewを一括構築する()
259 for( int i = 1; i <= 36 * 36 - 1; i++ )
261 CWAV cwav = this._Form.mgrWAVリスト管理者.tWAVをキャッシュから検索して返す( i );
264 cwav.tコピーto( this._Form.listViewWAVリスト.Items[ i - 1 ] );
266 CBMP cbmp = this._Form.mgrBMPリスト管理者.tBMPをキャッシュから検索して返す( i );
269 cbmp.tコピーto( this._Form.listViewBMPリスト.Items[ i - 1 ] );
271 CAVI cavi = this._Form.mgrAVIリスト管理者.tAVIをキャッシュから検索して返す( i );
274 cavi.tコピーto( this._Form.listViewAVIリスト.Items[ i - 1 ] );
278 private bool tDTX入力_コマンド文字列を抜き出す( ref CharEnumerator ce, ref StringBuilder sb文字列 )
280 if( this.tDTX入力_空白をスキップする( ref ce ) )
282 while( ( ( ce.Current != ':' ) && ( ce.Current != ' ' ) ) && ( ( ce.Current != ';' ) && ( ce.Current != '\n' ) ) )
284 sb文字列.Append( ce.Current );
290 if( ce.Current == ':' )
296 if( !this.tDTX入力_空白をスキップする( ref ce ) )
305 private bool tDTX入力_コメントをスキップする( ref CharEnumerator ce )
307 while( ce.Current != '\n' )
314 return ce.MoveNext();
316 private bool tDTX入力_コメント文字列を抜き出す( ref CharEnumerator ce, ref StringBuilder sb文字列 )
318 if( ce.Current != ';' )
324 while( ce.Current != '\n' )
326 sb文字列.Append( ce.Current );
336 private void tDTX入力_チップパレットのListViewを一括構築する()
338 for( int i = 0; i < ( this.listチップパレット.Count / 2 ); i += 2 )
340 int num2 = this.listチップパレット[ i * 2 ];
341 int num3 = this.listチップパレット[ ( i * 2 ) + 1 ];
342 string[] items = new string[ 3 ];
347 CWAV cwav = this._Form.mgrWAVリスト管理者.tWAVをキャッシュから検索して返す( num3 );
350 items[ 0 ] = cwav.strラベル名;
351 items[ 1 ] = C変換.str数値を36進数2桁に変換して返す( num3 );
352 items[ 2 ] = cwav.strファイル名;
353 ListViewItem item = new ListViewItem( items );
354 item.ImageIndex = num2;
355 item.ForeColor = cwav.col文字色;
356 item.BackColor = cwav.col背景色;
357 this._Form.dlgチップパレット.listViewチップリスト.Items.Add( item );
363 CBMP cbmp = this._Form.mgrBMPリスト管理者.tBMPをキャッシュから検索して返す( num3 );
366 items[ 0 ] = cbmp.strラベル名;
367 items[ 1 ] = C変換.str数値を36進数2桁に変換して返す( num3 );
368 items[ 2 ] = cbmp.strファイル名;
369 ListViewItem item2 = new ListViewItem( items );
370 item2.ImageIndex = num2;
371 item2.ForeColor = cbmp.col文字色;
372 item2.BackColor = cbmp.col背景色;
373 this._Form.dlgチップパレット.listViewチップリスト.Items.Add( item2 );
379 CAVI cavi = this._Form.mgrAVIリスト管理者.tAVIをキャッシュから検索して返す( num3 );
382 items[ 0 ] = cavi.strラベル名;
383 items[ 1 ] = C変換.str数値を36進数2桁に変換して返す( num3 );
384 items[ 2 ] = cavi.strファイル名;
385 ListViewItem item3 = new ListViewItem( items );
386 item3.ImageIndex = num2;
387 item3.ForeColor = cavi.col文字色;
388 item3.BackColor = cavi.col背景色;
389 this._Form.dlgチップパレット.listViewチップリスト.Items.Add( item3 );
396 private bool tDTX入力_パラメータ文字列を抜き出す( ref CharEnumerator ce, ref StringBuilder sb文字列 )
398 if( this.tDTX入力_空白をスキップする( ref ce ) )
400 while( ( ce.Current != '\n' ) && ( ce.Current != ';' ) )
402 sb文字列.Append( ce.Current );
412 private bool tDTX入力_空白と改行をスキップする( ref CharEnumerator ce )
414 while( ( ce.Current == ' ' ) || ( ce.Current == '\n' ) )
423 private bool tDTX入力_空白をスキップする( ref CharEnumerator ce )
425 while( ce.Current == ' ' )
434 private bool tDTX入力_行解析( ref StringBuilder sbコマンド, ref StringBuilder sbパラメータ, ref StringBuilder sbコメント )
436 string strコマンド = sbコマンド.ToString();
437 string strパラメータ = sbパラメータ.ToString().Trim();
438 string strコメント = sbコメント.ToString();
440 this.tDTX入力_行解析_TITLE_ARTIST_COMMENT_その他( strコマンド, strパラメータ, strコメント ) ||
441 this.tDTX入力_行解析_WAVVOL_VOLUME( strコマンド, strパラメータ, strコメント ) ||
442 this.tDTX入力_行解析_WAVPAN_PAN( strコマンド, strパラメータ, strコメント ) ||
443 this.tDTX入力_行解析_WAV( strコマンド, strパラメータ, strコメント ) ||
444 this.tDTX入力_行解析_BGMWAV( strコマンド, strパラメータ, strコメント ) ||
445 this.tDTX入力_行解析_BMPTEX( strコマンド, strパラメータ, strコメント ) ||
446 this.tDTX入力_行解析_BMP( strコマンド, strパラメータ, strコメント ) ||
447 this.tDTX入力_行解析_AVI_AVIPAN( strコマンド, strパラメータ, strコメント ) ||
448 this.tDTX入力_行解析_BPx( strコマンド, strパラメータ, strコメント ) ||
449 this.tDTX入力_行解析_DTXC_LANEBINDEDCHIP( strコマンド, strパラメータ, strコメント ) ||
450 this.tDTX入力_行解析_DTXC_WAVFORECOLOR( strコマンド, strパラメータ, strコメント ) ||
451 this.tDTX入力_行解析_DTXC_WAVBACKCOLOR( strコマンド, strパラメータ, strコメント ) ||
452 this.tDTX入力_行解析_DTXC_BMPFORECOLOR( strコマンド, strパラメータ, strコメント ) ||
453 this.tDTX入力_行解析_DTXC_BMPBACKCOLOR( strコマンド, strパラメータ, strコメント ) ||
454 this.tDTX入力_行解析_DTXC_AVIFORECOLOR( strコマンド, strパラメータ, strコメント ) ||
455 this.tDTX入力_行解析_DTXC_AVIBACKCOLOR( strコマンド, strパラメータ, strコメント ) ||
456 this.tDTX入力_行解析_DTXC_CHIPPALETTE( strコマンド, strパラメータ, strコメント ) ||
457 this.tDTX入力_行解析_BEATチップのf値( strコマンド, strパラメータ, strコメント ) ||
458 this.tDTX入力_行解析_チャンネル( strコマンド, strパラメータ, strコメント )
461 private bool tDTX入力_行解析_BEATチップのf値( string strコマンド, string strパラメータ, string strコメント )
463 if ( strコマンド.StartsWith( "BEAT", StringComparison.OrdinalIgnoreCase ) )
465 strコマンド = strコマンド.Substring( 4 );
471 int num = C変換.n値を文字列から取得して返す( strコマンド, 0 );
478 string[] strParams = strパラメータ.Split( new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries );
480 #region [ パラメータ引数は全3個ないと無効。]
482 if ( strParams.Length < 3 )
484 //Trace.TraceError( "BEAT: 引数が足りません。[{0}: {1}行]", this.strファイル名の絶対パス, this.n現在の行数 );
494 if ( string.IsNullOrEmpty( strParams[ i ] ) )
496 //Trace.TraceError( "BGAPAN: {2}番目の数(BMP番号)が異常です。[{0}: {1}行]", this.strファイル名の絶対パス, this.n現在の行数, i + 1 );
499 int n小節番号 = C変換.n値を文字列から取得して返す( strParams[ i ], 0 );
502 //Trace.TraceError( "BGAPAN: {2}番目の数(BMP番号)が異常です。[{0}: {1}行]", this.strファイル名の絶対パス, this.n現在の行数, i + 1 );
509 if ( string.IsNullOrEmpty( strParams[ i ] ) )
511 //Trace.TraceError( "BGAPAN: {2}番目の数(BMP番号)が異常です。[{0}: {1}行]", this.strファイル名の絶対パス, this.n現在の行数, i + 1 );
514 int nGrid = C変換.n値を文字列から取得して返す( strParams[ i ], 0 );
517 //Trace.TraceError( "BGAPAN: {2}番目の数(BMP番号)が異常です。[{0}: {1}行]", this.strファイル名の絶対パス, this.n現在の行数, i + 1 );
524 if ( string.IsNullOrEmpty( strParams[ i ] ) )
526 //Trace.TraceError( "BGAPAN: {2}番目の数(BMP番号)が異常です。[{0}: {1}行]", this.strファイル名の絶対パス, this.n現在の行数, i + 1 );
530 if ( ( !this.TryParse( strParams[ i ], out f値 ) || ( f値 < 0 ) ) )
535 //Debug.WriteLine( "入力: n小節番号=" + n小節番号 + ", nGrid=" + nGrid + ", f値=" + f値 + ", strParam=" + strParams[i] );
536 this.dicBEATチップf値.Add( n小節番号 * CWholeNoteDivision.n分解能 + nGrid, (float) f値 );
540 private bool tDTX入力_行解析_AVI_AVIPAN( string strコマンド, string strパラメータ, string strコメント )
542 if( !strコマンド.StartsWith( "AVIPAN", StringComparison.OrdinalIgnoreCase ) && strコマンド.StartsWith( "AVI", StringComparison.OrdinalIgnoreCase ) )
544 strコマンド = strコマンド.Substring( 3 );
550 int num = C変換.n36進数2桁の文字列を数値に変換して返す( strコマンド.Substring( 0, 2 ) );
551 if( ( num < 1 ) || ( num > 36 * 36 - 1 ) )
555 CAVI cavi = this._Form.mgrAVIリスト管理者.tAVIをキャッシュから検索して返す_なければ新規生成する( num );
556 cavi.strラベル名 = strコメント;
557 cavi.strファイル名 = strパラメータ;
560 private bool tDTX入力_行解析_BGMWAV( string strコマンド, string strパラメータ, string strコメント )
562 if( strコマンド.StartsWith( "bgmwav", StringComparison.OrdinalIgnoreCase ) )
564 strコマンド = strコマンド.Substring( 6 );
570 int num = C変換.n36進数2桁の文字列を数値に変換して返す( strパラメータ.Substring( 0, 2 ) );
571 if( ( num < 1 ) || ( num > 36 * 36 - 1 ) )
575 this.listBGMWAV番号.Add( num );
578 private bool tDTX入力_行解析_BMP( string strコマンド, string strパラメータ, string strコメント )
580 if( ( strコマンド.Length > 3 ) && strコマンド.StartsWith( "BMP", StringComparison.OrdinalIgnoreCase ) )
582 strコマンド = strコマンド.Substring( 3 );
588 int num = C変換.n36進数2桁の文字列を数値に変換して返す( strコマンド.Substring( 0, 2 ) );
589 if( ( num < 1 ) || ( num > 36 * 36 - 1 ) )
593 CBMP cbmp = this._Form.mgrBMPリスト管理者.tBMPをキャッシュから検索して返す_なければ新規生成する( num );
594 cbmp.strラベル名 = strコメント;
595 cbmp.strファイル名 = strパラメータ;
599 private bool tDTX入力_行解析_BMPTEX( string strコマンド, string strパラメータ, string strコメント )
601 if( strコマンド.StartsWith( "BMPTEX", StringComparison.OrdinalIgnoreCase ) )
603 strコマンド = strコマンド.Substring( 6 );
609 int num = C変換.n36進数2桁の文字列を数値に変換して返す( strコマンド.Substring( 0, 2 ) );
610 if( ( num < 1 ) || ( num > 36 * 36 - 1 ) )
614 CBMP cbmp = this._Form.mgrBMPリスト管理者.tBMPをキャッシュから検索して返す_なければ新規生成する( num );
615 cbmp.strラベル名 = strコメント;
616 cbmp.strファイル名 = strパラメータ;
620 private bool tDTX入力_行解析_BPx( string strコマンド, string strパラメータ, string strコメント )
622 if( strコマンド.StartsWith( "BPM", StringComparison.OrdinalIgnoreCase ) )
624 strコマンド = strコマンド.Substring( 3 );
630 int key = C変換.n36進数2桁の文字列を数値に変換して返す( strコマンド.Substring( 0, 2 ) );
631 if( ( key < 1 ) || ( key > 36 * 36 - 1 ) )
636 if( ( !this.TryParse( strパラメータ, out result ) || ( result < 0 ) ) || ( result > 1000 ) ) // #23880 2011.1.6 yyagi
640 this._Form.mgr譜面管理者.dicBPx.Add(key, (float)result);
643 private bool tDTX入力_行解析_DTXC_AVIBACKCOLOR( string strコマンド, string strパラメータ, string strコメント )
646 if( !strコマンド.Equals( "DTXC_AVIBACKCOLOR", StringComparison.OrdinalIgnoreCase ) )
650 string[] strArray = strパラメータ.Split( new char[] { ' ', '\t' } );
651 if( strArray.Length < 2 )
655 if( !int.TryParse( strArray[ 0 ], out nChipNo ) )
659 if( ( nChipNo < 0 ) || ( nChipNo > 36 * 36 - 2 ) )
663 Color color = ColorTranslator.FromHtml( strArray[ 1 ] );
664 if( ( nChipNo >= 0 ) && ( nChipNo <= 36 * 36 - 2 ) )
666 this._Form.mgrAVIリスト管理者.tAVIをキャッシュから検索して返す_なければ新規生成する( nChipNo + 1 ).col背景色 = color;
670 private bool tDTX入力_行解析_DTXC_AVIFORECOLOR( string strコマンド, string strパラメータ, string strコメント )
673 if( !strコマンド.Equals( "DTXC_AVIFORECOLOR", StringComparison.OrdinalIgnoreCase ) )
677 string[] strArray = strパラメータ.Split( new char[] { ' ', '\t' } );
678 if( strArray.Length < 2 )
682 if( !int.TryParse( strArray[ 0 ], out nChipNo ) )
686 if( ( nChipNo < 0 ) || ( nChipNo > 36 * 36 - 2 ) )
690 Color color = ColorTranslator.FromHtml( strArray[ 1 ] );
691 if( ( nChipNo >= 0 ) && ( nChipNo <= 36 * 36 - 2 ) )
693 this._Form.mgrAVIリスト管理者.tAVIをキャッシュから検索して返す_なければ新規生成する( nChipNo + 1 ).col文字色 = color;
697 private bool tDTX入力_行解析_DTXC_BMPBACKCOLOR( string strコマンド, string strパラメータ, string strコメント )
700 if( !strコマンド.Equals( "DTXC_BMPBACKCOLOR", StringComparison.OrdinalIgnoreCase ) )
704 string[] strArray = strパラメータ.Split( new char[] { ' ', '\t' } );
705 if( strArray.Length < 2 )
709 if( !int.TryParse( strArray[ 0 ], out nChipNo ) )
713 if( ( nChipNo < 0 ) || ( nChipNo > 36 * 36 - 2 ) )
717 Color color = ColorTranslator.FromHtml( strArray[ 1 ] );
718 if( ( nChipNo >= 0 ) && ( nChipNo <= 36 * 36 - 2 ) )
720 this._Form.mgrBMPリスト管理者.tBMPをキャッシュから検索して返す_なければ新規生成する( nChipNo + 1 ).col背景色 = color;
724 private bool tDTX入力_行解析_DTXC_BMPFORECOLOR( string strコマンド, string strパラメータ, string strコメント )
727 if( !strコマンド.Equals( "DTXC_BMPFORECOLOR", StringComparison.OrdinalIgnoreCase ) )
731 string[] strArray = strパラメータ.Split( new char[] { ' ', '\t' } );
732 if( strArray.Length < 2 )
736 if( !int.TryParse( strArray[ 0 ], out nChipNo ) )
740 if( ( nChipNo < 0 ) || ( nChipNo > 36 * 36 - 2 ) )
744 Color color = ColorTranslator.FromHtml( strArray[ 1 ] );
745 if( ( nChipNo >= 0 ) && ( nChipNo <= 36 * 36 - 2 ) )
747 this._Form.mgrBMPリスト管理者.tBMPをキャッシュから検索して返す_なければ新規生成する( nChipNo + 1 ).col文字色 = color;
751 private bool tDTX入力_行解析_DTXC_CHIPPALETTE( string strコマンド, string strパラメータ, string strコメント )
753 if( !strコマンド.Equals( "DTXC_CHIPPALETTE", StringComparison.OrdinalIgnoreCase ) )
757 foreach( string str in strパラメータ.Split( new char[] { ' ' } ) )
760 string[] strArray2 = str.Split( new char[] { ',' } );
761 if( ( ( strArray2.Length == 2 ) && int.TryParse( strArray2[ 0 ], out num ) ) && ( ( num >= 0 ) && ( num <= 2 ) ) )
763 int item = C変換.n36進数2桁の文字列を数値に変換して返す( strArray2[ 1 ] );
764 if( ( item >= 1 ) && ( item <= 36 * 36 - 1 ) )
766 this.listチップパレット.Add( num );
767 this.listチップパレット.Add( item );
773 private bool tDTX入力_行解析_DTXC_LANEBINDEDCHIP( string strコマンド, string strパラメータ, string strコメント )
775 if( strコマンド.Equals( "DTXC_LANEBINDEDCHIP", StringComparison.OrdinalIgnoreCase ) && ( strパラメータ.Length == 8 ) )
778 if( !int.TryParse( strパラメータ.Substring( 0, 2 ), out nLaneNo ) )
782 int nChipNoFore = C変換.n36進数2桁の文字列を数値に変換して返す( strパラメータ.Substring( 3, 2 ) );
783 if( ( nChipNoFore < 0 ) || ( nChipNoFore > 36 * 36 - 1 ) )
787 int nChipNoBack = C変換.n36進数2桁の文字列を数値に変換して返す( strパラメータ.Substring( 6, 2 ) );
788 if( ( nChipNoBack < 0 ) || ( nChipNoBack > 36 * 36 - 1 ) )
792 if( ( nLaneNo >= 0 ) && ( nLaneNo < this._Form.mgr譜面管理者.listレーン.Count ) )
794 if( nChipNoFore != 0 )
796 this._Form.mgr譜面管理者.listレーン[ nLaneNo ].nレーン割付チップ_表0or1to1295 = nChipNoFore;
798 if( nChipNoBack != 0 )
800 this._Form.mgr譜面管理者.listレーン[ nLaneNo ].nレーン割付チップ_裏0or1to1295 = nChipNoBack;
807 private bool tDTX入力_行解析_DTXC_WAVBACKCOLOR( string strコマンド, string strパラメータ, string strコメント )
810 if( !strコマンド.Equals( "DTXC_WAVBACKCOLOR", StringComparison.OrdinalIgnoreCase ) )
814 string[] strArray = strパラメータ.Split( new char[] { ' ', '\t' } );
815 if( strArray.Length < 2 )
819 if( !int.TryParse( strArray[ 0 ], out nChipNo ) )
823 if( ( nChipNo < 0 ) || ( nChipNo > 36 * 36 - 2 ) )
827 Color color = ColorTranslator.FromHtml( strArray[ 1 ] );
828 if( ( nChipNo >= 0 ) && ( nChipNo <= 36 * 36 - 2 ) )
830 this._Form.mgrWAVリスト管理者.tWAVをキャッシュから検索して返す_なければ新規生成する( nChipNo ).col背景色 = color;
834 private bool tDTX入力_行解析_DTXC_WAVFORECOLOR( string strコマンド, string strパラメータ, string strコメント )
837 if( !strコマンド.Equals( "DTXC_WAVFORECOLOR", StringComparison.OrdinalIgnoreCase ) )
841 string[] strArray = strパラメータ.Split( new char[] { ' ', '\t' } );
842 if( strArray.Length < 2 )
846 if( !int.TryParse( strArray[ 0 ], out nChipNo ) )
850 if( ( nChipNo < 0 ) || ( nChipNo > 36 * 36 - 2 ) )
854 Color color = ColorTranslator.FromHtml( strArray[ 1 ] );
855 if( ( nChipNo >= 0 ) && ( nChipNo <= 36 * 36 - 2 ) )
857 this._Form.mgrWAVリスト管理者.tWAVをキャッシュから検索して返す_なければ新規生成する( nChipNo ).col文字色 = color;
861 private bool tDTX入力_行解析_TITLE_ARTIST_COMMENT_その他( string strコマンド, string strパラメータ, string strコメント )
863 if( strコマンド.Equals( "TITLE", StringComparison.OrdinalIgnoreCase ) )
865 CUndoRedo管理.bUndoRedoした直後 = true;
866 this._Form.textBox曲名.Text = strパラメータ.Trim();
869 if( strコマンド.Equals( "ARTIST", StringComparison.OrdinalIgnoreCase ) )
871 CUndoRedo管理.bUndoRedoした直後 = true;
872 this._Form.textBox製作者.Text = strパラメータ.Trim();
875 if ( strコマンド.Equals( "GENRE", StringComparison.OrdinalIgnoreCase ) )
877 CUndoRedo管理.bUndoRedoした直後 = true;
878 this._Form.textBoxGenre.Text = strパラメータ.Trim();
881 if( strコマンド.Equals( "USE556X710BGAAVI", StringComparison.OrdinalIgnoreCase) )
883 CUndoRedo管理.bUndoRedoした直後 = true;
884 this._Form.check556x710BGAAVI.Checked = strパラメータ.Trim() == "1" ? true : false;
887 if( strコマンド.Equals( "COMMENT", StringComparison.OrdinalIgnoreCase ) )
889 CUndoRedo管理.bUndoRedoした直後 = true;
890 this._Form.textBoxコメント.Text = strパラメータ.Trim();
893 if( strコマンド.Equals( "PANEL", StringComparison.OrdinalIgnoreCase ) )
895 int dummyResult; // #23885, #26007 2011.8.13 yyagi: not to confuse "#PANEL strings (panel)" and "#PANEL int (panpot of EL)"
896 if ( !int.TryParse( strパラメータ, out dummyResult ) ) // 数値じゃないならPANELとみなす
898 CUndoRedo管理.bUndoRedoした直後 = true;
899 this._Form.textBoxパネル.Text = strパラメータ.Trim();
901 } // 数値なら、ここでは何もせず、後で#PANに拾ってもらう (PAN ELとみなす)
903 if( strコマンド.Equals( "PREVIEW", StringComparison.OrdinalIgnoreCase ) )
905 CUndoRedo管理.bUndoRedoした直後 = true;
906 this._Form.textBoxPREVIEW.Text = strパラメータ.Trim();
909 if( strコマンド.Equals( "PREIMAGE", StringComparison.OrdinalIgnoreCase ) )
911 CUndoRedo管理.bUndoRedoした直後 = true;
912 this._Form.textBoxPREIMAGE.Text = strパラメータ.Trim();
915 if( strコマンド.Equals( "STAGEFILE", StringComparison.OrdinalIgnoreCase ) )
917 CUndoRedo管理.bUndoRedoした直後 = true;
918 this._Form.textBoxSTAGEFILE.Text = strパラメータ.Trim();
921 if( strコマンド.Equals( "BACKGROUND", StringComparison.OrdinalIgnoreCase ) || strコマンド.Equals( "WALL", StringComparison.OrdinalIgnoreCase ) )
923 CUndoRedo管理.bUndoRedoした直後 = true;
924 this._Form.textBoxBACKGROUND.Text = strパラメータ.Trim();
927 if( strコマンド.Equals( "RESULTIMAGE", StringComparison.OrdinalIgnoreCase ) )
929 CUndoRedo管理.bUndoRedoした直後 = true;
930 this._Form.textBoxRESULTIMAGE.Text = strパラメータ.Trim();
933 if( strコマンド.Equals( "BPM", StringComparison.OrdinalIgnoreCase ) )
936 if( !this.TryParse( strパラメータ, out dBpm ) ) // #23880 2011.1.6 yyagi
940 CUndoRedo管理.bUndoRedoした直後 = true;
941 this._Form.numericUpDownBPM.Value = dBpm;
944 if( strコマンド.Equals( "DLEVEL", StringComparison.OrdinalIgnoreCase ) )
947 if( !int.TryParse( strパラメータ, out nLevel ) )
951 else if( nLevel < 0 )
955 else if( nLevel > 100 )
959 CUndoRedo管理.bUndoRedoした直後 = true;
960 this._Form.hScrollBarDLEVEL.Value = nLevel;
961 CUndoRedo管理.bUndoRedoした直後 = true;
962 this._Form.textBoxDLEVEL.Text = nLevel.ToString();
965 if( strコマンド.Equals( "GLEVEL", StringComparison.OrdinalIgnoreCase ) )
968 if( !int.TryParse( strパラメータ, out nLevel ) )
972 else if( nLevel < 0 )
976 else if( nLevel > 100 )
980 CUndoRedo管理.bUndoRedoした直後 = true;
981 this._Form.hScrollBarGLEVEL.Value = nLevel;
982 CUndoRedo管理.bUndoRedoした直後 = true;
983 this._Form.textBoxGLEVEL.Text = nLevel.ToString();
986 if( strコマンド.Equals( "BLEVEL", StringComparison.OrdinalIgnoreCase ) )
989 if( !int.TryParse( strパラメータ, out nLevel ) )
993 else if( nLevel < 0 )
997 else if( nLevel > 100 )
1001 CUndoRedo管理.bUndoRedoした直後 = true;
1002 this._Form.hScrollBarBLEVEL.Value = nLevel;
1003 CUndoRedo管理.bUndoRedoした直後 = true;
1004 this._Form.textBoxBLEVEL.Text = nLevel.ToString();
1007 if( strコマンド.Equals( "DTXVPLAYSPEED", StringComparison.OrdinalIgnoreCase ) )
1010 // if ( !this.TryParse( strパラメータ, out num5 ) ) // #24790 2011.4.8 yyagi
1011 if ( !decimal.TryParse( strパラメータ, out dPlaySpeed ) ) // #24790 2011.4.8 yyagi
1015 else if( dPlaySpeed < 0.5M )
1019 else if( dPlaySpeed > 1.5M )
1023 decimal dIndex = ( 1.5M - dPlaySpeed ) * 10M;
1024 int nIndex = (int) dIndex;
1029 else if( nIndex > 10 )
1033 CUndoRedo管理.bUndoRedoした直後 = true;
1034 this._Form.toolStripComboBox演奏速度.SelectedIndex = nIndex;
1040 private bool tDTX入力_行解析_WAV( string strコマンド, string strパラメータ, string strコメント )
1042 if( strコマンド.StartsWith( "wav", StringComparison.OrdinalIgnoreCase ) )
1044 strコマンド = strコマンド.Substring( 3 );
1050 int nChipNo = C変換.n36進数2桁の文字列を数値に変換して返す( strコマンド.Substring( 0, 2 ) );
1051 if( ( nChipNo < 1 ) || ( nChipNo > 36 * 36 - 1 ) )
1055 CWAV cwav = this._Form.mgrWAVリスト管理者.tWAVをキャッシュから検索して返す_なければ新規生成する( nChipNo );
1056 cwav.strラベル名 = strコメント;
1057 cwav.strファイル名 = strパラメータ;
1060 private bool tDTX入力_行解析_WAVPAN_PAN( string strコマンド, string strパラメータ, string strコメント )
1063 if( strコマンド.StartsWith( "WAVPAN", StringComparison.OrdinalIgnoreCase ) )
1065 strコマンド = strコマンド.Substring( 6 );
1067 else if( strコマンド.StartsWith( "PAN", StringComparison.OrdinalIgnoreCase ) )
1069 strコマンド = strコマンド.Substring( 3 );
1075 if( strコマンド.Length < 2 )
1079 int nChipNo = C変換.n36進数2桁の文字列を数値に変換して返す( strコマンド.Substring( 0, 2 ) );
1080 if( int.TryParse( strパラメータ, out nPan ) )
1086 else if( nPan >= 100 )
1090 this._Form.mgrWAVリスト管理者.tWAVをキャッシュから検索して返す_なければ新規生成する( nChipNo ).n位置_100to100 = nPan;
1094 private bool tDTX入力_行解析_WAVVOL_VOLUME( string strコマンド, string strパラメータ, string strコメント )
1097 if( strコマンド.StartsWith( "WAVVOL", StringComparison.OrdinalIgnoreCase ) )
1099 strコマンド = strコマンド.Substring( 6 );
1101 else if( strコマンド.StartsWith( "VOLUME", StringComparison.OrdinalIgnoreCase ) )
1103 strコマンド = strコマンド.Substring( 6 );
1109 if( strコマンド.Length < 2 )
1113 int nChipNo = C変換.n36進数2桁の文字列を数値に変換して返す( strコマンド.Substring( 0, 2 ) );
1114 if( int.TryParse( strパラメータ, out nVol ) )
1120 else if( nVol >= 100 )
1124 this._Form.mgrWAVリスト管理者.tWAVをキャッシュから検索して返す_なければ新規生成する( nChipNo ).n音量0to100 = nVol;
1128 private bool tDTX入力_行解析_チャンネル( string strコマンド, string strパラメータ, string strコメント )
1131 if( !this.tDTX入力_行解析_チャンネル_コマンドから小節番号とチャンネル番号を抜き出す( strコマンド, out nBar, out nCh ) )
1135 if( nCh == 2 ) // Bar Length
1138 if( !this.TryParse( strパラメータ, out dBarLength ) ) // #23880 2011.1.6 yyagi
1142 this.dic小節長倍率.Add( nBar, (float)dBarLength );
1143 this.tDTX入力_行解析_チャンネル_小節番号に対応する小節を探すか新規に作って返す( nBar ); // #32609 2013.12.16 yyagi
1147 if ( ( nCh >= 0x20 ) && ( nCh <= 0x27 ) )
1149 C小節 c小節 = this.tDTX入力_行解析_チャンネル_小節番号に対応する小節を探すか新規に作って返す( nBar );
1151 while( ( startIndex = strパラメータ.IndexOf( '_' ) ) != -1 )
1153 strパラメータ = strパラメータ.Remove( startIndex, 1 );
1155 int nChips = strパラメータ.Length / 2;
1156 for( int i = 0; i < nChips; i++ )
1158 int nChipNo = C変換.n36進数2桁の文字列を数値に変換して返す( strパラメータ.Substring( i * 2, 2 ) );
1161 int nLaneGtV = this._Form.mgr譜面管理者.nレーン名に対応するレーン番号を返す( "GtV" );
1162 int nLaneGtR = this._Form.mgr譜面管理者.nレーン名に対応するレーン番号を返す( "GtR" );
1163 int nLaneGtG = this._Form.mgr譜面管理者.nレーン名に対応するレーン番号を返す( "GtG" );
1164 int nLaneGtB = this._Form.mgr譜面管理者.nレーン名に対応するレーン番号を返す( "GtB" );
1165 Cチップ item = new Cチップ();
1166 item.nレーン番号0to = nLaneGtV;
1168 item.n値_整数1to1295 = nChipNo;
1169 item.n読み込み時の解像度 = nChips;
1170 c小節.listチップ.Add( item );
1175 item.nレーン番号0to = nLaneGtR;
1177 item.n値_整数1to1295 = 2;
1178 item.n読み込み時の解像度 = nChips;
1179 c小節.listチップ.Add( item );
1184 item.nレーン番号0to = nLaneGtB;
1186 item.n値_整数1to1295 = 1;
1187 item.n読み込み時の解像度 = nChips;
1188 c小節.listチップ.Add( item );
1193 item.nレーン番号0to = nLaneGtG;
1195 item.n値_整数1to1295 = 1;
1196 item.n読み込み時の解像度 = nChips;
1197 c小節.listチップ.Add( item );
1202 item.nレーン番号0to = nLaneGtG;
1204 item.n値_整数1to1295 = 1;
1205 item.n読み込み時の解像度 = nChips;
1206 c小節.listチップ.Add( item );
1208 item.nレーン番号0to = nLaneGtB;
1210 item.n値_整数1to1295 = 1;
1211 item.n読み込み時の解像度 = nChips;
1212 c小節.listチップ.Add( item );
1217 item.nレーン番号0to = nLaneGtR;
1219 item.n値_整数1to1295 = 1;
1220 item.n読み込み時の解像度 = nChips;
1221 c小節.listチップ.Add( item );
1226 item.nレーン番号0to = nLaneGtR;
1228 item.n値_整数1to1295 = 1;
1229 item.n読み込み時の解像度 = nChips;
1230 c小節.listチップ.Add( item );
1232 item.nレーン番号0to = nLaneGtB;
1234 item.n値_整数1to1295 = 1;
1235 item.n読み込み時の解像度 = nChips;
1236 c小節.listチップ.Add( item );
1241 item.nレーン番号0to = nLaneGtR;
1243 item.n値_整数1to1295 = 1;
1244 item.n読み込み時の解像度 = nChips;
1245 c小節.listチップ.Add( item );
1247 item.nレーン番号0to = nLaneGtG;
1249 item.n値_整数1to1295 = 1;
1250 item.n読み込み時の解像度 = nChips;
1251 c小節.listチップ.Add( item );
1256 item.nレーン番号0to = nLaneGtR;
1258 item.n値_整数1to1295 = 1;
1259 item.n読み込み時の解像度 = nChips;
1260 c小節.listチップ.Add( item );
1262 item.nレーン番号0to = nLaneGtG;
1264 item.n値_整数1to1295 = 1;
1265 item.n読み込み時の解像度 = nChips;
1266 c小節.listチップ.Add( item );
1268 item.nレーン番号0to = nLaneGtB;
1270 item.n値_整数1to1295 = 1;
1271 item.n読み込み時の解像度 = nChips;
1272 c小節.listチップ.Add( item );
1281 if ( ( nCh >= 0xa0 ) && ( nCh <= 0xa7 ) )
1283 C小節 c小節 = this.tDTX入力_行解析_チャンネル_小節番号に対応する小節を探すか新規に作って返す( nBar );
1285 while( ( startIndex = strパラメータ.IndexOf( '_' ) ) != -1 )
1287 strパラメータ = strパラメータ.Remove( startIndex, 1 );
1289 int nChips = strパラメータ.Length / 2;
1290 for( int i = 0; i < nChips; i++ )
1292 int nChipNo = C変換.n36進数2桁の文字列を数値に変換して返す( strパラメータ.Substring( i * 2, 2 ) );
1295 int nLaneBsV = this._Form.mgr譜面管理者.nレーン名に対応するレーン番号を返す( "BsV" );
1296 int nLaneBsR = this._Form.mgr譜面管理者.nレーン名に対応するレーン番号を返す( "BsR" );
1297 int nLanrBsG = this._Form.mgr譜面管理者.nレーン名に対応するレーン番号を返す( "BsG" );
1298 int nLaneBsB = this._Form.mgr譜面管理者.nレーン名に対応するレーン番号を返す( "BsB" );
1299 Cチップ item = new Cチップ();
1300 item.nレーン番号0to = nLaneBsV;
1302 item.n値_整数1to1295 = nChipNo;
1303 item.n読み込み時の解像度 = nChips;
1304 c小節.listチップ.Add( item );
1309 item.nレーン番号0to = nLaneBsR;
1311 item.n値_整数1to1295 = 2;
1312 item.n読み込み時の解像度 = nChips;
1313 c小節.listチップ.Add( item );
1318 item.nレーン番号0to = nLaneBsB;
1320 item.n値_整数1to1295 = 1;
1321 item.n読み込み時の解像度 = nChips;
1322 c小節.listチップ.Add( item );
1327 item.nレーン番号0to = nLanrBsG;
1329 item.n値_整数1to1295 = 1;
1330 item.n読み込み時の解像度 = nChips;
1331 c小節.listチップ.Add( item );
1336 item.nレーン番号0to = nLanrBsG;
1338 item.n値_整数1to1295 = 1;
1339 item.n読み込み時の解像度 = nChips;
1340 c小節.listチップ.Add( item );
1342 item.nレーン番号0to = nLaneBsB;
1344 item.n値_整数1to1295 = 1;
1345 item.n読み込み時の解像度 = nChips;
1346 c小節.listチップ.Add( item );
1351 item.nレーン番号0to = nLaneBsR;
1353 item.n値_整数1to1295 = 1;
1354 item.n読み込み時の解像度 = nChips;
1355 c小節.listチップ.Add( item );
1360 item.nレーン番号0to = nLaneBsR;
1362 item.n値_整数1to1295 = 1;
1363 item.n読み込み時の解像度 = nChips;
1364 c小節.listチップ.Add( item );
1366 item.nレーン番号0to = nLaneBsB;
1368 item.n値_整数1to1295 = 1;
1369 item.n読み込み時の解像度 = nChips;
1370 c小節.listチップ.Add( item );
1375 item.nレーン番号0to = nLaneBsR;
1377 item.n値_整数1to1295 = 1;
1378 item.n読み込み時の解像度 = nChips;
1379 c小節.listチップ.Add( item );
1381 item.nレーン番号0to = nLanrBsG;
1383 item.n値_整数1to1295 = 1;
1384 item.n読み込み時の解像度 = nChips;
1385 c小節.listチップ.Add( item );
1390 item.nレーン番号0to = nLaneBsR;
1392 item.n値_整数1to1295 = 1;
1393 item.n読み込み時の解像度 = nChips;
1394 c小節.listチップ.Add( item );
1396 item.nレーン番号0to = nLanrBsG;
1398 item.n値_整数1to1295 = 1;
1399 item.n読み込み時の解像度 = nChips;
1400 c小節.listチップ.Add( item );
1402 item.nレーン番号0to = nLaneBsB;
1404 item.n値_整数1to1295 = 1;
1405 item.n読み込み時の解像度 = nChips;
1406 c小節.listチップ.Add( item );
1414 #region [ Other Channels ]
1417 if( this.tDTX入力_行解析_チャンネル_チャンネルに該当するレーン番号を返す( nCh, out nレーン番号, out flag ) )
1419 C小節 c小節 = this.tDTX入力_行解析_チャンネル_小節番号に対応する小節を探すか新規に作って返す( nBar );
1421 while( ( nPosOf_ = strパラメータ.IndexOf( '_' ) ) != -1 )
1423 strパラメータ = strパラメータ.Remove( nPosOf_, 1 );
1425 int nChips = strパラメータ.Length / 2;
1426 for( int i = 0; i < nChips; i++ )
1428 int nChipNo = ( nCh == 3 ) ? C変換.n16進数2桁の文字列を数値に変換して返す( strパラメータ.Substring( i * 2, 2 ) ) : C変換.n36進数2桁の文字列を数値に変換して返す( strパラメータ.Substring( i * 2, 2 ) );
1431 Cチップ cチップ = new Cチップ();
1432 cチップ.nチャンネル番号00toFF = nCh;
1433 cチップ.nレーン番号0to = nレーン番号;
1435 cチップ.n読み込み時の解像度 = nChips;
1436 cチップ.n値_整数1to1295 = nChipNo;
1439 if ( ( nCh == 0xF8 || nCh == 0xF3 ) && // BEATチップの場合
1440 dicBEATチップf値.TryGetValue( nBar * CWholeNoteDivision.n分解能 + (i * CWholeNoteDivision.n分解能 / nChips ), out f ) )
1443 //Debug.WriteLine( "f値: nBar=" + nBar + ", f値=" + f );
1445 c小節.listチップ.Add( cチップ );
1450 StringBuilder builder = new StringBuilder( 0x400 );
1451 builder.Append( "#" + C変換.str小節番号を文字列3桁に変換して返す( nBar ) + C変換.str数値を16進数2桁に変換して返す( nCh ) + ": " + strパラメータ );
1452 if( strコメント.Length > 0 )
1454 builder.Append( " ;" + strコメント );
1456 builder.Append( Environment.NewLine );
1457 CUndoRedo管理.bUndoRedoした直後 = true;
1458 this._Form.textBox自由入力欄.AppendText( builder.ToString() );
1462 private int tDTX入力_行解析_チャンネル_GDAチャンネル文字列2桁をチャンネル番号にして返す( string strチャンネル文字列2桁 )
1464 if( strチャンネル文字列2桁.Length == 2 )
1466 switch( strチャンネル文字列2桁.ToUpper() )
1655 // #25990 2011.8.12 yyagi BMS/BME→DTX変換メイン
1656 private int tDTX入力_行解析_チャンネル_BMSチャンネル文字列2桁をチャンネル番号にして返す( string strチャンネル文字列2桁, int bar, E種別 eType )
1658 if ( bar >= 0 && strチャンネル文字列2桁.Length == 2 )
1660 if ( nLastBarConverted != bar ) // 小節が変わったら、BGM用に使うch群
1662 nLastBarConverted = bar;
1666 int bmsCh = Convert.ToInt32( strチャンネル文字列2桁, 16 );
1667 if ( bmsCh == 0x01 ) // BGMなら
1669 if ( !eDTXbgmChs.MoveNext() ) // BGM用に使うSEチャネルの空きがもう無い
1673 return (int) eDTXbgmChs.Current;
1675 else if ( 0x11 <= bmsCh && bmsCh <= 0x19 ) // 鍵盤なら
1677 return ( eType == E種別.BMS ) ? BMSkeyChToDTXdrumsCh[ bmsCh - 0x11 ] : BMEkeyChToDTXdrumsCh[ bmsCh - 0x11 ];
1681 return BMSgeneralChToDTXgeneralCh[ bmsCh ];
1686 private bool tDTX入力_行解析_チャンネル_コマンドから小節番号とチャンネル番号を抜き出す( string strコマンド, out int n小節番号, out int nチャンネル番号 )
1688 if( strコマンド.Length >= 5 )
1690 n小節番号 = C変換.n小節番号の文字列3桁を数値に変換して返す( strコマンド.Substring( 0, 3 ) );
1691 if( ( this.e種別 == E種別.GDA ) || ( this.e種別 == E種別.G2D ) )
1693 nチャンネル番号 = this.tDTX入力_行解析_チャンネル_GDAチャンネル文字列2桁をチャンネル番号にして返す( strコマンド.Substring( 3, 2 ) );
1695 else if( ( this.e種別 == E種別.BMS ) || ( this.e種別 == E種別.BME ) ) // #25990 2011.8.12 yyagi
1697 nチャンネル番号 = this.tDTX入力_行解析_チャンネル_BMSチャンネル文字列2桁をチャンネル番号にして返す( strコマンド.Substring( 3, 2 ), n小節番号, this.e種別 );
1701 nチャンネル番号 = C変換.n16進数2桁の文字列を数値に変換して返す( strコマンド.Substring( 3, 2 ) );
1703 return ( ( n小節番号 >= 0 ) && ( nチャンネル番号 > 0 ) );
1709 private bool tDTX入力_行解析_チャンネル_チャンネルに該当するレーン番号を返す( int nチャンネル番号, out int nレーン番号, out bool b裏 )
1713 for( int i = 0; i < this._Form.mgr譜面管理者.listレーン.Count; i++ )
1715 Cレーン cレーン = this._Form.mgr譜面管理者.listレーン[ i ];
1716 if( cレーン.nチャンネル番号_表00toFF == nチャンネル番号 )
1722 if( cレーン.nチャンネル番号_裏00toFF == nチャンネル番号 )
1731 private C小節 tDTX入力_行解析_チャンネル_小節番号に対応する小節を探すか新規に作って返す( int n小節番号 )
1733 C小節 c小節 = this._Form.mgr譜面管理者.p小節を返す( n小節番号 );
1736 if( n小節番号 > this._Form.mgr譜面管理者.n現在の最大の小節番号を返す() )
1738 for( int i = this._Form.mgr譜面管理者.n現在の最大の小節番号を返す() + 1; i <= n小節番号; i++ )
1741 this._Form.mgr譜面管理者.dic小節.Add( i, c小節 );
1745 c小節 = new C小節( n小節番号 );
1746 this._Form.mgr譜面管理者.dic小節.Add( n小節番号, c小節 );
1750 private void tDTX入力_小節長倍率配列を昇順ソート済みの小節リストに適用する()
1753 for( int i = 0; i < this._Form.mgr譜面管理者.dic小節.Count; i++ )
1755 C小節 c小節 = this._Form.mgr譜面管理者.dic小節[ i ];
1756 foreach( KeyValuePair<int, float> pair in this.dic小節長倍率 )
1758 if( c小節.n小節番号0to3599 == pair.Key )
1764 for( int j = 0; j < c小節.listチップ.Count; j++ )
1766 c小節.listチップ[ j ].n位置grid = ( c小節.listチップ[ j ].n位置grid * c小節.n小節長倍率を考慮した現在の小節の高さgrid ) / c小節.listチップ[ j ].n読み込み時の解像度;
1770 private void tDTX入力_小節内のチップリストを発声位置でソートする()
1772 foreach( KeyValuePair<int, C小節> pair in this._Form.mgr譜面管理者.dic小節 )
1774 pair.Value.listチップ.Sort();
1778 private void tDTX出力_AVIリスト( StreamWriter sw )
1781 for( int i = 1; i <= 36 * 36 - 1; i++ )
1783 CAVI cavi = this._Form.mgrAVIリスト管理者.tAVIをキャッシュから検索して返す( i );
1784 if( ( cavi != null ) && ( cavi.strファイル名.Length > 0 ) )
1786 string str = C変換.str数値を36進数2桁に変換して返す( cavi.nAVI番号1to1295 );
1787 sw.Write( "#AVI{0}: {1}", str, cavi.strファイル名 );
1788 if( cavi.strラベル名.Length > 0 )
1790 sw.Write( "\t;{0}", cavi.strラベル名 );
1796 private void tDTX出力_AVIリスト色設定( StreamWriter sw )
1798 Color color = ColorTranslator.FromHtml( "window" );
1799 Color color2 = ColorTranslator.FromHtml( "windowtext" );
1800 for( int i = 1; i <= 36 * 36 - 1; i++ )
1802 CAVI cavi = this._Form.mgrAVIリスト管理者.tAVIをキャッシュから検索して返す( i );
1805 if( cavi.col文字色 != color2 )
1807 sw.WriteLine( "#DTXC_AVIFORECOLOR: {0} {1}", i, ColorTranslator.ToHtml( cavi.col文字色 ) );
1809 if( cavi.col背景色 != color )
1811 sw.WriteLine( "#DTXC_AVIBACKCOLOR: {0} {1}", i, ColorTranslator.ToHtml( cavi.col背景色 ) );
1816 private void tDTX出力_BMPリスト( StreamWriter sw )
1819 for( int i = 1; i <= 36 * 36 - 1; i++ )
1821 CBMP cbmp = this._Form.mgrBMPリスト管理者.tBMPをキャッシュから検索して返す( i );
1822 if( ( cbmp != null ) && ( cbmp.strファイル名.Length > 0 ) )
1824 string str = C変換.str数値を36進数2桁に変換して返す( cbmp.nBMP番号1to1295 );
1827 sw.Write( "#BMP{0}: {1}", str, cbmp.strファイル名 );
1828 if( cbmp.strラベル名.Length > 0 )
1830 sw.Write( "\t;{0}", cbmp.strラベル名 );
1836 sw.Write( "#BMPTEX{0}: {1}", str, cbmp.strファイル名 );
1837 if( cbmp.strラベル名.Length > 0 )
1839 sw.Write( "\t;{0}", cbmp.strラベル名 );
1846 private void tDTX出力_BMPリスト色設定( StreamWriter sw )
1848 Color color = ColorTranslator.FromHtml( "window" );
1849 Color color2 = ColorTranslator.FromHtml( "windowtext" );
1850 for( int i = 1; i <= 36 * 36 - 1; i++ )
1852 CBMP cbmp = this._Form.mgrBMPリスト管理者.tBMPをキャッシュから検索して返す( i );
1855 if( cbmp.col文字色 != color2 )
1857 sw.WriteLine( "#DTXC_BMPFORECOLOR: {0} {1}", i, ColorTranslator.ToHtml( cbmp.col文字色 ) );
1859 if( cbmp.col背景色 != color )
1861 sw.WriteLine( "#DTXC_BMPBACKCOLOR: {0} {1}", i, ColorTranslator.ToHtml( cbmp.col背景色 ) );
1866 private void tDTX出力_BPxリスト( StreamWriter sw )
1869 foreach( KeyValuePair<int, float> pair in this._Form.mgr譜面管理者.dicBPx )
1871 sw.WriteLine( "#BPM{0}: {1}", C変換.str数値を36進数2桁に変換して返す( pair.Key ), pair.Value );
1874 private void tDTX出力_WAVリスト( StreamWriter sw, bool bBGMのみ出力 )
1877 for( int i = 1; i <= 36 * 36 - 1; i++ )
1879 CWAV cwav = this._Form.mgrWAVリスト管理者.tWAVをキャッシュから検索して返す( i );
1880 if( ( ( cwav != null ) && ( cwav.strファイル名.Length > 0 ) ) && ( !bBGMのみ出力 || cwav.bBGMとして使用 ) )
1882 string str = C変換.str数値を36進数2桁に変換して返す( cwav.nWAV番号1to1295 );
1883 sw.Write( "#WAV{0}: {1}", str, cwav.strファイル名 );
1884 if( cwav.strラベル名.Length > 0 )
1886 sw.Write( "\t;{0}", cwav.strラベル名 );
1889 if( cwav.n音量0to100 != 100 )
1891 sw.WriteLine( "#VOLUME{0}: {1}", str, cwav.n音量0to100.ToString() );
1893 if( cwav.n位置_100to100 != 0 )
1895 sw.WriteLine( "#PAN{0}: {1}", str, cwav.n位置_100to100.ToString() );
1897 if( cwav.bBGMとして使用 )
1899 sw.WriteLine( "#BGMWAV: {0}", str );
1904 private void tDTX出力_WAVリスト色設定( StreamWriter sw )
1906 Color color = ColorTranslator.FromHtml( "window" );
1907 Color color2 = ColorTranslator.FromHtml( "windowtext" );
1908 for( int i = 1; i <= 36 * 36 - 1; i++ )
1910 CWAV cwav = this._Form.mgrWAVリスト管理者.tWAVをキャッシュから検索して返す( i );
1913 if( cwav.col文字色 != color2 )
1915 sw.WriteLine( "#DTXC_WAVFORECOLOR: {0} {1}", i, ColorTranslator.ToHtml( cwav.col文字色 ) );
1917 if( cwav.col背景色 != color )
1919 sw.WriteLine( "#DTXC_WAVBACKCOLOR: {0} {1}", i, ColorTranslator.ToHtml( cwav.col背景色 ) );
1924 private void tDTX出力_タイトルと製作者とコメントその他( StreamWriter sw )
1927 if( this._Form.textBox曲名.Text.Length == 0 )
1929 sw.WriteLine( "#TITLE: (no title)" );
1933 sw.WriteLine( "#TITLE: " + this._Form.textBox曲名.Text );
1935 if( this._Form.textBox製作者.Text.Length > 0 )
1937 sw.WriteLine( "#ARTIST: " + this._Form.textBox製作者.Text );
1939 if( this._Form.textBoxGenre.Text.Length > 0 )
1941 sw.WriteLine( "#GENRE: " + this._Form.textBoxGenre.Text );
1943 if( this._Form.check556x710BGAAVI.Checked )
1945 sw.WriteLine("#USE556X710BGAAVI: 1");
1947 if( this._Form.textBoxコメント.Text.Length > 0 )
1949 sw.WriteLine( "#COMMENT: " + this._Form.textBoxコメント.Text );
1951 if( this._Form.textBoxパネル.Text.Length > 0 )
1953 sw.WriteLine( "#PANEL: " + this._Form.textBoxパネル.Text );
1955 if( this._Form.textBoxPREVIEW.Text.Length > 0 )
1957 sw.WriteLine( "#PREVIEW: " + this._Form.textBoxPREVIEW.Text );
1959 if( this._Form.textBoxPREIMAGE.Text.Length > 0 )
1961 sw.WriteLine( "#PREIMAGE: " + this._Form.textBoxPREIMAGE.Text );
1963 if( this._Form.textBoxSTAGEFILE.Text.Length > 0 )
1965 sw.WriteLine( "#STAGEFILE: " + this._Form.textBoxSTAGEFILE.Text );
1967 if( this._Form.textBoxBACKGROUND.Text.Length > 0 )
1969 sw.WriteLine( "#BACKGROUND: " + this._Form.textBoxBACKGROUND.Text );
1971 if( this._Form.textBoxRESULTIMAGE.Text.Length > 0 )
1973 sw.WriteLine( "#RESULTIMAGE: " + this._Form.textBoxRESULTIMAGE.Text );
1975 if( this._Form.numericUpDownBPM.Value != 0M )
1977 sw.WriteLine( "#BPM: " + this._Form.numericUpDownBPM.Value );
1979 // if( this._Form.hScrollBarDLEVEL.Value != 0 )
1981 sw.WriteLine( "#DLEVEL: " + this._Form.hScrollBarDLEVEL.Value );
1983 // if( this._Form.hScrollBarGLEVEL.Value != 0 )
1985 sw.WriteLine( "#GLEVEL: " + this._Form.hScrollBarGLEVEL.Value );
1987 // if( this._Form.hScrollBarBLEVEL.Value != 0 )
1989 sw.WriteLine( "#BLEVEL: " + this._Form.hScrollBarBLEVEL.Value );
1991 if( this._Form.mgr譜面管理者.strPATH_WAV.Length != 0 )
1993 sw.WriteLine( "#PATH_WAV: " + this._Form.mgr譜面管理者.strPATH_WAV );
1995 if( this._Form.toolStripComboBox演奏速度.SelectedIndex != 5 )
1997 sw.WriteLine( "#DTXVPLAYSPEED: " + ( 1.5f - ( this._Form.toolStripComboBox演奏速度.SelectedIndex * 0.1f ) ) );
2000 private void tDTX出力_チップパレット( StreamWriter sw )
2002 sw.Write( "#DTXC_CHIPPALETTE: " );
2003 foreach( ListViewItem item in this._Form.dlgチップパレット.listViewチップリスト.Items )
2005 sw.Write( " {0},{1}", item.ImageIndex, item.SubItems[ 1 ].Text );
2009 private void tDTX出力_レーン割付チップ( StreamWriter sw )
2012 for( int i = 0; i < this._Form.mgr譜面管理者.listレーン.Count; i++ )
2014 Cレーン cレーン = this._Form.mgr譜面管理者.listレーン[ i ];
2015 if( ( cレーン.nレーン割付チップ_表0or1to1295 > 0 ) || ( cレーン.nレーン割付チップ_裏0or1to1295 > 0 ) )
2017 sw.WriteLine( "#DTXC_LANEBINDEDCHIP: {0} {1} {2}", i.ToString( "00" ), C変換.str数値を36進数2桁に変換して返す( cレーン.nレーン割付チップ_表0or1to1295), C変換.str数値を36進数2桁に変換して返す( cレーン.nレーン割付チップ_裏0or1to1295) );
2021 private void tDTX出力_自由入力欄( StreamWriter sw )
2024 if( this._Form.textBox自由入力欄.Text.Length > 0 )
2027 sw.Write( this._Form.textBox自由入力欄.Text );
2031 private void tDTX出力_小節長倍率( StreamWriter sw )
2035 for( int i = 0; i < this._Form.mgr譜面管理者.dic小節.Count; i++ )
2037 C小節 c小節 = this._Form.mgr譜面管理者.dic小節[ i ];
2038 if( c小節.f小節長倍率 != num )
2041 sw.WriteLine( "#{0}02: {1}", C変換.str小節番号を文字列3桁に変換して返す( c小節.n小節番号0to3599 ), num );
2045 private void tDTX出力_BEATチップのf値( StreamWriter sw )
2048 int laneBEAT = this._Form.mgr譜面管理者.nレーン名に対応するレーン番号を返す( "BEAT" );
2049 // Debug.WriteLine( "laneBEAT=" + laneBEAT );
2051 foreach ( KeyValuePair<int, C小節> pair in this._Form.mgr譜面管理者.dic小節 )
2053 C小節 c小節 = pair.Value;
2054 for ( int index = 0; index < c小節.listチップ.Count; index++ )
2056 if ( c小節.listチップ[ index ].nレーン番号0to == laneBEAT )
2058 // int n小節番号 = c小節.n小節番号0to3599;
2059 // Debug.WriteLine( "n小節番号=" + c小節.n小節番号0to3599 + ", 小節内Grid=" + c小節.listチップ[ index ].n位置grid + ",lane=" + c小節.listチップ[ index ].nレーン番号0to + ", f値=" + c小節.listチップ[ index ].f値・浮動小数 );
2060 //string str = C変換.str数値を36進数2桁に変換して返す( c );
2061 sw.WriteLine( "#BEAT{0}: {1}, {2}, {3}", c++, c小節.n小節番号0to3599, c小節.listチップ[ index ].n位置grid, c小節.listチップ[ index ].f値_浮動小数);
2066 private void tDTX出力_全チップ( StreamWriter sw )
2069 foreach( KeyValuePair<int, C小節> pair in this._Form.mgr譜面管理者.dic小節 )
2071 C小節 c小節 = pair.Value;
2072 List<int> list = new List<int>();
2073 foreach( Cチップ cチップ in c小節.listチップ )
2075 if( list.IndexOf( cチップ.nチャンネル番号00toFF ) < 0 )
2077 list.Add( cチップ.nチャンネル番号00toFF );
2080 int[,] numArray = new int[ c小節.n小節長倍率を考慮した現在の小節の高さgrid, 2 ];
2081 foreach( int num in list )
2085 for( int num2 = 0; num2 < c小節.n小節長倍率を考慮した現在の小節の高さgrid; num2++ )
2087 numArray[ num2, 0 ] = numArray[ num2, 1 ] = 0;
2089 foreach( Cチップ cチップ2 in c小節.listチップ )
2091 if( cチップ2.nチャンネル番号00toFF == num )
2093 numArray[ cチップ2.n位置grid, 0 ] = cチップ2.n値_整数1to1295;
2097 for( int num4 = 0; num4 < c小節.n小節長倍率を考慮した現在の小節の高さgrid; num4++ )
2099 num3 += numArray[ num4, 0 ];
2103 int num5 = c小節.n小節長倍率を考慮した現在の小節の高さgrid;
2104 foreach( int num6 in this.arr素数リスト )
2106 while( this.tDTX出力_全チップ_解像度をN分の1にできる( num6, ref numArray, num5 ) )
2109 for( int num7 = 0; num7 < num5; num7++ )
2111 numArray[ num7, 0 ] = numArray[ num7 * num6, 0 ];
2115 StringBuilder builder = new StringBuilder();
2116 for( int num8 = 0; num8 < num5; num8++ )
2120 builder.Append( C変換.str数値を16進数2桁に変換して返す( numArray[ num8, 0 ] ) );
2124 builder.Append( C変換.str数値を36進数2桁に変換して返す( numArray[ num8, 0 ] ) );
2127 sw.WriteLine( "#{0}{1}: {2}", C変換.str小節番号を文字列3桁に変換して返す( c小節.n小節番号0to3599 ), C変換.str数値を16進数2桁に変換して返す( num ), builder.ToString() );
2131 for( int i = 0; i < c小節.n小節長倍率を考慮した現在の小節の高さgrid; i++ )
2133 numArray[ i, 0 ] = numArray[ i, 1 ] = 0;
2135 foreach( Cチップ cチップ3 in c小節.listチップ )
2137 Cレーン cレーン = this._Form.mgr譜面管理者.listレーン[ cチップ3.nレーン番号0to ];
2138 switch( cレーン.eレーン種別 )
2142 numArray[ cチップ3.n位置grid, 0 ] = cチップ3.n値_整数1to1295;
2147 numArray[ cチップ3.n位置grid, 1 ] |= ( cチップ3.n値_整数1to1295 == 1 ) ? 0x04 : 0xFF; // OPEN = 0xFF
2152 numArray[ cチップ3.n位置grid, 1 ] |= 0x02;
2157 numArray[ cチップ3.n位置grid, 1 ] |= 0x01;
2162 for( int j = 0; j < c小節.n小節長倍率を考慮した現在の小節の高さgrid; j++ )
2164 if( ( numArray[ j, 0 ] == 0 ) || ( numArray[ j, 1 ] == 0 ) )
2166 numArray[ j, 0 ] = 0;
2167 numArray[ j, 1 ] = 0;
2170 int num11 = c小節.n小節長倍率を考慮した現在の小節の高さgrid;
2171 foreach( int num12 in this.arr素数リスト )
2173 while( this.tDTX出力_全チップ_解像度をN分の1にできる( num12, ref numArray, num11 ) )
2176 for( int num13 = 0; num13 < num11; num13++ )
2178 numArray[ num13, 0 ] = numArray[ num13 * num12, 0 ];
2179 numArray[ num13, 1 ] = numArray[ num13 * num12, 1 ];
2183 bool[] flagArray = new bool[ 8 ];
2184 for( int k = 0; k < 8; k++ )
2186 flagArray[ k ] = false;
2188 for( int m = 0; m < num11; m++ )
2190 if( numArray[ m, 1 ] == 0xff )
2192 flagArray[ 0 ] = true;
2194 else if( numArray[ m, 1 ] != 0 )
2196 flagArray[ numArray[ m, 1 ] ] = true;
2199 StringBuilder[] builderArray = new StringBuilder[ 8 ];
2200 for( int n = 0; n < 8; n++ )
2202 builderArray[ n ] = new StringBuilder();
2204 for( int num17 = 0; num17 < num11; num17++ )
2206 int num18 = ( numArray[ num17, 1 ] == 0xff ) ? 0x20 : ( numArray[ num17, 1 ] + 0x20 );
2207 for( int num19 = 0; num19 < 8; num19++ )
2209 if( flagArray[ num19 ] )
2211 if( num19 == ( num18 - 0x20 ) )
2213 builderArray[ num19 ].Append( C変換.str数値を36進数2桁に変換して返す( numArray[ num17, 0 ] ) );
2217 builderArray[ num19 ].Append( "00" );
2222 for( int num20 = 0; num20 < 8; num20++ )
2224 if( builderArray[ num20 ].Length != 0 )
2226 sw.WriteLine( "#{0}{1}: {2}", C変換.str小節番号を文字列3桁に変換して返す( c小節.n小節番号0to3599 ), C変換.str数値を16進数2桁に変換して返す( 0x20 + num20 ), builderArray[ num20 ].ToString() );
2229 for( int num21 = 0; num21 < c小節.n小節長倍率を考慮した現在の小節の高さgrid; num21++ )
2231 numArray[ num21, 0 ] = numArray[ num21, 1 ] = 0;
2233 foreach( Cチップ cチップ4 in c小節.listチップ )
2235 Cレーン cレーン2 = this._Form.mgr譜面管理者.listレーン[ cチップ4.nレーン番号0to ];
2236 switch( cレーン2.eレーン種別 )
2240 numArray[ cチップ4.n位置grid, 0 ] = cチップ4.n値_整数1to1295;
2245 numArray[ cチップ4.n位置grid, 1 ] |= ( cチップ4.n値_整数1to1295 == 1 ) ? 4 : 0xff; // OPEN = 0xFF
2250 numArray[ cチップ4.n位置grid, 1 ] |= 0x02;
2255 numArray[ cチップ4.n位置grid, 1 ] |= 0x01;
2260 for( int num22 = 0; num22 < c小節.n小節長倍率を考慮した現在の小節の高さgrid; num22++ )
2262 if( ( numArray[ num22, 0 ] == 0 ) || ( numArray[ num22, 1 ] == 0 ) )
2264 numArray[ num22, 0 ] = 0;
2265 numArray[ num22, 1 ] = 0;
2268 int num23 = c小節.n小節長倍率を考慮した現在の小節の高さgrid;
2269 foreach( int num24 in this.arr素数リスト )
2271 while( this.tDTX出力_全チップ_解像度をN分の1にできる( num24, ref numArray, num23 ) )
2274 for( int num25 = 0; num25 < num23; num25++ )
2276 numArray[ num25, 0 ] = numArray[ num25 * num24, 0 ];
2277 numArray[ num25, 1 ] = numArray[ num25 * num24, 1 ];
2281 bool[] flagArray2 = new bool[ 8 ];
2282 for( int num26 = 0; num26 < 8; num26++ )
2284 flagArray2[ num26 ] = false;
2286 for( int num27 = 0; num27 < num23; num27++ )
2288 if( numArray[ num27, 1 ] == 0xff )
2290 flagArray2[ 0 ] = true;
2292 else if( numArray[ num27, 1 ] != 0 )
2294 flagArray2[ numArray[ num27, 1 ] ] = true;
2297 StringBuilder[] builderArray2 = new StringBuilder[ 8 ];
2298 for( int num28 = 0; num28 < 8; num28++ )
2300 builderArray2[ num28 ] = new StringBuilder();
2302 for( int num29 = 0; num29 < num23; num29++ )
2304 int num30 = ( numArray[ num29, 1 ] == 0xff ) ? 160 : ( numArray[ num29, 1 ] + 160 );
2305 for( int num31 = 0; num31 < 8; num31++ )
2307 if( flagArray2[ num31 ] )
2309 if( num31 == ( num30 - 160 ) )
2311 builderArray2[ num31 ].Append( C変換.str数値を36進数2桁に変換して返す( numArray[ num29, 0 ] ) );
2315 builderArray2[ num31 ].Append( "00" );
2320 for( int num32 = 0; num32 < 8; num32++ )
2322 if( builderArray2[ num32 ].Length != 0 )
2324 sw.WriteLine( "#{0}{1}: {2}", C変換.str小節番号を文字列3桁に変換して返す( c小節.n小節番号0to3599 ), C変換.str数値を16進数2桁に変換して返す( 160 + num32 ), builderArray2[ num32 ].ToString() );
2329 private bool tDTX出力_全チップ_解像度をN分の1にできる( int N, ref int[ , ] arrチップ配列, int n現在の解像度 )
2331 if( ( n現在の解像度 % N ) != 0 )
2335 for( int i = 0; i < ( n現在の解像度 / N ); i++ )
2337 for( int j = 1; j < N; j++ )
2339 if( arrチップ配列[ ( i * N ) + j, 0 ] != 0 )
2348 #region [#23880 2010.12.30 yyagi: コンマとスペースの両方を小数点として扱うTryParse]
2350 /// 小数点としてコンマとピリオドの両方を受け付けるTryParse()
2352 /// <param name="s">strings convert to double</param>
2353 /// <param name="result">parsed double value</param>
2354 /// <returns>s が正常に変換された場合は true。それ以外の場合は false。</returns>
2355 /// <exception cref="ArgumentException">style が NumberStyles 値でないか、style に NumberStyles.AllowHexSpecifier 値が含まれている</exception>
2356 private bool TryParse(string s, out decimal result)
2357 { // #23880 2010.12.30 yyagi: alternative TryParse to permit both '.' and ',' for decimal point
2358 // EU諸国での #BPM 123,45 のような記述に対応するため、
2359 // 小数点の最終位置を検出して、それをlocaleにあった
2360 // 文字に置き換えてからTryParse()する
2363 const string DecimalSeparators = ".,"; // 小数点文字
2364 const string GroupSeparators = ".,' "; // 桁区切り文字
2365 const string NumberSymbols = "0123456789"; // 数値文字
2367 int len = s.Length; // 文字列長
2368 int decimalPosition = len; // 真の小数点の位置 最初は文字列終端位置に仮置きする
2370 for (int i = 0; i < len; i++)
2371 { // まず、真の小数点(一番最後に現れる小数点)の位置を求める
2373 if (NumberSymbols.IndexOf(c) >= 0)
2377 else if (DecimalSeparators.IndexOf(c) >= 0)
2378 { // 小数点文字だったら、その都度位置を上書き記憶
2379 decimalPosition = i;
2381 else if (GroupSeparators.IndexOf(c) >= 0)
2386 { // 数値・小数点・区切り文字以外がきたらループ終了
2391 StringBuilder decimalStr = new StringBuilder(16);
2392 for (int i = 0; i < len; i++)
2393 { // 次に、localeにあった数値文字列を生成する
2395 if (NumberSymbols.IndexOf(c) >= 0)
2397 decimalStr.Append(c); // そのままコピー
2399 else if (DecimalSeparators.IndexOf(c) >= 0)
2401 if (i == decimalPosition)
2402 { // 最後に出現した小数点文字なら、localeに合った小数点を出力する
2403 decimalStr.Append(CultureInfo.CurrentCulture.NumberFormat.NumberDecimalSeparator);
2406 else if (GroupSeparators.IndexOf(c) >= 0)
2408 continue; // 何もしない(スキップ)
2415 return decimal.TryParse(decimalStr.ToString(), out result); // 最後に、自分のlocale向けの文字列に対してTryParse実行