// 集めた Sounds[] をすべて停止する。
foreach( var sounds in 停止するサウンド群 )
foreach( var sound in sounds )
- sound.再生を停止する();
+ sound.Stop();
}
// 再生する。
if( null != context.Sounds[ context.次に再生するSound番号 ] )
{
- context.Sounds[ context.次に再生するSound番号 ].音量 = 音量0to1;
- context.Sounds[ context.次に再生するSound番号 ].再生を開始する();
+ context.Sounds[ context.次に再生するSound番号 ].Volume = 音量0to1;
+ context.Sounds[ context.次に再生するSound番号 ].Play();
}
// サウンドローテーション。
protected readonly string KitXmlファイルパス = @"$(Static)\sounds\Kit.xml";
protected class Cコンテキスト : IDisposable
{
- public FDK.メディア.サウンド.WASAPIold.Sound[] Sounds = new FDK.メディア.サウンド.WASAPIold.Sound[ ドラムサウンド.多重度 ];
+ public FDK.メディア.サウンド.WASAPI.Sound[] Sounds = new FDK.メディア.サウンド.WASAPI.Sound[ ドラムサウンド.多重度 ];
public int 次に再生するSound番号 = 0;
public void Dispose()
{
for( int i = 0; i < this.Sounds.Length; i++ )
{
- StrokeStyleT.Wasapiデバイス.サウンドをミキサーから削除する( this.Sounds[ i ] );
+ this.Sounds[ i ].Stop();
FDK.Utilities.解放する( ref this.Sounds[ i ] );
}
}
// コンテキストを作成する。
var context = new Cコンテキスト() {
- Sounds = new FDK.メディア.サウンド.WASAPIold.Sound[ ドラムサウンド.多重度 ],
+ Sounds = new FDK.メディア.サウンド.WASAPI.Sound[ ドラムサウンド.多重度 ],
次に再生するSound番号 = 0,
};
- for( int i = 0; i < context.Sounds.Length; i++ )
- {
- // 多重度分のサウンドを生成しつつ、ミキサーにも登録。
- context.Sounds[ i ] = new FDK.メディア.サウンド.WASAPIold.Sound( サウンドファイルパス );
- StrokeStyleT.Wasapiデバイス.サウンドをミキサーに追加する( context.Sounds[ i ] );
- }
+ // 多重度分のサウンドを生成する。
+ for( int i = 0; i < context.Sounds.Length; i++ )
+ context.Sounds[ i ] = StrokeStyleT.サウンドデバイス.CreateSound( サウンドファイルパス );
+
// コンテキストを辞書に追加する。
this.チップtoコンテキスト.Add( チップ種別, context );
}