2 using System.Collections.Generic;
\r
4 using System.Diagnostics;
\r
9 internal class CActSelectPresound : CActivity
\r
13 public CActSelectPresound()
\r
15 base.b活性化してない = true;
\r
17 public void tサウンド停止()
\r
19 if( this.sound != null )
\r
21 this.sound.t再生を停止する();
\r
22 CDTXMania.Sound管理.tサウンドを破棄する( this.sound );
\r
26 public void t選択曲が変更された()
\r
28 Cスコア cスコア = CDTXMania.stage選曲.r現在選択中のスコア;
\r
29 if( ( cスコア != null ) && ( ( !( cスコア.ファイル情報.フォルダの絶対パス + cスコア.譜面情報.Presound ).Equals( this.str現在のファイル名 ) || ( this.sound == null ) ) || !this.sound.b再生中 ) )
\r
32 this.tBGMフェードイン開始();
\r
33 if( ( cスコア.譜面情報.Presound != null ) && ( cスコア.譜面情報.Presound.Length > 0 ) )
\r
35 this.ct再生待ちウェイト = new CCounter( 0, CDTXMania.ConfigIni.n曲が選択されてからプレビュー音が鳴るまでのウェイトms, 1, CDTXMania.Timer );
\r
43 public override void On活性化()
\r
46 this.str現在のファイル名 = "";
\r
47 this.ct再生待ちウェイト = null;
\r
48 this.ctBGMフェードアウト用 = null;
\r
49 this.ctBGMフェードイン用 = null;
\r
52 public override void On非活性化()
\r
55 this.ct再生待ちウェイト = null;
\r
56 this.ctBGMフェードイン用 = null;
\r
57 this.ctBGMフェードアウト用 = null;
\r
60 public override int On進行描画()
\r
62 if( !base.b活性化してない )
\r
64 if( ( this.ctBGMフェードイン用 != null ) && this.ctBGMフェードイン用.b進行中 )
\r
66 this.ctBGMフェードイン用.t進行();
\r
67 CDTXMania.Skin.bgm選曲画面.n音量・現在のサウンド = this.ctBGMフェードイン用.n現在の値;
\r
68 if( this.ctBGMフェードイン用.b終了値に達した )
\r
70 this.ctBGMフェードイン用.t停止();
\r
73 if( ( this.ctBGMフェードアウト用 != null ) && this.ctBGMフェードアウト用.b進行中 )
\r
75 this.ctBGMフェードアウト用.t進行();
\r
76 CDTXMania.Skin.bgm選曲画面.n音量・現在のサウンド = 100 - this.ctBGMフェードアウト用.n現在の値;
\r
77 if( this.ctBGMフェードアウト用.b終了値に達した )
\r
79 this.ctBGMフェードアウト用.t停止();
\r
82 this.t進行処理・プレビューサウンド();
\r
92 private CCounter ctBGMフェードアウト用;
\r
93 private CCounter ctBGMフェードイン用;
\r
94 private CCounter ct再生待ちウェイト;
\r
95 private CSound sound;
\r
96 private string str現在のファイル名;
\r
98 private void tBGMフェードアウト開始()
\r
100 if( this.ctBGMフェードイン用 != null )
\r
102 this.ctBGMフェードイン用.t停止();
\r
104 this.ctBGMフェードアウト用 = new CCounter( 0, 100, 10, CDTXMania.Timer );
\r
105 this.ctBGMフェードアウト用.n現在の値 = 100 - CDTXMania.Skin.bgm選曲画面.n音量・現在のサウンド;
\r
107 private void tBGMフェードイン開始()
\r
109 if( this.ctBGMフェードアウト用 != null )
\r
111 this.ctBGMフェードアウト用.t停止();
\r
113 this.ctBGMフェードイン用 = new CCounter( 0, 100, 20, CDTXMania.Timer );
\r
114 this.ctBGMフェードイン用.n現在の値 = CDTXMania.Skin.bgm選曲画面.n音量・現在のサウンド;
\r
116 private void tプレビューサウンドの作成()
\r
118 Cスコア cスコア = CDTXMania.stage選曲.r現在選択中のスコア;
\r
119 if( ( cスコア != null ) && !string.IsNullOrEmpty( cスコア.譜面情報.Presound ) )
\r
121 string str = cスコア.ファイル情報.フォルダの絶対パス + cスコア.譜面情報.Presound;
\r
124 this.sound = CDTXMania.Sound管理.tサウンドを生成する( str );
\r
125 this.sound.n音量 = CDTXMania.ConfigIni.n自動再生音量;
\r
126 this.sound.t再生を開始する( true );
\r
127 this.str現在のファイル名 = str;
\r
128 this.tBGMフェードアウト開始();
\r
129 Trace.TraceInformation( "サウンドを生成しました。({0})", new object[] { str } );
\r
133 Trace.TraceError( "サウンドの生成に失敗しました。({0})", new object[] { str } );
\r
134 if( this.sound != null )
\r
136 this.sound.Dispose();
\r
142 private void t進行処理・プレビューサウンド()
\r
144 if( ( this.ct再生待ちウェイト != null ) && !this.ct再生待ちウェイト.b停止中 )
\r
146 this.ct再生待ちウェイト.t進行();
\r
147 if( !this.ct再生待ちウェイト.b終了値に達してない )
\r
149 this.ct再生待ちウェイト.t停止();
\r
150 if( !CDTXMania.stage選曲.bスクロール中 )
\r
152 this.tプレビューサウンドの作成();
\r
157 //-----------------
\r