private void tプレビュー画像_動画の変更()
 {
     if (this.rAVI != null)
     {
         this.rAVI.Dispose();
         this.rAVI = null;
     }
     this.pAVIBmp    = IntPtr.Zero;
     this.nAVI再生開始時刻 = -1;
     if (!CDTXMania.ConfigIni.bストイックモード)
     {
         if (this.tプレビュー動画の指定があれば構築する())
         {
             return;
         }
         if (this.tプレビュー画像の指定があれば構築する())
         {
             return;
         }
         if (this.t背景画像があればその一部からプレビュー画像を構築する())
         {
             return;
         }
     }
     this.r表示するプレビュー画像 = this.txプレビュー画像がないときの画像;
     this.str現在のファイル名  = "";
 }
        private bool tプレビュー動画の指定があれば構築する()
        {
            CScore cスコア = CDTXMania.stageSongSelection.rSelectedScore;

            if ((CDTXMania.ConfigIni.bAVIEnabled && (cスコア != null)) && !string.IsNullOrEmpty(cスコア.SongInformation.Premovie))
            {
                string filename = cスコア.FileInformation.AbsoluteFolderPath + cスコア.SongInformation.Premovie;
                if (filename.Equals(this.str現在のファイル名))
                {
                    return(true);
                }
                if (this.rAVI != null)
                {
                    this.rAVI.Dispose();
                    this.rAVI = null;
                }
                this.str現在のファイル名 = filename;
                if (!File.Exists(this.str現在のファイル名))
                {
                    Trace.TraceWarning("ファイルが存在しません。({0})", new object[] { this.str現在のファイル名 });
                    return(false);
                }
                try
                {
                    CDTX.CAVI cAVI = new CDTX.CAVI(0, filename, "", (int)CDTXMania.ConfigIni.nPlaySpeed);
                    cAVI.OnDeviceCreated();

                    this.rAVI          = cAVI;
                    this.nAVI再生開始時刻    = CDTXMania.Timer.nCurrentTime;
                    this.n前回描画したフレーム番号 = -1;
                    this.b動画フレームを作成した  = false;
                    this.tサーフェイスをクリアする(this.sfAVI画像);
                    Trace.TraceInformation("動画を生成しました。({0})", new object[] { filename });
                }
                catch
                {
                    Trace.TraceError("動画の生成に失敗しました。({0})", new object[] { filename });
                    this.rAVI       = null;
                    this.nAVI再生開始時刻 = -1;
                }
            }
            return(false);
        }
Esempio n. 3
0
        // メソッド

        public void Start(int nチャンネル番号, CDTX.CAVI rAVI, CDTX.CDirectShow dsBGV, int n開始サイズW, int n開始サイズH, int n終了サイズW, int n終了サイズH, int n画像側開始位置X, int n画像側開始位置Y, int n画像側終了位置X, int n画像側終了位置Y, int n表示側開始位置X, int n表示側開始位置Y, int n表示側終了位置X, int n表示側終了位置Y, int n総移動時間ms, int n移動開始時刻ms)
        {
            if ((nチャンネル番号 == 0x54 || nチャンネル番号 == 0x5A) && TJAPlayer3.ConfigIni.bAVI有効)
            {
                this.rAVI  = rAVI;
                this.dsBGV = dsBGV;
                if (this.dsBGV != null && this.dsBGV.dshow != null)
                {
                    this.framewidth  = (uint)this.dsBGV.dshow.n幅px;
                    this.frameheight = (uint)this.dsBGV.dshow.n高さpx;
                    float f拡大率x;
                    float f拡大率y;
                    this.fAVIアスペクト比 = ((float)this.framewidth) / ((float)this.frameheight);

                    if (fAVIアスペクト比 < 1.77f)
                    {
                        #region [ 旧規格クリップ時の処理。結果的には面倒な処理なんだよな____ ]
                        this.n開始サイズW       = n開始サイズW;
                        this.n開始サイズH       = n開始サイズH;
                        this.n終了サイズW       = n終了サイズW;
                        this.n終了サイズH       = n終了サイズH;
                        this.n画像側開始位置X     = n画像側開始位置X;
                        this.n画像側開始位置Y     = n画像側開始位置Y;
                        this.n画像側終了位置X     = n画像側終了位置X;
                        this.n画像側終了位置Y     = n画像側終了位置Y;
                        this.n表示側開始位置X     = n表示側開始位置X;
                        this.n表示側開始位置Y     = n表示側開始位置Y;
                        this.n表示側終了位置X     = n表示側終了位置X;
                        this.n表示側終了位置Y     = n表示側終了位置Y;
                        this.n総移動時間ms      = n総移動時間ms;
                        this.n移動開始時刻ms     = (n移動開始時刻ms != -1) ? n移動開始時刻ms : CSound管理.rc演奏用タイマ.n現在時刻;
                        this.n前回表示したフレーム番号 = -1;

                        this.vclip = new Vector3(1.42f, 1.42f, 1f);
                        this.dsBGV = null;
                        #endregion
                    }
                    if (this.tx描画用 == null)
                    {
                        this.tx描画用 = new CTexture(TJAPlayer3.app.Device, (int)this.framewidth, (int)this.frameheight, TJAPlayer3.app.GraphicsDeviceManager.CurrentSettings.BackBufferFormat, Pool.Managed);
                    }

                    #region [ リサイズ処理 ]
                    if (fAVIアスペクト比 < 1.77f)
                    {
                        //旧企画クリップだった場合
                        this.ratio1   = 720f / ((float)this.frameheight);
                        this.position = (int)((1280f - (this.framewidth * this.ratio1)) / 2f);
                        int num = (int)(this.framewidth * this.ratio1);
                        if (num <= 565)
                        {
                            this.position = 295 + ((int)((565f - (this.framewidth * this.ratio1)) / 2f));
                            this.i1       = 0;
                            this.i2       = (int)this.framewidth;
                            this.rec      = new Rectangle(0, 0, 0, 0);
                            this.rec3     = new Rectangle(0, 0, 0, 0);
                            this.rec2     = new Rectangle(0, 0, (int)this.framewidth, (int)this.frameheight);
                        }
                        else
                        {
                            this.position = 295 - ((int)(((this.framewidth * this.ratio1) - 565f) / 2f));
                            this.i1       = (int)(((float)(295 - this.position)) / this.ratio1);
                            this.i2       = (int)((565f / ((float)num)) * this.framewidth);
                            this.rec      = new Rectangle(0, 0, this.i1, (int)this.frameheight);
                            this.rec3     = new Rectangle(this.i1 + this.i2, 0, (((int)this.framewidth) - this.i1) - this.i2, (int)this.frameheight);
                            this.rec2     = new Rectangle(this.i1, 0, this.i2, (int)this.frameheight);
                        }
                        this.tx描画用.vc拡大縮小倍率.X = this.ratio1;
                        this.tx描画用.vc拡大縮小倍率.Y = this.ratio1;
                    }
                    else
                    {
                        //ワイドクリップの処理
                        this.ratio1           = 1280f / ((float)this.framewidth);
                        this.position         = (int)((720f - (this.frameheight * this.ratio1)) / 2f);
                        this.i1               = (int)(this.framewidth * 0.23046875);
                        this.i2               = (int)(this.framewidth * 0.44140625);
                        this.rec              = new Rectangle(0, 0, this.i1, (int)this.frameheight);
                        this.rec2             = new Rectangle(this.i1, 0, this.i2, (int)this.frameheight);
                        this.rec3             = new Rectangle(this.i1 + this.i2, 0, (((int)this.framewidth) - this.i1) - this.i2, (int)this.frameheight);
                        this.tx描画用.vc拡大縮小倍率.X = this.ratio1;
                        this.tx描画用.vc拡大縮小倍率.Y = this.ratio1;
                    }


                    if (this.framewidth > 420)
                    {
                        f拡大率x = 420f / ((float)this.framewidth);
                    }
                    else
                    {
                        f拡大率x = 1f;
                    }
                    if (this.frameheight > 580)
                    {
                        f拡大率y = 580f / ((float)this.frameheight);
                    }
                    else
                    {
                        f拡大率y = 1f;
                    }
                    if (f拡大率x > f拡大率y)
                    {
                        f拡大率x = f拡大率y;
                    }
                    else
                    {
                        f拡大率y = f拡大率x;
                    }

                    this.smallvc = new Vector3(f拡大率x, f拡大率y, 1f);
                    #endregion
                }

                if (fAVIアスペクト比 > 1.77f && this.dsBGV != null && this.dsBGV.dshow != null)
                {
                    this.dsBGV.dshow.t再生開始();
                    this.bDShowクリップを再生している = true;
                    this.b再生トグル            = true;
                }
            }
        }
Esempio n. 4
0
        public void Start(EChannel nチャンネル番号, CDTX.CAVI rAVI, int n総移動時間ms, int n移動開始時刻ms)
        {
            //2016.01.21 kairera0467 VfW時代のコードを除去+大改造
            Trace.TraceInformation("CActSelectBackgroundAVI: Start(): " + rAVI.strファイル名);

            this.rAVI = rAVI;
            #region [ アスペクト比からどっちを使うか判別 ]
            // 旧DShowモードを使っていて、旧規格クリップだったら新DShowモードを使う。
            //if( CDTXMania.ConfigIni.bDirectShowMode == false )
            {
                this.fClipアスペクト比 = ((float)rAVI.avi.nフレーム幅 / (float)rAVI.avi.nフレーム高さ);
            }
            //else
            //{
            //    this.fClipアスペクト比 = ( (float)dsBGV.dshow.n幅px / (float)dsBGV.dshow.n高さpx );
            //    if( this.fClipアスペクト比 < 1.77f )
            //        this.bUseMRenderer = false;
            //}
            #endregion

            if (nチャンネル番号 == EChannel.Movie || nチャンネル番号 == EChannel.MovieFull)
            {
                //CAviDS
                this.rAVI = rAVI;

                this.n総移動時間ms  = n総移動時間ms;
                this.n移動開始時刻ms = (n移動開始時刻ms != -1) ? n移動開始時刻ms : CSoundManager.rcPerformanceTimer.nCurrentTime;

                if ((this.rAVI != null) && (this.rAVI.avi != null))
                {
                    //float f拡大率x;
                    //float f拡大率y;
                    this.framewidth  = (uint)this.rAVI.avi.nフレーム幅;
                    this.frameheight = (uint)this.rAVI.avi.nフレーム高さ;
                    if (this.tx描画用 == null)
                    {
                        this.tx描画用 = new CTexture(CDTXMania.app.Device, (int)this.framewidth, (int)this.frameheight, CDTXMania.app.GraphicsDeviceManager.CurrentSettings.BackBufferFormat, Pool.Managed);
                    }

                    if (fClipアスペクト比 < 1.77f)
                    {
                        //旧規格クリップだった場合
                        float ratio1 = this.fullScreenWidthPx / ((float)this.frameheight);
                        this.position = (int)((this.fullScreenHeightPx - (this.framewidth * ratio1)) / 2f);
                        int num = (int)(this.framewidth * ratio1);
                        if (num <= 565)
                        {
                            this.position = 295 + ((int)((565f - (this.framewidth * ratio1)) / 2f));
                        }
                        else
                        {
                            this.position = 295 - ((int)(((this.framewidth * ratio1) - 565f) / 2f));
                        }
                        this.tx描画用.vcScaleRatio.X = ratio1;
                        this.tx描画用.vcScaleRatio.Y = ratio1;
                    }
                    else
                    {
                        //ワイドクリップの処理
                        float ratio1 = this.fullScreenHeightPx / ((float)this.framewidth);
                        this.position             = (int)((this.fullScreenWidthPx - (this.frameheight * ratio1)) / 2f);
                        this.tx描画用.vcScaleRatio.X = ratio1;
                        this.tx描画用.vcScaleRatio.Y = ratio1;
                    }
                    this.rAVI.avi.Run();
                }
            }
        }
Esempio n. 5
0
        // メソッド

        public void Start(EChannel nチャンネル番号, CDTX.CAVI rAVI, int n開始サイズW, int n開始サイズH, int n終了サイズW, int n終了サイズH, int n画像側開始位置X, int n画像側開始位置Y, int n画像側終了位置X, int n画像側終了位置Y, int n表示側開始位置X, int n表示側開始位置Y, int n表示側終了位置X, int n表示側終了位置Y, int n総移動時間ms, int n移動開始時刻ms, bool bPlayFromBeginning = false)
        {
            //2016.01.21 kairera0467 VfW時代のコードを除去+大改造
            Trace.TraceInformation("CActPerfAVI: Start(): " + rAVI.strファイル名);

            this.rAVI = rAVI;
            #region [ アスペクト比からどっちを使うか判別 ]
            // 旧DShowモードを使っていて、旧規格クリップだったら新DShowモードを使う。
            //if( CDTXMania.ConfigIni.bDirectShowMode == false )
            {
                this.fClipアスペクト比 = ((float)rAVI.avi.nフレーム幅 / (float)rAVI.avi.nフレーム高さ);
                //this.bUseMRenderer = false;
            }

            #endregion

            if (nチャンネル番号 == EChannel.Movie || nチャンネル番号 == EChannel.MovieFull)
            {
                if (this.bUseCAviDS)
                {
                    //CAviDS
                    this.rAVI      = rAVI;
                    this.n開始サイズW   = n開始サイズW;
                    this.n開始サイズH   = n開始サイズH;
                    this.n終了サイズW   = n終了サイズW;
                    this.n終了サイズH   = n終了サイズH;
                    this.n画像側開始位置X = n画像側開始位置X;
                    this.n画像側開始位置Y = n画像側開始位置Y;
                    this.n画像側終了位置X = n画像側終了位置X;
                    this.n画像側終了位置Y = n画像側終了位置Y;
                    this.n表示側開始位置X = n表示側開始位置X;
                    this.n表示側開始位置Y = n表示側開始位置Y;
                    this.n表示側終了位置X = n表示側終了位置X;
                    this.n表示側終了位置Y = n表示側終了位置Y;
                    this.n総移動時間ms  = n総移動時間ms;
                    this.n移動開始時刻ms = (n移動開始時刻ms != -1) ? n移動開始時刻ms : CSoundManager.rcPerformanceTimer.nCurrentTime;

                    if ((this.rAVI != null) && (this.rAVI.avi != null))
                    {
                        float f拡大率x;
                        float f拡大率y;
                        this.framewidth  = (uint)this.rAVI.avi.nフレーム幅;
                        this.frameheight = (uint)this.rAVI.avi.nフレーム高さ;
                        if (this.tx描画用 == null)
                        {
                            this.tx描画用 = new CTexture(CDTXMania.app.Device, (int)this.framewidth, (int)this.frameheight, CDTXMania.app.GraphicsDeviceManager.CurrentSettings.BackBufferFormat, Pool.Managed);
                        }

                        if (fClipアスペクト比 < 1.77f)
                        {
                            //旧規格クリップだった場合
                            this.ratio1   = 720f / ((float)this.frameheight);
                            this.position = (int)((1280f - (this.framewidth * this.ratio1)) / 2f);
                            int num = (int)(this.framewidth * this.ratio1);
                            if (num <= 565)
                            {
                                this.position = 295 + ((int)((565f - (this.framewidth * this.ratio1)) / 2f));
                                this.i1       = 0;
                                this.i2       = (int)this.framewidth;
                                this.rec      = new Rectangle(0, 0, 0, 0);
                                this.rec3     = new Rectangle(0, 0, 0, 0);
                                this.rec2     = new Rectangle(0, 0, (int)this.framewidth, (int)this.frameheight);
                            }
                            else
                            {
                                this.position = 295 - ((int)(((this.framewidth * this.ratio1) - 565f) / 2f));
                                this.i1       = (int)(((float)(295 - this.position)) / this.ratio1);
                                this.i2       = (int)((565f / ((float)num)) * this.framewidth);
                                this.rec      = new Rectangle(0, 0, this.i1, (int)this.frameheight);
                                this.rec3     = new Rectangle(this.i1 + this.i2, 0, (((int)this.framewidth) - this.i1) - this.i2, (int)this.frameheight);
                                this.rec2     = new Rectangle(this.i1, 0, this.i2, (int)this.frameheight);
                            }
                            this.tx描画用.vcScaleRatio.X = this.ratio1;
                            this.tx描画用.vcScaleRatio.Y = this.ratio1;
                        }
                        else
                        {
                            //ワイドクリップの処理
                            this.ratio1               = 1280f / ((float)this.framewidth);
                            this.position             = (int)((720f - (this.frameheight * this.ratio1)) / 2f);
                            this.i1                   = (int)(this.framewidth * 0.23046875);
                            this.i2                   = (int)(this.framewidth * 0.44140625);
                            this.rec                  = new Rectangle(0, 0, this.i1, (int)this.frameheight);
                            this.rec2                 = new Rectangle(this.i1, 0, this.i2, (int)this.frameheight);
                            this.rec3                 = new Rectangle(this.i1 + this.i2, 0, (((int)this.framewidth) - this.i1) - this.i2, (int)this.frameheight);
                            this.tx描画用.vcScaleRatio.X = this.ratio1;
                            this.tx描画用.vcScaleRatio.Y = this.ratio1;
                        }


                        if (this.framewidth > 420)
                        {
                            f拡大率x = 420f / ((float)this.framewidth);
                        }
                        else
                        {
                            f拡大率x = 1f;
                        }
                        if (this.frameheight > 580)
                        {
                            f拡大率y = 580f / ((float)this.frameheight);
                        }
                        else
                        {
                            f拡大率y = 1f;
                        }
                        if (f拡大率x > f拡大率y)
                        {
                            f拡大率x = f拡大率y;
                        }
                        else
                        {
                            f拡大率y = f拡大率x;
                        }

                        this.smallvc = new Vector3(f拡大率x, f拡大率y, 1f);
                        this.vclip   = new Vector3(1.42f, 1.42f, 1f);
                        this.rAVI.avi.Run();
                    }
                }
                else
                {
                    this.rAVI          = rAVI;
                    this.n開始サイズW       = n開始サイズW;
                    this.n開始サイズH       = n開始サイズH;
                    this.n終了サイズW       = n終了サイズW;
                    this.n終了サイズH       = n終了サイズH;
                    this.n画像側開始位置X     = n画像側開始位置X;
                    this.n画像側開始位置Y     = n画像側開始位置Y;
                    this.n画像側終了位置X     = n画像側終了位置X;
                    this.n画像側終了位置Y     = n画像側終了位置Y;
                    this.n表示側開始位置X     = n表示側開始位置X;
                    this.n表示側開始位置Y     = n表示側開始位置Y;
                    this.n表示側終了位置X     = n表示側終了位置X;
                    this.n表示側終了位置Y     = n表示側終了位置Y;
                    this.n総移動時間ms      = n総移動時間ms;
                    this.n移動開始時刻ms     = (n移動開始時刻ms != -1) ? n移動開始時刻ms : CSoundManager.rcPerformanceTimer.nCurrentTime;
                    this.n前回表示したフレーム番号 = -1;
                    if ((this.rAVI != null) && (this.rAVI.avi != null))
                    {
                        float f拡大率x;
                        float f拡大率y;
                        this.framewidth  = this.rAVI.avi.nフレーム幅;
                        this.frameheight = this.rAVI.avi.nフレーム高さ;
                        if (this.tx描画用 == null)
                        {
                            this.tx描画用 = new CTexture(CDTXMania.app.Device, (int)this.framewidth, (int)this.frameheight, CDTXMania.app.GraphicsDeviceManager.CurrentSettings.BackBufferFormat, Pool.Managed);
                        }
                        if (fClipアスペクト比 < 1.77f)
                        {
                            //旧規格クリップだった場合
                            this.ratio1   = 720.0f / this.frameheight;
                            this.position = (int)((1280.0f - (this.framewidth * this.ratio1)) / 2.0f);
                            int num = (int)(this.framewidth * this.ratio1);
                            if (num <= 565)
                            {
                                this.position = 295 + ((int)((565f - (this.framewidth * this.ratio1)) / 2f));
                                this.i1       = 0;
                                this.i2       = (int)this.framewidth;
                                this.rec      = new Rectangle(0, 0, 0, 0);
                                this.rec3     = new Rectangle(0, 0, 0, 0);
                                this.rec2     = new Rectangle(0, 0, (int)this.framewidth, (int)this.frameheight);
                            }
                            else
                            {
                                this.position = 295 - ((int)(((this.framewidth * this.ratio1) - 565f) / 2f));
                                this.i1       = (int)(((float)(295 - this.position)) / this.ratio1);
                                this.i2       = (int)((565f / ((float)num)) * this.framewidth);
                                this.rec      = new Rectangle(0, 0, this.i1, (int)this.frameheight);
                                this.rec3     = new Rectangle(this.i1 + this.i2, 0, (((int)this.framewidth) - this.i1) - this.i2, (int)this.frameheight);
                                this.rec2     = new Rectangle(this.i1, 0, this.i2, (int)this.frameheight);
                            }
                            this.tx描画用.vcScaleRatio.X = this.ratio1;
                            this.tx描画用.vcScaleRatio.Y = this.ratio1;
                        }
                        else
                        {
                            //ワイドクリップの処理
                            this.ratio1               = 1280f / ((float)this.framewidth);
                            this.position             = (int)((720f - (this.frameheight * this.ratio1)) / 2f);
                            this.i1                   = (int)(this.framewidth * 0.23046875);
                            this.i2                   = (int)(this.framewidth * 0.44140625);
                            this.rec                  = new Rectangle(0, 0, this.i1, (int)this.frameheight);
                            this.rec2                 = new Rectangle(this.i1, 0, this.i2, (int)this.frameheight);
                            this.rec3                 = new Rectangle(this.i1 + this.i2, 0, (((int)this.framewidth) - this.i1) - this.i2, (int)this.frameheight);
                            this.tx描画用.vcScaleRatio.X = this.ratio1;
                            this.tx描画用.vcScaleRatio.Y = this.ratio1;
                        }


                        if (this.framewidth > 420)
                        {
                            f拡大率x = 420f / ((float)this.framewidth);
                        }
                        else
                        {
                            f拡大率x = 1f;
                        }
                        if (this.frameheight > 580)
                        {
                            f拡大率y = 580f / ((float)this.frameheight);
                        }
                        else
                        {
                            f拡大率y = 1f;
                        }
                        if (f拡大率x > f拡大率y)
                        {
                            f拡大率x = f拡大率y;
                        }
                        else
                        {
                            f拡大率y = f拡大率x;
                        }

                        this.smallvc = new Vector3(f拡大率x, f拡大率y, 1f);
                        this.vclip   = new Vector3(1.42f, 1.42f, 1f);
                    }
                }
            }
        }