public float 不透明度0to1 { get; set; } = 1.0f;
public bool ループ再生する { get; set; } = false;
public int キューのサイズ { get; set; } = 16;
+ public double 長さsec
+ {
+ get { return ( null != this.デコーダ ) ? this.デコーダ.長さsec : 0.0; }
+ }
public 動画( string 動画ファイルパス, int キューのサイズ )
{
break;
}
}
+ public void 再生位置secを移動する( double 再生位置sec )
+ {
+ this.デコーダ?.再生位置secを移動する( 再生位置sec );
+ }
protected 動画デコーダ デコーダ = null;
} );
}
}
+ public double 長さsec
+ {
+ get;
+ protected set;
+ } = 0.0;
public 動画デコーダ( デバイスリソース dr, string 動画ファイルパス, bool ループ再生する, int キューのサイズ )
{
}
//-----------------
#endregion
+ #region " 動画の長さを取得する。"
+ //----------------
+ try
+ {
+ this.長さsec =
+ this.SourceReaderEx.GetPresentationAttribute(
+ SharpDX.MediaFoundation.SourceReaderIndex.MediaSource,
+ SharpDX.MediaFoundation.PresentationDescriptionAttributeKeys.Duration ) / ( 1000.0 * 1000.0 * 10.0 );
+ }
+ catch( SharpDX.SharpDXException e )
+ {
+ Log.ERROR( $"動画の長さの取得に失敗しました。(0x{e.HResult:x8})[{変数付きファイルパス}]" );
+ throw;
+ }
+ //----------------
+ #endregion
#region " 描画先WICビットマップを作成する。"
//-----------------
try
Log.Info( $"{Utilities.現在のメソッド名}: 動画のセットアップ(フレームキャッシング)を行いました。" );
}
+ public void 再生位置secを移動する( double 再生位置sec )
+ {
+
+ }
public void デコードを開始する()
{
this.前フレームの再生時刻100ns = 0;
return ( null != this.BGM ) ? this.BGM.長さsec : 0.0;
};
this.スクロール譜面.背景動画再生開始 = ( 開始位置sec ) => {
- //this.背景動画.再生位置を移動する( 開始位置sec );
+ this.背景動画.再生位置secを移動する( 開始位置sec );
this.背景動画開始済み.Value = true;
this.BGM?.再生を開始する( 開始位置sec );
this.BGM再生開始済み = true;