Develop and Download Open Source Software

Browse Subversion Repository

Annotation of /trunk/DTXManiaプロジェクト/コード/ステージ/05.選曲/CStage選曲.cs

Parent Directory Parent Directory | Revision Log Revision Log


Revision 276 - (hide annotations) (download)
Tue Jan 28 01:47:46 2014 UTC (10 years, 2 months ago) by ron1120
File size: 43508 byte(s)
#xxxxx オプションの追加により旧オプションパネルで不具合が出るため非表示にした。
1 kairera0467 2 using System;
2     using System.Collections.Generic;
3     using System.Text;
4     using System.Runtime.InteropServices;
5     using System.Drawing;
6     using System.Diagnostics;
7     using System.IO;
8 kairera0467 130 using DirectShowLib;
9 kairera0467 2 using FDK;
10    
11     namespace DTXMania
12     {
13     internal class CStage選曲 : CStage
14     {
15     // プロパティ
16     public int nスクロルバ相対y座標
17     {
18     get
19     {
20     if ( act曲リスト != null )
21     {
22     return act曲リスト.nスクロルバ相対y座標;
23     }
24     else
25     {
26     return 0;
27     }
28     }
29     }
30     public bool bIsEnumeratingSongs
31     {
32     get
33     {
34     return act曲リスト.bIsEnumeratingSongs;
35     }
36     set
37     {
38     act曲リスト.bIsEnumeratingSongs = value;
39     }
40     }
41     public bool bIsPlayingPremovie
42     {
43     get
44     {
45     return this.actPreimageパネル.bIsPlayingPremovie;
46     }
47     }
48     public bool bスクロル中
49     {
50     get
51     {
52     return this.act曲リスト.bスクロル中;
53     }
54     }
55     public int n確定された曲の難易度
56     {
57     get;
58     private set;
59     }
60     public Cスコア r確定されたスコア
61     {
62     get;
63     private set;
64     }
65     public C曲リストノ r確定された曲
66     {
67     get;
68     private set;
69     }
70     /// <summary>
71     /// <para>現在演奏中の曲のスコアに対応する背景動画。</para>
72     /// <para>r現在演奏中の曲のスコア の読み込み時に、自動検索・抽出・生成される。</para>
73     /// </summary>
74     public CDirectShow r現在演奏中のスコアの背景動画 = null;
75     public int n現在選択中の曲の難易度
76     {
77     get
78     {
79     return this.act曲リスト.n現在選択中の曲の現在の難易度レベル;
80     }
81     }
82     public Cスコア r現在選択中のスコア
83     {
84     get
85     {
86     return this.act曲リスト.r現在選択中のスコア;
87     }
88     }
89     public C曲リストノ r現在選択中の曲
90     {
91     get
92     {
93     return this.act曲リスト.r現在選択中の曲;
94     }
95     }
96    
97     // コンストラクタ
98     public CStage選曲()
99     {
100     base.eステID = CStage.Eステ.選曲;
101     base.eフェID = CStage.Eフェ.共通_通常状態;
102     base.b活性化してない = true;
103 ron1120 276 // base.list子Activities.Add( this.actオプションパネル = new CActオプションパネル() );
104 kairera0467 2 base.listActivities.Add( this.actFIFO = new CActFIFOBlack() );
105     base.listActivities.Add( this.actFIfrom結果画面 = new CActFIFOBlack() );
106     // base.list子Activities.Add( this.actFOtoNowLoading = new CActFIFOBlack() ); // #27787 2012.3.10 yyagi 曲決定時の画面フェードアウトの省略
107     base.listActivities.Add( this.act曲リスト = new CActSelect曲リスト() );
108     base.listActivities.Add( this.actステタスパネル = new CActSelectステタスパネル() );
109     base.listActivities.Add( this.act演奏履歴パネル = new CActSelect演奏履歴パネル() );
110     base.listActivities.Add( this.actPreimageパネル = new CActSelectPreimageパネル() );
111     base.listActivities.Add( this.actPresound = new CActSelectPresound() );
112     base.listActivities.Add( this.actArtistComment = new CActSelectArtistComment() );
113     base.listActivities.Add( this.actInformation = new CActSelectInformation() );
114     base.listActivities.Add( this.actSortSongs = new CActSortSongs() );
115     base.listActivities.Add( this.actShowCurrentPosition = new CActSelectShowCurrentPosition() );
116     base.listActivities.Add( this.actQuickConfig = new CActSelectQuickConfig() );
117    
118     this.CommandHistory = new CCommandHistory(); // #24063 2011.1.16 yyagi
119     }
120    
121    
122     // メソッド
123    
124     public void t選択曲変更通知()
125     {
126     this.actPreimageパネル.t選択曲が変更された();
127     this.actPresound.t選択曲が変更された();
128     this.act演奏履歴パネル.t選択曲が変更された();
129     this.actステタスパネル.t選択曲が変更された();
130     this.actArtistComment.t選択曲が変更された();
131    
132     #region [ プラグインにも通知する(BOX, RANDOM, BACK なら通知しない)]
133     //---------------------
134     if( CDTXMania.app != null )
135     {
136     var c曲リストノ = CDTXMania.stage選曲.r現在選択中の曲;
137     var cスコア = CDTXMania.stage選曲.r現在選択中のスコア;
138    
139     if( c曲リストノ != null && cスコア != null && c曲リストノ.eド種別 == C曲リストノ.Eド種別.SCORE )
140     {
141     string str選択曲ファイル名 = cスコア.ファイル情報.ファイルの絶対パス;
142     CSetDef setDef = null;
143     int nブロック番号inSetDef = -1;
144     int n曲番号inブロック = -1;
145    
146     if( !string.IsNullOrEmpty( c曲リストノ.pathSetDefの絶対パス ) && File.Exists( c曲リストノ.pathSetDefの絶対パス ) )
147     {
148     setDef = new CSetDef( c曲リストノ.pathSetDefの絶対パス );
149     nブロック番号inSetDef = c曲リストノ.SetDefのブロック番号;
150     n曲番号inブロック = CDTXMania.stage選曲.act曲リスト.n現在のアンカ難易度レベルに最も近い難易度レベルを返す( c曲リストノ );
151     }
152    
153     foreach( CDTXMania.STPlugin stPlugin in CDTXMania.app.listプラグイン )
154     {
155     Directory.SetCurrentDirectory( stPlugin.strプラグインフォルダ );
156     stPlugin.plugin.On選択曲変更( str選択曲ファイル名, setDef, nブロック番号inSetDef, n曲番号inブロック );
157     Directory.SetCurrentDirectory( CDTXMania.strEXEのあるフォルダ );
158     }
159     }
160     }
161     //---------------------
162     #endregion
163     }
164    
165     // CStage 実装
166    
167     /// <summary>
168     /// 曲リストをリセットする
169     /// </summary>
170     /// <param name="cs"></param>
171     public void Refresh( CSongs管理 cs, bool bRemakeSongTitleBar)
172     {
173     this.act曲リスト.Refresh( cs, bRemakeSongTitleBar );
174     }
175    
176     public override void On活性化()
177     {
178     Trace.TraceInformation( "選曲ステージを活性化します。" );
179     Trace.Indent();
180     try
181     {
182     this.eフェドアウト完了時の戻り値 = E戻り値.継続;
183     this.bBGM再生済み = false;
184     this.ftフォント = new Font( "MS PGothic", 26f, GraphicsUnit.Pixel );
185     for( int i = 0; i < 4; i++ )
186     this.ct反復用[ i ] = new CCounter( 0, 0, 0, CDTXMania.Timer );
187    
188     base.On活性化();
189    
190     this.actステタスパネル.t選択曲が変更された(); // 最大ランクを更新
191     }
192     finally
193     {
194     Trace.TraceInformation( "選曲ステージの活性化を完了しました。" );
195     Trace.Unindent();
196     }
197     }
198     public override void On非活性化()
199     {
200     Trace.TraceInformation( "選曲ステージを非活性化します。" );
201     Trace.Indent();
202     try
203     {
204     if( this.ftフォント != null )
205     {
206     this.ftフォント.Dispose();
207     this.ftフォント = null;
208     }
209     for( int i = 0; i < 4; i++ )
210     {
211     this.ct反復用[ i ] = null;
212     }
213     base.On非活性化();
214     }
215     finally
216     {
217     Trace.TraceInformation( "選曲ステージの非活性化を完了しました。" );
218     Trace.Unindent();
219     }
220     }
221     public override void OnManagedリソスの作成()
222     {
223     if( !base.b活性化してない )
224     {
225     this.tx背景 = CDTXMania.tテクスチャの生成( CSkin.Path( @"Graphics\5_background.jpg" ), false );
226 kairera0467 186 if( File.Exists (CSkin.Path(@"Graphics\5_background.mp4")))
227 kairera0467 130 {
228     this.ds背景動画 = CDTXMania.t失敗してもスキップ可能なDirectShowを生成する( CSkin.Path(@"Graphics\5_background.mp4"), CDTXMania.app.WindowHandle, true );
229     }
230 kairera0467 186 this.tx上部パネル = CDTXMania.tテクスチャの生成( CSkin.Path( @"Graphics\5_header panel.png" ), false );
231 kairera0467 2 this.tx下部パネル = CDTXMania.tテクスチャの生成( CSkin.Path( @"Graphics\5_footer panel.png" ), false );
232     this.txコメントバ = CDTXMania.tテクスチャの生成( CSkin.Path( @"Graphics\5_comment bar.png" ), true );
233 ron1120 218 // this.txFLIP = CDTXMania.tテクスチャの生成( CSkin.Path( @"Graphics\5_skill number on gauge etc.png" ), false );
234 kairera0467 2 base.OnManagedリソスの作成();
235     }
236     }
237     public override void OnManagedリソスの解放()
238     {
239     if( !base.b活性化してない )
240     {
241 kairera0467 186 CDTXMania.t安全にDisposeする( ref this.ds背景動画 );
242 kairera0467 2 CDTXMania.tテクスチャの解放( ref this.tx背景 );
243     CDTXMania.tテクスチャの解放( ref this.tx上部パネル );
244     CDTXMania.tテクスチャの解放( ref this.tx下部パネル );
245     CDTXMania.tテクスチャの解放( ref this.txコメントバ );
246 ron1120 218 // CDTXMania.tテクスチャの解放( ref this.txFLIP );
247 kairera0467 2 base.OnManagedリソスの解放();
248     }
249     }
250     public override int On進行描画()
251     {
252     if( !base.b活性化してない )
253     {
254     #region [ 初めての進行描画 ]
255     //---------------------
256     if( base.b初めての進行描画 )
257     {
258 kairera0467 186 this.ct登場時アニメ用共通 = new CCounter( 0, 100, 4, CDTXMania.Timer );
259 kairera0467 2 if( CDTXMania.r直前のステ == CDTXMania.stage結果 )
260     {
261     this.actFIfrom結果画面.tフェドイン開始();
262     base.eフェID = CStage.Eフェ.選曲_結果画面からのフェドイン;
263     }
264     else
265     {
266     this.actFIFO.tフェドイン開始();
267     base.eフェID = CStage.Eフェ.共通_フェドイン;
268     }
269 kairera0467 186 CDTXMania.Skin.soundSelectMusic.t再生する();
270 kairera0467 2 this.t選択曲変更通知();
271     base.b初めての進行描画 = false;
272     }
273     //---------------------
274     #endregion
275    
276     this.ct登場時アニメ用共通.t進行();
277    
278 kairera0467 186 if( this.ds背景動画 != null )
279 kairera0467 130 {
280     this.ds背景動画.t現時点における最新のスナップイメジをTextureに転写する( this.tx背景 );
281     this.ds背景動画.t再生開始();
282     this.ds背景動画.MediaSeeking.GetPositions(out this.lDshowPosition, out this.lStopPosition);
283     if (this.lDshowPosition == this.lStopPosition)
284     {
285     this.ds背景動画.MediaSeeking.SetPositions(
286     DsLong.FromInt64((long)(0)),
287     AMSeekingSeekingFlags.AbsolutePositioning,
288     0,
289     AMSeekingSeekingFlags.NoPositioning);
290     }
291     }
292 kairera0467 186
293 kairera0467 2 if( this.tx背景 != null )
294 kairera0467 175 {
295 kairera0467 184 if( this.ds背景動画 != null && this.ds背景動画.b上下反転 )
296 kairera0467 175 this.tx背景.t2D上下反転描画( CDTXMania.app.Device, 0, 0 );
297     else
298     this.tx背景.t2D描画( CDTXMania.app.Device, 0, 0 );
299     }
300 kairera0467 2
301 kairera0467 186 // this.actPreimageパネル.On進行描画();
302 kairera0467 2 // this.bIsEnumeratingSongs = !this.actPreimageパネル.bIsPlayingPremovie; // #27060 2011.3.2 yyagi: #PREMOVIE再生中は曲検索を中断する
303    
304     this.act曲リスト.On進行描画();
305     int y = 0;
306     if( this.ct登場時アニメ用共通.b進行中 )
307     {
308     double db登場割合 = ( (double) this.ct登場時アニメ用共通.n現在の値 ) / 100.0; // 100が最終値
309     double dbY表示割合 = Math.Sin( Math.PI / 2 * db登場割合 );
310     y = ( (int) ( this.tx上部パネル.sz画像サイズ.Height * dbY表示割合 ) ) - this.tx上部パネル.sz画像サイズ.Height;
311     }
312     if( this.tx上部パネル != null )
313 kairera0467 186 {
314     this.tx上部パネル.t2D描画( CDTXMania.app.Device, 0f, 78.0f - ( this.ct登場時アニメ用共通.n現在の値 * 0.61f ) , new Rectangle(0, 17, 200, 55 ) );
315     this.tx上部パネル.t2D描画( CDTXMania.app.Device, 0f, 24.0f + ( this.ct登場時アニメ用共通.n現在の値 * 0.57f ) , new Rectangle(0, 81, 200, 55 ) );
316     this.tx上部パネル.t2D描画( CDTXMania.app.Device, 0f, 150.0f, new Rectangle(0, 150, 200, 12 ) );
317     this.tx上部パネル.t2D描画( CDTXMania.app.Device, 0f, 143.0f, new Rectangle(0, 143, 200, 3 ) );
318     }
319 kairera0467 2
320 ron1120 212 this.actInformation.On進行描画();
321 kairera0467 2 if( this.tx下部パネル != null )
322     this.tx下部パネル.t2D描画( CDTXMania.app.Device, 0, 720 - this.tx下部パネル.sz画像サイズ.Height );
323    
324     this.actステタスパネル.On進行描画();
325 kairera0467 186 if( CDTXMania.ConfigIni.bDrums有効 )
326     {
327     this.act演奏履歴パネル.On進行描画();
328     }
329 kairera0467 2 this.actPresound.On進行描画();
330     if( this.txコメントバ != null )
331     {
332 kairera0467 186 // this.txコメントバー.t2D描画(CDTXMania.app.Device, 484, 342);
333 kairera0467 2 }
334 ron1120 212 this.actArtistComment.On進行描画();
335 kairera0467 186 //this.actオプションパネル.On進行描画();
336 ron1120 218 /*
337 kairera0467 2 if ( this.txFLIP != null && CDTXMania.ConfigIni.bIsSwappedGuitarBass ) // #24063 2011.1.16 yyagi
338     {
339     Rectangle rect = new Rectangle(0x1f, 0x31, 20, 11);
340     this.txFLIP.t2D描画( CDTXMania.app.Device, 80, 654, rect );
341     }
342 ron1120 218 */
343 kairera0467 2 this.actShowCurrentPosition.On進行描画(); // #27648 2011.3.28 yyagi
344    
345     switch ( base.eフェID )
346     {
347     case CStage.Eフェ.共通_フェドイン:
348     if( this.actFIFO.On進行描画() != 0 )
349     {
350     base.eフェID = CStage.Eフェ.共通_通常状態;
351     }
352     break;
353    
354     case CStage.Eフェ.共通_フェドアウト:
355     if( this.actFIFO.On進行描画() == 0 )
356     {
357     break;
358     }
359     return (int) this.eフェドアウト完了時の戻り値;
360    
361     case CStage.Eフェ.選曲_結果画面からのフェドイン:
362     if( this.actFIfrom結果画面.On進行描画() != 0 )
363     {
364     base.eフェID = CStage.Eフェ.共通_通常状態;
365     }
366     break;
367    
368     case CStage.Eフェ.選曲_NowLoading画面へのフェドアウト:
369     // if( this.actFOtoNowLoading.On進行描画() == 0 )
370     // {
371     // break;
372     // }
373     return (int) this.eフェドアウト完了時の戻り値;
374     }
375     if( !this.bBGM再生済み && ( base.eフェID == CStage.Eフェ.共通_通常状態 ) )
376     {
377     CDTXMania.Skin.bgm選曲画面.n音量・次に鳴るサウンド = 100;
378     CDTXMania.Skin.bgm選曲画面.t再生する();
379     this.bBGM再生済み = true;
380     }
381    
382    
383     //Debug.WriteLine( "パンくず=" + this.r現在選択中の曲.strBreadcrumbs );
384    
385    
386     // キー入力
387     if( base.eフェID == CStage.Eフェ.共通_通常状態
388     && CDTXMania.act現在入力を占有中のプラグイン == null )
389     {
390     #region [ 簡易CONFIGでMore、またはShift+F1: 詳細CONFIG呼び出し ]
391     if ( actQuickConfig.bGotoDetailConfig )
392     { // 詳細CONFIG呼び出し
393     actQuickConfig.tDeativatePopupMenu();
394     this.actPresound.tサウンド停止();
395     this.eフェドアウト完了時の戻り値 = E戻り値.コンフィグ呼び出し; // #24525 2011.3.16 yyagi: [SHIFT]-[F1]でCONFIG呼び出し
396     this.actFIFO.tフェドアウト開始();
397     base.eフェID = CStage.Eフェ.共通_フェドアウト;
398     CDTXMania.Skin.sound取消音.t再生する();
399     return 0;
400     }
401     #endregion
402     if ( !this.actSortSongs.bIsActivePopupMenu && !this.actQuickConfig.bIsActivePopupMenu )
403     {
404     #region [ ESC ]
405     if ( CDTXMania.Input管理.Keyboard.bが押された( (int) SlimDX.DirectInput.Key.Escape ) || ( ( CDTXMania.Pad.b押された( E楽器パ.DRUMS, Eパッド.LC ) || CDTXMania.Pad.b押されたGB( Eパッド.Cancel ) ) && ( ( this.act曲リスト.r現在選択中の曲 != null ) && ( this.act曲リスト.r現在選択中の曲.r親ノ == null ) ) ) )
406     { // [ESC]
407     CDTXMania.Skin.sound取消音.t再生する();
408     this.eフェドアウト完了時の戻り値 = E戻り値.タイトルに戻る;
409     this.actFIFO.tフェドアウト開始();
410     base.eフェID = CStage.Eフェ.共通_フェドアウト;
411     return 0;
412     }
413     #endregion
414     #region [ Shift-F1: CONFIG画面 ]
415     if ( ( CDTXMania.Input管理.Keyboard.bが押されている( (int) SlimDX.DirectInput.Key.RightShift ) || CDTXMania.Input管理.Keyboard.bが押されている( (int) SlimDX.DirectInput.Key.LeftShift ) ) &&
416     CDTXMania.Input管理.Keyboard.bが押された( (int) SlimDX.DirectInput.Key.F1 ) )
417     { // [SHIFT] + [F1] CONFIG
418     this.actPresound.tサウンド停止();
419     this.eフェドアウト完了時の戻り値 = E戻り値.コンフィグ呼び出し; // #24525 2011.3.16 yyagi: [SHIFT]-[F1]でCONFIG呼び出し
420     this.actFIFO.tフェドアウト開始();
421     base.eフェID = CStage.Eフェ.共通_フェドアウト;
422     CDTXMania.Skin.sound取消音.t再生する();
423     return 0;
424     }
425     #endregion
426     #region [ Shift-F2: 未使用 ]
427     // #24525 2011.3.16 yyagi: [SHIFT]+[F2]は廃止(将来発生するかもしれない別用途のためにキープ)
428     /*
429     if ((CDTXMania.Input管理.Keyboard.bキーが押されている((int)SlimDX.DirectInput.Key.RightShift) || CDTXMania.Input管理.Keyboard.bキーが押されている((int)SlimDX.DirectInput.Key.LeftShift)) &&
430     CDTXMania.Input管理.Keyboard.bキーが押された((int)SlimDX.DirectInput.Key.F2))
431     { // [SHIFT] + [F2] CONFIGURATION
432     this.actPresound.tサウンド停止();
433     this.eフェードアウト完了時の戻り値 = E戻り値.オプション呼び出し;
434     this.actFIFO.tフェードアウト開始();
435     base.eフェーズID = CStage.Eフェーズ.共通_フェードアウト;
436     CDTXMania.Skin.sound取消音.t再生する();
437     return 0;
438     }
439     */
440     #endregion
441     if ( this.act曲リスト.r現在選択中の曲 != null )
442     {
443     #region [ Decide ]
444 kairera0467 63 if ( ( CDTXMania.Pad.b押されたDGB( Eパッド.Decide ) || CDTXMania.Pad.b押された( E楽器パ.DRUMS, Eパッド.CY ) || CDTXMania.Pad.b押された( E楽器パ.DRUMS, Eパッド.RD ) ) ||
445 kairera0467 2 ( CDTXMania.ConfigIni.bEnterがキ割り当てのどこにも使用されていない && CDTXMania.Input管理.Keyboard.bが押された( (int) SlimDX.DirectInput.Key.Return ) ) )
446     {
447     if ( this.act曲リスト.r現在選択中の曲 != null )
448     {
449     switch ( this.act曲リスト.r現在選択中の曲.eド種別 )
450     {
451     case C曲リストノ.Eド種別.SCORE:
452     CDTXMania.Skin.sound決定音.t再生する();
453     this.t曲を選択する();
454     break;
455    
456     case C曲リストノ.Eド種別.SCORE_MIDI:
457     CDTXMania.Skin.sound決定音.t再生する();
458     this.t曲を選択する();
459     break;
460    
461     case C曲リストノ.Eド種別.BOX:
462     {
463     CDTXMania.Skin.sound決定音.t再生する();
464     bool bNeedChangeSkin = this.act曲リスト.tBOXに入る();
465     if ( bNeedChangeSkin )
466     {
467     this.eフェドアウト完了時の戻り値 = E戻り値.スキン変更;
468     base.eフェID = Eフェ.選曲_NowLoading画面へのフェドアウト;
469     }
470     }
471     break;
472    
473     case C曲リストノ.Eド種別.BACKBOX:
474     {
475     CDTXMania.Skin.sound取消音.t再生する();
476     bool bNeedChangeSkin = this.act曲リスト.tBOXを出る();
477     if ( bNeedChangeSkin )
478     {
479     this.eフェドアウト完了時の戻り値 = E戻り値.スキン変更;
480     base.eフェID = Eフェ.選曲_NowLoading画面へのフェドアウト;
481     }
482     }
483     break;
484    
485     case C曲リストノ.Eド種別.RANDOM:
486     CDTXMania.Skin.sound決定音.t再生する();
487     this.t曲をランダム選択する();
488     break;
489     }
490     }
491     }
492     #endregion
493     #region [ Up ]
494 kairera0467 186 this.ct反復用.Up.t反復( CDTXMania.Input管理.Keyboard.bが押されている( (int) SlimDX.DirectInput.Key.LeftArrow ), new CCounter.DG処理( this.tソルを上へ移動する ) );
495 kairera0467 2 this.ct反復用.R.t反復( CDTXMania.Pad.b押されているGB( Eパッド.R ), new CCounter.DG処理( this.tソルを上へ移動する ) );
496     if ( CDTXMania.Pad.b押された( E楽器パ.DRUMS, Eパッド.SD ) )
497     {
498     this.tソルを上へ移動する();
499     }
500     #endregion
501     #region [ Down ]
502 kairera0467 186 this.ct反復用.Down.t反復( CDTXMania.Input管理.Keyboard.bが押されている( (int) SlimDX.DirectInput.Key.RightArrow ), new CCounter.DG処理( this.tソルを下へ移動する ) );
503 kairera0467 199 this.ct反復用.B.t反復( CDTXMania.Pad.b押されているGB( Eパッド.G ), new CCounter.DG処理( this.tソルを下へ移動する ) );
504 kairera0467 2 if ( CDTXMania.Pad.b押された( E楽器パ.DRUMS, Eパッド.FT ) )
505     {
506     this.tソルを下へ移動する();
507     }
508     #endregion
509     #region [ Upstairs ]
510     if ( ( ( this.act曲リスト.r現在選択中の曲 != null ) && ( this.act曲リスト.r現在選択中の曲.r親ノ != null ) ) && ( CDTXMania.Pad.b押された( E楽器パ.DRUMS, Eパッド.LC ) || CDTXMania.Pad.b押されたGB( Eパッド.Cancel ) ) )
511     {
512     this.actPresound.tサウンド停止();
513     CDTXMania.Skin.sound取消音.t再生する();
514     this.act曲リスト.tBOXを出る();
515     this.t選択曲変更通知();
516     }
517     #endregion
518     #region [ BDx2: 簡易CONFIG ]
519     if ( CDTXMania.Pad.b押された( E楽器パ.DRUMS, Eパッド.BD ) )
520     { // [BD]x2 スクロール速度変更
521     CommandHistory.Add( E楽器パ.DRUMS, EパッドFlag.BD );
522     EパッドFlag[] comChangeScrollSpeed = new EパッドFlag[] { EパッドFlag.BD, EパッドFlag.BD };
523     if ( CommandHistory.CheckCommand( comChangeScrollSpeed, E楽器パ.DRUMS ) )
524     {
525     // Debug.WriteLine( "ドラムススクロール速度変更" );
526     // CDTXMania.ConfigIni.n譜面スクロール速度.Drums = ( CDTXMania.ConfigIni.n譜面スクロール速度.Drums + 1 ) % 0x10;
527     CDTXMania.Skin.sound変更音.t再生する();
528     this.actQuickConfig.tActivatePopupMenu( E楽器パ.DRUMS );
529     }
530     }
531     #endregion
532     #region [ HHx2: 難易度変更 ]
533     if ( CDTXMania.Pad.b押された( E楽器パ.DRUMS, Eパッド.HH ) || CDTXMania.Pad.b押された( E楽器パ.DRUMS, Eパッド.HHO ) )
534     { // [HH]x2 難易度変更
535     CommandHistory.Add( E楽器パ.DRUMS, EパッドFlag.HH );
536     EパッドFlag[] comChangeDifficulty = new EパッドFlag[] { EパッドFlag.HH, EパッドFlag.HH };
537     if ( CommandHistory.CheckCommand( comChangeDifficulty, E楽器パ.DRUMS ) )
538     {
539     Debug.WriteLine( "ドラムス難易度変更" );
540     this.act曲リスト.t難易度レベルをひとつ進める();
541 kairera0467 186 //CDTXMania.Skin.sound変更音.t再生する();
542 kairera0467 2 }
543     }
544     #endregion
545 kairera0467 201 #region [ Px2 Guitar: 簡易CONFIG ]
546 kairera0467 199 if ( CDTXMania.Pad.b押された( E楽器パ.GUITAR, Eパッド.P ) )
547     { // [BD]x2 スクロール速度変更
548     CommandHistory.Add( E楽器パ.GUITAR, EパッドFlag.P );
549     EパッドFlag[] comChangeScrollSpeed = new EパッドFlag[] { EパッドFlag.P, EパッドFlag.P };
550     if ( CommandHistory.CheckCommand( comChangeScrollSpeed, E楽器パ.GUITAR ) )
551     {
552     // Debug.WriteLine( "ドラムススクロール速度変更" );
553     // CDTXMania.ConfigIni.n譜面スクロール速度.Drums = ( CDTXMania.ConfigIni.n譜面スクロール速度.Drums + 1 ) % 0x10;
554     CDTXMania.Skin.sound変更音.t再生する();
555     this.actQuickConfig.tActivatePopupMenu( E楽器パ.GUITAR );
556     }
557     }
558     #endregion
559 kairera0467 201 #region [ Px2 Bass: 簡易CONFIG ]
560     if ( CDTXMania.Pad.b押された( E楽器パ.BASS, Eパッド.P ) )
561     { // [BD]x2 スクロール速度変更
562     CommandHistory.Add( E楽器パ.BASS, EパッドFlag.P );
563     EパッドFlag[] comChangeScrollSpeed = new EパッドFlag[] { EパッドFlag.P, EパッドFlag.P };
564 kairera0467 203 if ( CommandHistory.CheckCommand( comChangeScrollSpeed, E楽器パ.BASS ) )
565 kairera0467 201 {
566     // Debug.WriteLine( "ドラムススクロール速度変更" );
567     // CDTXMania.ConfigIni.n譜面スクロール速度.Drums = ( CDTXMania.ConfigIni.n譜面スクロール速度.Drums + 1 ) % 0x10;
568     CDTXMania.Skin.sound変更音.t再生する();
569     this.actQuickConfig.tActivatePopupMenu( E楽器パ.BASS );
570     }
571     }
572     #endregion
573 kairera0467 199 #region [ Bx2 Guitar: 難易度変更 ]
574 kairera0467 201 if ( CDTXMania.Pad.b押された( E楽器パ.GUITAR, Eパッド.B ) ) // #24177 2011.1.17 yyagi || -> &&
575 kairera0467 199 { // [B]x2 ギター難易度変更
576     CommandHistory.Add( E楽器パ.GUITAR, EパッドFlag.B );
577 kairera0467 201 EパッドFlag[] comChangeDifficultyG = new EパッドFlag[] { EパッドFlag.B, EパッドFlag.B };
578     if ( CommandHistory.CheckCommand( comChangeDifficultyG, E楽器パ.GUITAR ) )
579 kairera0467 2 {
580     Debug.WriteLine( "ギター難易度変更" );
581     this.act曲リスト.t難易度レベルをひとつ進める();
582 kairera0467 199 //CDTXMania.Skin.sound変更音.t再生する();
583 kairera0467 2 }
584     }
585     #endregion
586 kairera0467 199 #region [ Bx2 Bass: 難易度変更 ]
587 kairera0467 201 if ( CDTXMania.Pad.b押された( E楽器パ.BASS, Eパッド.B ) ) // #24177 2011.1.17 yyagi || -> &&
588 kairera0467 199 { // [B]x2 ベース難易度変更
589     CommandHistory.Add( E楽器パ.BASS, EパッドFlag.B );
590 kairera0467 201 EパッドFlag[] comChangeDifficultyB = new EパッドFlag[] { EパッドFlag.B, EパッドFlag.B };
591     if ( CommandHistory.CheckCommand( comChangeDifficultyB, E楽器パ.BASS ) )
592 kairera0467 2 {
593     Debug.WriteLine( "ベース難易度変更" );
594     this.act曲リスト.t難易度レベルをひとつ進める();
595 kairera0467 199 //CDTXMania.Skin.sound変更音.t再生する();
596 kairera0467 2 }
597     }
598     #endregion
599 kairera0467 201 #region [ Y Y Guitar: ギターとベースを入れ替え ]
600     if ( CDTXMania.Pad.b押された( E楽器パ.GUITAR, Eパッド.Y ) )
601     { // Pick, Y, Y, Pick で、ギターとベースを入れ替え
602     CommandHistory.Add( E楽器パ.GUITAR, EパッドFlag.Y );
603     EパッドFlag[] comSwapGtBs1 = new EパッドFlag[] { EパッドFlag.Y, EパッドFlag.Y };
604 kairera0467 2 if ( CommandHistory.CheckCommand( comSwapGtBs1, E楽器パ.GUITAR ) )
605     {
606     Debug.WriteLine( "ギターとベースの入れ替え1" );
607     CDTXMania.Skin.sound変更音.t再生する();
608     // ギターとベースのキーを入れ替え
609     //CDTXMania.ConfigIni.SwapGuitarBassKeyAssign();
610     CDTXMania.ConfigIni.bIsSwappedGuitarBass = !CDTXMania.ConfigIni.bIsSwappedGuitarBass;
611     }
612     }
613     #endregion
614 kairera0467 201 #region [ Y Y Bass: ギターとベースを入れ替え ]
615     if ( CDTXMania.Pad.b押された( E楽器パ.BASS, Eパッド.Y ) )
616 kairera0467 2 { // ベース[Pick]: コマンドとしてEnqueue
617 kairera0467 201 CommandHistory.Add( E楽器パ.BASS, EパッドFlag.Y );
618 kairera0467 199 // Pick, Y, Y, Pick で、ギターとベースを入れ替え
619 kairera0467 201 EパッドFlag[] comSwapGtBs1 = new EパッドFlag[] { EパッドFlag.Y, EパッドFlag.Y };
620 kairera0467 2 if ( CommandHistory.CheckCommand( comSwapGtBs1, E楽器パ.BASS ) )
621     {
622     Debug.WriteLine( "ギターとベースの入れ替え2" );
623     CDTXMania.Skin.sound変更音.t再生する();
624     // ギターとベースのキーを入れ替え
625     //CDTXMania.ConfigIni.SwapGuitarBassKeyAssign();
626     CDTXMania.ConfigIni.bIsSwappedGuitarBass = !CDTXMania.ConfigIni.bIsSwappedGuitarBass;
627     }
628     }
629     #endregion
630 kairera0467 201 #region [ Pick x2 Guitar: ソート画面 ]
631     if ( CDTXMania.Pad.b押された( E楽器パ.GUITAR, Eパッド.Pick ) )
632     { // ギター[Pick]: コマンドとしてEnqueue
633     CommandHistory.Add( E楽器パ.GUITAR, EパッドFlag.Pick );
634     // ギター Pick x2 で、ソート画面に遷移
635     EパッドFlag[] comSortGt = new EパッドFlag[] { EパッドFlag.Pick, EパッドFlag.Pick };
636 kairera0467 2 if ( CommandHistory.CheckCommand( comSortGt, E楽器パ.GUITAR ) )
637     {
638     CDTXMania.Skin.sound変更音.t再生する();
639     this.actSortSongs.tActivatePopupMenu( E楽器パ.GUITAR, ref this.act曲リスト );
640     }
641     }
642     #endregion
643 kairera0467 201 #region [ Pick x2 Bass: ソート画面 ]
644     if ( CDTXMania.Pad.b押された( E楽器パ.BASS, Eパッド.Pick ) )
645     { // ベース[Pick]: コマンドとしてEnqueue
646     CommandHistory.Add( E楽器パ.BASS, EパッドFlag.Pick );
647     // ベース Pick x2 で、ソート画面に遷移
648     EパッドFlag[] comSortBs = new EパッドFlag[] { EパッドFlag.Pick, EパッドFlag.Pick };
649 kairera0467 2 if ( CommandHistory.CheckCommand( comSortBs, E楽器パ.BASS ) )
650     {
651     CDTXMania.Skin.sound変更音.t再生する();
652     this.actSortSongs.tActivatePopupMenu( E楽器パ.BASS, ref this.act曲リスト );
653     }
654     }
655     #endregion
656 kairera0467 205 #region [ HT HT Drums: ソート画面 ]
657     if ( CDTXMania.Pad.b押された( E楽器パ.DRUMS, Eパッド.HT ) )
658     { // [HT]x2 ソート画面 2013.12.31.kairera0467
659 kairera0467 2 //
660 kairera0467 205 CommandHistory.Add( E楽器パ.DRUMS, EパッドFlag.HT );
661     EパッドFlag[] comSort = new EパッドFlag[] { EパッドFlag.HT, EパッドFlag.HT };
662     if ( CommandHistory.CheckCommand( comSort, E楽器パ.DRUMS ) )
663 kairera0467 2 {
664     CDTXMania.Skin.sound変更音.t再生する();
665     this.actSortSongs.tActivatePopupMenu( E楽器パ.DRUMS, ref this.act曲リスト );
666     }
667     }
668     #endregion
669     }
670     }
671     this.actSortSongs.t進行描画();
672     this.actQuickConfig.t進行描画();
673     }
674     }
675     return 0;
676     }
677     public enum E戻り値 : int
678     {
679     継続,
680     タイトルに戻る,
681     選曲した,
682     オプション呼び出し,
683     コンフィグ呼び出し,
684     スキン変更
685     }
686    
687    
688     // その他
689    
690     #region [ private ]
691     //-----------------
692     [StructLayout( LayoutKind.Sequential )]
693     private struct ST反復用カウンタ
694     {
695     public CCounter Up;
696     public CCounter Down;
697     public CCounter R;
698     public CCounter B;
699     public CCounter this[ int index ]
700     {
701     get
702     {
703     switch( index )
704     {
705     case 0:
706     return this.Up;
707    
708     case 1:
709     return this.Down;
710    
711     case 2:
712     return this.R;
713    
714     case 3:
715     return this.B;
716     }
717     throw new IndexOutOfRangeException();
718     }
719     set
720     {
721     switch( index )
722     {
723     case 0:
724     this.Up = value;
725     return;
726    
727     case 1:
728     this.Down = value;
729     return;
730    
731     case 2:
732     this.R = value;
733     return;
734    
735     case 3:
736     this.B = value;
737     return;
738     }
739     throw new IndexOutOfRangeException();
740     }
741     }
742     }
743     private CActSelectArtistComment actArtistComment;
744     private CActFIFOBlack actFIFO;
745     private CActFIFOBlack actFIfrom結果画面;
746     // private CActFIFOBlack actFOtoNowLoading; // #27787 2012.3.10 yyagi 曲決定時の画面フェードアウトの省略
747     private CActSelectInformation actInformation;
748     private CActSelectPreimageパネル actPreimageパネル;
749     private CActSelectPresound actPresound;
750 ron1120 276 // private CActオプションパネル actオプションパネル;
751 kairera0467 2 public CActSelectステタスパネル actステタスパネル;
752     private CActSelect演奏履歴パネル act演奏履歴パネル;
753 kairera0467 186 public CActSelect曲リスト act曲リスト;
754 kairera0467 2 private CActSelectShowCurrentPosition actShowCurrentPosition;
755    
756     private CActSortSongs actSortSongs;
757     private CActSelectQuickConfig actQuickConfig;
758    
759     private bool bBGM再生済み;
760     private ST反復用カウンタ ct反復用;
761 kairera0467 186 public CCounter ct登場時アニメ用共通;
762 kairera0467 2 private E戻り値 eフェドアウト完了時の戻り値;
763     private Font ftフォント;
764     private CTexture txコメントバ;
765     private CTexture tx下部パネル;
766     private CTexture tx上部パネル;
767     private CTexture tx背景;
768 ron1120 218 // private CTexture txFLIP;
769 kairera0467 130 private CDirectShow ds背景動画;
770     private long lDshowPosition;
771     private long lStopPosition;
772 kairera0467 2
773     private struct STCommandTime // #24063 2011.1.16 yyagi コマンド入力時刻の記録用
774     {
775     public E楽器パ eInst; // 使用楽器
776     public EパッドFlag ePad; // 押されたコマンド(同時押しはOR演算で列挙する)
777     public long time; // コマンド入力時刻
778     }
779 kairera0467 101 public class CCommandHistory // #24063 2011.1.16 yyagi コマンド入力履歴を保持・確認するクラス
780 kairera0467 2 {
781     readonly int buffersize = 16;
782     private List<STCommandTime> stct;
783    
784     public CCommandHistory() // コンストラクタ
785     {
786     stct = new List<STCommandTime>( buffersize );
787     }
788    
789     /// <summary>
790     /// コマンド入力履歴へのコマンド追加
791     /// </summary>
792     /// <param name="_eInst">楽器の種類</param>
793     /// <param name="_ePad">入力コマンド(同時押しはOR演算で列挙すること)</param>
794     public void Add( E楽器パ _eInst, EパッドFlag _ePad )
795     {
796     STCommandTime _stct = new STCommandTime {
797     eInst = _eInst,
798     ePad = _ePad,
799     time = CDTXMania.Timer.n現在時刻
800     };
801    
802     if ( stct.Count >= buffersize )
803     {
804     stct.RemoveAt( 0 );
805     }
806     stct.Add(_stct);
807     //Debug.WriteLine( "CMDHIS: 楽器=" + _stct.eInst + ", CMD=" + _stct.ePad + ", time=" + _stct.time );
808     }
809     public void RemoveAt( int index )
810     {
811     stct.RemoveAt( index );
812     }
813    
814     /// <summary>
815     /// コマンド入力に成功しているか調べる
816     /// </summary>
817     /// <param name="_ePad">入力が成功したか調べたいコマンド</param>
818     /// <param name="_eInst">対象楽器</param>
819     /// <returns>コマンド入力成功時true</returns>
820     public bool CheckCommand( EパッドFlag[] _ePad, E楽器パ _eInst)
821     {
822     int targetCount = _ePad.Length;
823     int stciCount = stct.Count;
824     if ( stciCount < targetCount )
825     {
826     //Debug.WriteLine("NOT start checking...stciCount=" + stciCount + ", targetCount=" + targetCount);
827     return false;
828     }
829    
830     long curTime = CDTXMania.Timer.n現在時刻;
831     //Debug.WriteLine("Start checking...targetCount=" + targetCount);
832     for ( int i = targetCount - 1, j = stciCount - 1; i >= 0; i--, j-- )
833     {
834     if ( _ePad[ i ] != stct[ j ].ePad )
835     {
836     //Debug.WriteLine( "CMD解析: false targetCount=" + targetCount + ", i=" + i + ", j=" + j + ": ePad[]=" + _ePad[i] + ", stci[j] = " + stct[j].ePad );
837     return false;
838     }
839     if ( stct[ j ].eInst != _eInst )
840     {
841     //Debug.WriteLine( "CMD解析: false " + i );
842     return false;
843     }
844     if ( curTime - stct[ j ].time > 500 )
845     {
846     //Debug.WriteLine( "CMD解析: false " + i + "; over 500ms" );
847     return false;
848     }
849     curTime = stct[ j ].time;
850     }
851    
852     //Debug.Write( "CMD解析: 成功!(" + _ePad.Length + ") " );
853     //for ( int i = 0; i < _ePad.Length; i++ ) Debug.Write( _ePad[ i ] + ", " );
854     //Debug.WriteLine( "" );
855     //stct.RemoveRange( 0, targetCount ); // #24396 2011.2.13 yyagi
856     stct.Clear(); // #24396 2011.2.13 yyagi Clear all command input history in case you succeeded inputting some command
857    
858     return true;
859     }
860     }
861 kairera0467 101 public CCommandHistory CommandHistory;
862 kairera0467 2
863     private void tソルを下へ移動する()
864     {
865     CDTXMania.Skin.soundソル移動音.t再生する();
866     this.act曲リスト.t次に移動();
867     }
868     private void tソルを上へ移動する()
869     {
870     CDTXMania.Skin.soundソル移動音.t再生する();
871     this.act曲リスト.t前に移動();
872     }
873     private void t曲をランダム選択する()
874     {
875     C曲リストノ song = this.act曲リスト.r現在選択中の曲;
876     if( ( song.stackランダム演奏番号.Count == 0 ) || ( song.listランダム用ノドリスト == null ) )
877     {
878     if( song.listランダム用ノドリスト == null )
879     {
880     song.listランダム用ノドリスト = this.t指定された曲が存在する場所の曲を列挙する・子リスト含む( song );
881     }
882     int count = song.listランダム用ノドリスト.Count;
883     if( count == 0 )
884     {
885     return;
886     }
887     int[] numArray = new int[ count ];
888     for( int i = 0; i < count; i++ )
889     {
890     numArray[ i ] = i;
891     }
892     for( int j = 0; j < ( count * 1.5 ); j++ )
893     {
894     int index = CDTXMania.Random.Next( count );
895     int num5 = CDTXMania.Random.Next( count );
896     int num6 = numArray[ num5 ];
897     numArray[ num5 ] = numArray[ index ];
898     numArray[ index ] = num6;
899     }
900     for( int k = 0; k < count; k++ )
901     {
902     song.stackランダム演奏番号.Push( numArray[ k ] );
903     }
904     if( CDTXMania.ConfigIni.bLogDTX詳細ログ出力 )
905     {
906     StringBuilder builder = new StringBuilder( 0x400 );
907     builder.Append( string.Format( "ランダムインデックスリストを作成しました: {0}曲: ", song.stackランダム演奏番号.Count ) );
908     for( int m = 0; m < count; m++ )
909     {
910     builder.Append( string.Format( "{0} ", numArray[ m ] ) );
911     }
912     Trace.TraceInformation( builder.ToString() );
913     }
914     }
915     this.r確定された曲 = song.listランダム用ノドリスト[ song.stackランダム演奏番号.Pop() ];
916     this.n確定された曲の難易度 = this.act曲リスト.n現在のアンカ難易度レベルに最も近い難易度レベルを返す( this.r確定された曲 );
917     this.r確定されたスコア = this.r確定された曲.arスコア[ this.n確定された曲の難易度 ];
918     this.eフェドアウト完了時の戻り値 = E戻り値.選曲した;
919     // this.actFOtoNowLoading.tフェードアウト開始(); // #27787 2012.3.10 yyagi 曲決定時の画面フェードアウトの省略
920     base.eフェID = CStage.Eフェ.選曲_NowLoading画面へのフェドアウト;
921     if( CDTXMania.ConfigIni.bLogDTX詳細ログ出力 )
922     {
923     int[] numArray2 = song.stackランダム演奏番号.ToArray();
924     StringBuilder builder2 = new StringBuilder( 0x400 );
925     builder2.Append( "ランダムインデックスリスト残り: " );
926     if( numArray2.Length > 0 )
927     {
928     for( int n = 0; n < numArray2.Length; n++ )
929     {
930     builder2.Append( string.Format( "{0} ", numArray2[ n ] ) );
931     }
932     }
933     else
934     {
935     builder2.Append( "(なし)" );
936     }
937     Trace.TraceInformation( builder2.ToString() );
938     }
939     CDTXMania.Skin.bgm選曲画面.t停止する();
940     }
941     private void t曲を選択する()
942     {
943     this.r確定された曲 = this.act曲リスト.r現在選択中の曲;
944     this.r確定されたスコア = this.act曲リスト.r現在選択中のスコア;
945     this.n確定された曲の難易度 = this.act曲リスト.n現在選択中の曲の現在の難易度レベル;
946     if( ( this.r確定された曲 != null ) && ( this.r確定されたスコア != null ) )
947     {
948     this.eフェドアウト完了時の戻り値 = E戻り値.選曲した;
949     // this.actFOtoNowLoading.tフェードアウト開始(); // #27787 2012.3.10 yyagi 曲決定時の画面フェードアウトの省略
950     base.eフェID = CStage.Eフェ.選曲_NowLoading画面へのフェドアウト;
951     }
952     CDTXMania.Skin.bgm選曲画面.t停止する();
953     }
954     private List<C曲リストノ> t指定された曲が存在する場所の曲を列挙する・子リスト含む( C曲リストノ song )
955     {
956     List<C曲リストノ> list = new List<C曲リストノ>();
957     song = song.r親ノ;
958     if( ( song == null ) && ( CDTXMania.Songs管理.list曲ル.Count > 0 ) )
959     {
960     foreach( C曲リストノ c曲リストノ in CDTXMania.Songs管理.list曲ル )
961     {
962     if( ( c曲リストノ.eド種別 == C曲リストノ.Eド種別.SCORE ) || ( c曲リストノ.eド種別 == C曲リストノ.Eド種別.SCORE_MIDI ) )
963     {
964     list.Add( c曲リストノ );
965     }
966     if( ( c曲リストノ.list子リスト != null ) && CDTXMania.ConfigIni.bランダムセレクトで子BOXを検索対象とする )
967     {
968     this.t指定された曲の子リストの曲を列挙する・孫リスト含む( c曲リストノ, ref list );
969     }
970     }
971     return list;
972     }
973     this.t指定された曲の子リストの曲を列挙する・孫リスト含む( song, ref list );
974     return list;
975     }
976     private void t指定された曲の子リストの曲を列挙する・孫リスト含む( C曲リストノ r, ref List<C曲リストノ> list )
977     {
978     if( ( r != null ) && ( r.list子リスト != null ) )
979     {
980     foreach( C曲リストノ c曲リストノ in r.list子リスト )
981     {
982     if( ( c曲リストノ.eド種別 == C曲リストノ.Eド種別.SCORE ) || ( c曲リストノ.eド種別 == C曲リストノ.Eド種別.SCORE_MIDI ) )
983     {
984     list.Add( c曲リストノ );
985     }
986     if( ( c曲リストノ.list子リスト != null ) && CDTXMania.ConfigIni.bランダムセレクトで子BOXを検索対象とする )
987     {
988     this.t指定された曲の子リストの曲を列挙する・孫リスト含む( c曲リストノ, ref list );
989     }
990     }
991     }
992     }
993     //-----------------
994     #endregion
995     }
996     }

Back to OSDN">Back to OSDN
ViewVC Help
Powered by ViewVC 1.1.26