Exemplo n.º 1
0
 public void ResetMedia()
 {
     if (mediaSeeking != null)
     {
         mediaSeeking.SetPositions(DsLong.FromInt64(0), AMSeekingSeekingFlags.AbsolutePositioning, null, AMSeekingSeekingFlags.NoPositioning);
     }
 }
Exemplo n.º 2
0
        private void DoSetRate(double newRate)
        {
            int           hr;
            IMediaControl mc = (IMediaControl)currentFilterGraph;

            // Stop
            hr = mc.Stop();
            DsError.ThrowExceptionForHR(hr);
            // Stop ASFWriter
            hr = currentOutputFilter.Stop();
            DsError.ThrowExceptionForHR(hr);

            if (UsingSBEFilter)
            {
                IStreamBufferMediaSeeking mSeek = (IStreamBufferMediaSeeking)currentSBEfilter;
                DsLong lDouble = DsLong.FromInt64(Convert.ToInt64(newRate));
                hr = mSeek.SetRate(lDouble);
                DsError.ThrowExceptionForHR(hr);
            }
            else
            {
                // IMediaSeeking is used on the filter graph which distributes the calls
                IMediaSeeking mSeek = (IMediaSeeking)currentFilterGraph;
                hr = mSeek.SetRate(newRate);
                DsError.ThrowExceptionForHR(hr);
            }

            // Start ASF
            hr = currentOutputFilter.Run(0);
            DsError.ThrowExceptionForHR(hr);
            // Run again
            hr = mc.Run();
            DsError.ThrowExceptionForHR(hr);
        }
Exemplo n.º 3
0
        public void t再生位置を変更(double db再生位置ms)
        {
            if (this.MediaSeeking == null)
            {
                return;
            }

            int hr = this.MediaSeeking.SetPositions(
                DsLong.FromInt64((long)(db再生位置ms * 1000.0 * 10.0)),
                AMSeekingSeekingFlags.AbsolutePositioning,
                null,
                AMSeekingSeekingFlags.NoPositioning);

            DsError.ThrowExceptionForHR(hr);
        }
Exemplo n.º 4
0
        private void trackBar_ValueChanged(object sender, EventArgs e)
        {
            if (updating)
            {
                return;
            }

            updating = true;

            if (mediaSeeking != null && (seekingCapabilities & AMSeekingSeekingCapabilities.CanSeekAbsolute) != 0)
            {
                mediaSeeking.SetPositions(DsLong.FromInt64(trackBar.Value * timeScalingFactor), AMSeekingSeekingFlags.AbsolutePositioning, null, AMSeekingSeekingFlags.NoPositioning);
            }

            updating = false;
        }
Exemplo n.º 5
0
        // Set the position of the graph to a specified TimeSpan
        protected void SeekGraphToTime(TimeSpan seekTime)
        {
            SendDebugMessage("Seeking graph to time...");
            int           hr;
            IMediaControl mc = (IMediaControl)currentFilterGraph;
            // Stop graph if not stopped
            FilterState fs;

            mc.GetState(50, out fs);
            if (fs != FilterState.Stopped)
            {
                if (fs != FilterState.Stopped)
                {
                    mc.Stop();
                }
            }

            long   timeInSeconds          = (long)seekTime.TotalSeconds;
            DsLong dsTimeIn100NanoSeconds = DsLong.FromInt64(timeInSeconds * 10000000);

            SendDebugMessage("Setting position to " + dsTimeIn100NanoSeconds.ToInt64().ToString());
            long pos;

            if (UsingSBEFilter)
            {
                // IStreamBufferMediaSeeking is used directly on the source filter   http://msdn.microsoft.com/en-us/library/dd694950(v=vs.85).aspx
                IStreamBufferMediaSeeking mSeek = (IStreamBufferMediaSeeking)currentSBEfilter;
                hr = mSeek.SetPositions(dsTimeIn100NanoSeconds, AMSeekingSeekingFlags.AbsolutePositioning, 0, AMSeekingSeekingFlags.NoPositioning);
                DsError.ThrowExceptionForHR(hr);
                mSeek.GetCurrentPosition(out pos);
            }
            else
            {
                // IMediaSeeking is used on the filter graph which distributes the calls
                IMediaSeeking mSeek = (IMediaSeeking)currentFilterGraph;
                hr = mSeek.SetPositions(dsTimeIn100NanoSeconds, AMSeekingSeekingFlags.AbsolutePositioning, 0, AMSeekingSeekingFlags.NoPositioning);
                DsError.ThrowExceptionForHR(hr);
                mSeek.GetCurrentPosition(out pos);
            }

            SendDebugMessage("New pos is " + pos.ToString());
        }
Exemplo n.º 6
0
        // Seeking - Experimental, non-functional
        private void DoSeekToTime(TimeSpan seekTime)
        {
            int           hr;
            IMediaControl mc = (IMediaControl)currentFilterGraph;

            // Stop
            hr = mc.Stop();
            DsError.ThrowExceptionForHR(hr);
            // Stop ASFWriter
            hr = currentOutputFilter.Stop();
            DsError.ThrowExceptionForHR(hr);
            // Seek
            Int64  seekTimeNanoSeconds = Convert.ToInt64(seekTime.TotalSeconds * 10000000);
            DsLong dsTime = DsLong.FromInt64(seekTimeNanoSeconds);

            if (UsingSBEFilter)
            {
                IStreamBufferMediaSeeking mSeek = (IStreamBufferMediaSeeking)currentSBEfilter;  // StreamBufferMediaSeeking is used on the Source Filter, NOT the graph - see MSDN
                hr = mSeek.SetPositions(dsTime, AMSeekingSeekingFlags.AbsolutePositioning, 0, AMSeekingSeekingFlags.NoPositioning);
                DsError.ThrowExceptionForHR(hr);
            }
            else
            {
                // IMediaSeeking is used on the filter graph which distributes the calls
                IMediaSeeking mSeek = (IMediaSeeking)currentFilterGraph;
                hr = mSeek.SetPositions(dsTime, AMSeekingSeekingFlags.AbsolutePositioning, 0, AMSeekingSeekingFlags.NoPositioning);
                DsError.ThrowExceptionForHR(hr);
            }


            // Start ASF
            hr = currentOutputFilter.Run(0);
            DsError.ThrowExceptionForHR(hr);
            // Run again
            hr = mc.Run();
            DsError.ThrowExceptionForHR(hr);
        }
Exemplo n.º 7
0
        public void tReset()
        {
            if (this.dsBGV != null)
            {
                if (this.dsBGV.dshow != null)
                {
                    this.dsBGV.dshow.MediaSeeking.SetPositions(
                        DsLong.FromInt64((long)(0)),
                        AMSeekingSeekingFlags.AbsolutePositioning,
                        null,
                        AMSeekingSeekingFlags.NoPositioning);
                    this.dsBGV.dshow.MediaCtrl.Stop();
                }
            }
            if (this.tx描画用 != null && this.tx窓描画用 != null)
            {
                //2016.12.22 kairera0467 解放→生成というのもどうなのだろうか...
                TJAPlayer3.t安全にDisposeする(ref this.tx描画用);
                TJAPlayer3.t安全にDisposeする(ref this.tx窓描画用);

                this.tx描画用  = new CTexture(TJAPlayer3.app.Device, 1280, 720, TJAPlayer3.app.GraphicsDeviceManager.CurrentSettings.BackBufferFormat, Pool.Managed);
                this.tx窓描画用 = new CTexture(TJAPlayer3.app.Device, 1280, 720, TJAPlayer3.app.GraphicsDeviceManager.CurrentSettings.BackBufferFormat, Pool.Managed);
            }
        }
Exemplo n.º 8
0
        public unsafe int t進行描画(int x, int y)
        {
            if (!base.b活性化してない)
            {
                Rectangle rectangle;
                Rectangle rectangle2;
                if (!this.bDShowクリップを再生している || (this.dsBGV.dshow == null || this.dsBGV == null))
                {
                    if (((this.n移動開始時刻ms == -1) || (this.rAVI == null)) || (this.rAVI.avi == null))
                    {
                        return(0);
                    }
                }
                if (this.tx描画用 == null)
                {
                    return(0);
                }
                int time            = (int)((CSound管理.rc演奏用タイマ.n現在時刻 - this.n移動開始時刻ms) * (((double)TJAPlayer3.ConfigIni.n演奏速度) / 20.0));
                int frameNoFromTime = 0;

                #region [ frameNoFromTime ]
                if ((this.dsBGV != null))
                {
                    if (this.fAVIアスペクト比 > 1.77f)
                    {
                        this.dsBGV.dshow.MediaSeeking.GetPositions(out this.lDshowPosition, out this.lStopPosition);
                        frameNoFromTime = (int)lDshowPosition;
                    }
                    else
                    {
                        frameNoFromTime = this.rAVI.avi.GetFrameNoFromTime(time);
                    }
                }
                #endregion

                if ((this.n総移動時間ms != 0) && (this.n総移動時間ms < time))
                {
                    this.n総移動時間ms  = 0;
                    this.n移動開始時刻ms = -1;
                    return(0);
                }

                //2014.11.17 kairera0467 AVIが無い状態でAVIのフレームカウントをさせるとエラーを吐くため、かなり雑ではあるが対策。
                if ((this.n総移動時間ms == 0) && this.rAVI.avi != null ? (frameNoFromTime >= this.rAVI.avi.GetMaxFrameCount()) : false)
                {
                    this.n移動開始時刻ms = -1L;
                }
                if ((((this.n前回表示したフレーム番号 != frameNoFromTime) || !this.bフレームを作成した)) && (fAVIアスペクト比 < 1.77f))
                {
                    this.pBmp          = this.rAVI.avi.GetFramePtr(frameNoFromTime);
                    this.n前回表示したフレーム番号 = frameNoFromTime;
                    this.bフレームを作成した    = true;
                }

                //ループ防止
                if (this.lDshowPosition >= this.lStopPosition && this.dsBGV != null)
                {
                    this.dsBGV.dshow.MediaSeeking.SetPositions(
                        DsLong.FromInt64((long)(0)),
                        AMSeekingSeekingFlags.AbsolutePositioning,
                        null,
                        AMSeekingSeekingFlags.NoPositioning);
                    this.dsBGV.dshow.MediaCtrl.Stop();
                    this.bDShowクリップを再生している = false;
                }

                #region [ フレーム幅 ]
                //uintじゃなくてint。DTXHDでは無駄に変換してたね。
                int nフレーム幅  = 0;
                int nフレーム高さ = 0;

                if (this.dsBGV != null)
                {
                    nフレーム幅  = this.dsBGV.dshow.n幅px;
                    nフレーム高さ = this.dsBGV.dshow.n高さpx;
                }
                else if (this.rAVI != null || this.rAVI.avi != null)
                {
                    nフレーム幅  = (int)this.rAVI.avi.nフレーム幅;
                    nフレーム高さ = (int)this.rAVI.avi.nフレーム高さ;
                }
                #endregion

                //2014.11.17 kairera0467 フレーム幅をrAVIから参照していたため、先にローカル関数で決めるよう変更。
                Size  szフレーム幅   = new Size(nフレーム幅, nフレーム高さ);
                Size  sz最大フレーム幅 = new Size(1280, 720);
                Size  size3     = new Size(this.n開始サイズW, this.n開始サイズH);
                Size  size4     = new Size(this.n終了サイズW, this.n終了サイズH);
                Point location  = new Point(this.n画像側開始位置X, this.n画像側終了位置Y);
                Point point2    = new Point(this.n画像側終了位置X, this.n画像側終了位置Y);
                Point point3    = new Point(this.n表示側開始位置X, this.n表示側開始位置Y);
                Point point4    = new Point(this.n表示側終了位置X, this.n表示側終了位置Y);
                long  num3      = this.n総移動時間ms;
                long  num4      = this.n移動開始時刻ms;
                if (CSound管理.rc演奏用タイマ.n現在時刻 < num4)
                {
                    num4 = CSound管理.rc演奏用タイマ.n現在時刻;
                }
                time = (int)((CSound管理.rc演奏用タイマ.n現在時刻 - num4) * (((double)TJAPlayer3.ConfigIni.n演奏速度) / 20.0));
                if (num3 == 0)
                {
                    rectangle  = new Rectangle(location, size3);
                    rectangle2 = new Rectangle(point3, size3);
                }
                else
                {
                    double num5  = ((double)time) / ((double)num3);
                    Size   size5 = new Size(size3.Width + ((int)((size4.Width - size3.Width) * num5)), size3.Height + ((int)((size4.Height - size3.Height) * num5)));
                    rectangle  = new Rectangle((int)((point2.X - location.X) * num5), (int)((point2.Y - location.Y) * num5), ((int)((point2.X - location.X) * num5)) + size5.Width, ((int)((point2.Y - location.Y) * num5)) + size5.Height);
                    rectangle2 = new Rectangle((int)((point4.X - point3.X) * num5), (int)((point4.Y - point3.Y) * num5), ((int)((point4.X - point3.X) * num5)) + size5.Width, ((int)((point4.Y - point3.Y) * num5)) + size5.Height);
                    if (((rectangle.Right <= 0) || (rectangle.Bottom <= 0)) || ((rectangle.Left >= szフレーム幅.Width) || (rectangle.Top >= szフレーム幅.Height)))
                    {
                        return(0);
                    }
                    if (((rectangle2.Right <= 0) || (rectangle2.Bottom <= 0)) || ((rectangle2.Left >= sz最大フレーム幅.Width) || (rectangle2.Top >= sz最大フレーム幅.Height)))
                    {
                        return(0);
                    }
                    if (rectangle.X < 0)
                    {
                        int num6 = -rectangle.X;
                        rectangle2.X     += num6;
                        rectangle2.Width -= num6;
                        rectangle.X       = 0;
                        rectangle.Width  -= num6;
                    }
                    if (rectangle.Y < 0)
                    {
                        int num7 = -rectangle.Y;
                        rectangle2.Y      += num7;
                        rectangle2.Height -= num7;
                        rectangle.Y        = 0;
                        rectangle.Height  -= num7;
                    }
                    if (rectangle.Right > szフレーム幅.Width)
                    {
                        int num8 = rectangle.Right - szフレーム幅.Width;
                        rectangle2.Width -= num8;
                        rectangle.Width  -= num8;
                    }
                    if (rectangle.Bottom > szフレーム幅.Height)
                    {
                        int num9 = rectangle.Bottom - szフレーム幅.Height;
                        rectangle2.Height -= num9;
                        rectangle.Height  -= num9;
                    }
                    if (rectangle2.X < 0)
                    {
                        int num10 = -rectangle2.X;
                        rectangle.X      += num10;
                        rectangle.Width  -= num10;
                        rectangle2.X      = 0;
                        rectangle2.Width -= num10;
                    }
                    if (rectangle2.Y < 0)
                    {
                        int num11 = -rectangle2.Y;
                        rectangle.Y       += num11;
                        rectangle.Height  -= num11;
                        rectangle2.Y       = 0;
                        rectangle2.Height -= num11;
                    }
                    if (rectangle2.Right > sz最大フレーム幅.Width)
                    {
                        int num12 = rectangle2.Right - sz最大フレーム幅.Width;
                        rectangle.Width  -= num12;
                        rectangle2.Width -= num12;
                    }
                    if (rectangle2.Bottom > sz最大フレーム幅.Height)
                    {
                        int num13 = rectangle2.Bottom - sz最大フレーム幅.Height;
                        rectangle.Height  -= num13;
                        rectangle2.Height -= num13;
                    }
                    if ((rectangle.X >= rectangle.Right) || (rectangle.Y >= rectangle.Bottom))
                    {
                        return(0);
                    }
                    if ((rectangle2.X >= rectangle2.Right) || (rectangle2.Y >= rectangle2.Bottom))
                    {
                        return(0);
                    }
                    if (((rectangle.Right < 0) || (rectangle.Bottom < 0)) || ((rectangle.X > szフレーム幅.Width) || (rectangle.Y > szフレーム幅.Height)))
                    {
                        return(0);
                    }
                    if (((rectangle2.Right < 0) || (rectangle2.Bottom < 0)) || ((rectangle2.X > sz最大フレーム幅.Width) || (rectangle2.Y > sz最大フレーム幅.Height)))
                    {
                        return(0);
                    }
                }
                if ((this.tx描画用 != null))
                {
                    if ((this.bDShowクリップを再生している == true) && this.dsBGV.dshow != null)
                    {
                        #region [ ワイドクリップ ]
                        this.dsBGV.dshow.t現時点における最新のスナップイメージをTextureに転写する(this.tx描画用);
                        this.dsBGV.dshow.t現時点における最新のスナップイメージをTextureに転写する(this.tx窓描画用);

                        if (TJAPlayer3.ConfigIni.eClipDispType == EClipDispType.背景のみ || TJAPlayer3.ConfigIni.eClipDispType == EClipDispType.両方)
                        {
                            if (this.dsBGV.dshow.b上下反転)
                            {
                                this.tx描画用.t2D上下反転描画(TJAPlayer3.app.Device, x, y);
                            }
                            else
                            {
                                this.tx描画用.t2D描画(TJAPlayer3.app.Device, x, y);
                            }
                        }
                        #endregion
                    }
                }
                else if ((this.tx描画用 != null) && (this.n総移動時間ms != -1))
                {
                    if (this.bフレームを作成した && (this.pBmp != IntPtr.Zero))
                    {
                        DataRectangle rectangle3 = this.tx描画用.texture.LockRectangle(0, LockFlags.None);
                        DataStream    data       = rectangle3.Data;
                        int           num14      = rectangle3.Pitch / this.tx描画用.szテクスチャサイズ.Width;
                        BitmapUtil.BITMAPINFOHEADER *pBITMAPINFOHEADER = (BitmapUtil.BITMAPINFOHEADER *) this.pBmp.ToPointer();
                        if (pBITMAPINFOHEADER->biBitCount == 0x18)
                        {
                            switch (num14)
                            {
                            case 2:
                                this.rAVI.avi.tBitmap24ToGraphicsStreamR5G6B5(pBITMAPINFOHEADER, data, this.tx描画用.szテクスチャサイズ.Width, this.tx描画用.szテクスチャサイズ.Height);
                                break;

                            case 4:
                                this.rAVI.avi.tBitmap24ToGraphicsStreamX8R8G8B8(pBITMAPINFOHEADER, data, this.tx描画用.szテクスチャサイズ.Width, this.tx描画用.szテクスチャサイズ.Height);
                                break;
                            }
                        }
                        this.tx描画用.texture.UnlockRectangle(0);
                        this.bフレームを作成した = false;
                    }
                    double dbAVI比率 = this.rAVI.avi.nフレーム幅 / this.rAVI.avi.nフレーム高さ;

                    //とりあえず16:9以外は再生しない。
                    if (dbAVI比率 < 1.77)
                    {
                        this.tx描画用.t2D描画(TJAPlayer3.app.Device, 0, 0);
                    }
                }

                #region [キー入力処理]
                //IInputDevice keyboard = CDTXMania.Input管理.Keyboard;
                //if ( keyboard.bキーが押された( (int) SlimDX.DirectInput.Key.F1 ) &&
                //    ( keyboard.bキーが押されている( (int) SlimDX.DirectInput.Key.RightShift ) || keyboard.bキーが押されている( (int) SlimDX.DirectInput.Key.LeftShift ) ) )
                //{
                //    if( this.b再生トグル == true )
                //    {
                //        if( this.dsBGV != null )
                //        {
                //            if( this.dsBGV.dshow != null )
                //                this.dsBGV.dshow.MediaCtrl.Pause();
                //        }
                //        this.b再生トグル = true;
                //    }
                //    else if( this.b再生トグル == false )
                //    {
                //        if(this.dsBGV != null )
                //        {
                //            if( this.dsBGV.dshow != null )
                //                this.dsBGV.dshow.MediaCtrl.Run();
                //        }
                //        this.b再生トグル = false;
                //    }
                //}
                #endregion
            }
            return(0);
        }
Exemplo n.º 9
0
        public override int OnUpdateAndDraw()
        {
            if (!base.bNotActivated)
            {
                int num;
                if (base.bJustStartedUpdate)
                {
                    this.ct登場用 = new CCounter(0, 100, 5, CDTXMania.Timer);

                    //Check result to select the correct sound to play
                    int  l_outputSoundEnum = 0;                    //0: Stage Clear 1: FC 2: EXC
                    bool l_newRecord       = false;
                    for (int i = 0; i < 3; i++)
                    {
                        if ((((i != 0) || (CDTXMania.DTX.bチップがある.Drums && !CDTXMania.ConfigIni.bGuitarRevolutionMode)) &&
                             ((i != 1) || (CDTXMania.DTX.bチップがある.Guitar && CDTXMania.ConfigIni.bGuitarRevolutionMode))) &&
                            ((i != 2) || (CDTXMania.DTX.bチップがある.Bass && CDTXMania.ConfigIni.bGuitarRevolutionMode)))
                        {
                            if (bAuto[i] == false)
                            {
                                if (fPerfect率[i] == 100.0)
                                {
                                    l_outputSoundEnum = 2;                                     //Excellent
                                }
                                else if (fPoor率[i] == 0.0 && fMiss率[i] == 0.0)
                                {
                                    l_outputSoundEnum = 1;                                     //Full Combo
                                }
                            }

                            if (this.bNewRecordSkill[i] == true)
                            {
                                l_newRecord = true;
                            }
                        }
                    }

                    //Play the corresponding sound
                    if (l_outputSoundEnum == 1)
                    {
                        CDTXMania.Skin.soundFullCombo.tPlay();
                    }
                    else if (l_outputSoundEnum == 2)
                    {
                        CDTXMania.Skin.soundExcellent.tPlay();
                    }
                    else
                    {
                        CDTXMania.Skin.soundStageClear.tPlay();
                    }

                    //Create the delay timer of 150 x 10 = 1500 ms to play New Record
                    if (l_newRecord)
                    {
                        this.ctPlayNewRecord = new CCounter(0, 150, 10, CDTXMania.Timer);
                    }

                    this.actFI.tフェードイン開始(false);
                    base.ePhaseID           = CStage.EPhase.Common_FadeIn;
                    base.bJustStartedUpdate = false;
                }
                if (this.ds背景動画 != null)
                {
                    this.ds背景動画.t再生開始();
                    this.ds背景動画.MediaSeeking.GetPositions(out this.lDshowPosition, out this.lStopPosition);
                    this.ds背景動画.bループ再生 = true;

                    if (this.lDshowPosition == this.lStopPosition)
                    {
                        this.ds背景動画.MediaSeeking.SetPositions(
                            DsLong.FromInt64((long)(0)),
                            AMSeekingSeekingFlags.AbsolutePositioning,
                            0,
                            AMSeekingSeekingFlags.NoPositioning);
                    }

                    this.ds背景動画.t現時点における最新のスナップイメージをTextureに転写する(this.txBackground);
                }
                this.bAnimationComplete = true;
                if (this.ct登場用.b進行中)
                {
                    this.ct登場用.tUpdate();
                    if (this.ct登場用.bReachedEndValue)
                    {
                        this.ct登場用.tStop();
                    }
                    else
                    {
                        this.bAnimationComplete = false;
                    }
                }

                //Play new record if available
                if (this.ctPlayNewRecord != null && this.ctPlayNewRecord.b進行中)
                {
                    this.ctPlayNewRecord.tUpdate();
                    if (this.ctPlayNewRecord.bReachedEndValue)
                    {
                        CDTXMania.Skin.soundNewRecord.tPlay();
                        this.ctPlayNewRecord.tStop();
                    }
                }

                // 描画

                if (this.txBackground != null)
                {
                    if (this.ds背景動画 != null && this.ds背景動画.b上下反転)
                    {
                        this.txBackground.tDraw2DUpsideDown(CDTXMania.app.Device, 0, 0);
                    }
                    else
                    {
                        this.txBackground.tDraw2D(CDTXMania.app.Device, 0, 0);
                    }
                }
                if (this.ct登場用.b進行中 && (this.txTopPanel != null))
                {
                    double num2 = ((double)this.ct登場用.nCurrentValue) / 100.0;
                    double num3 = Math.Sin(Math.PI / 2 * num2);
                    num = ((int)(this.txTopPanel.szImageSize.Height * num3)) - this.txTopPanel.szImageSize.Height;
                }
                else
                {
                    num = 0;
                }
                if (this.txTopPanel != null)
                {
                    this.txTopPanel.tDraw2D(CDTXMania.app.Device, 0, num);
                }
                if (this.txBottomPanel != null)
                {
                    this.txBottomPanel.tDraw2D(CDTXMania.app.Device, 0, 720 - this.txBottomPanel.szImageSize.Height);
                }
                if (this.actResultImage.OnUpdateAndDraw() == 0)
                {
                    this.bAnimationComplete = false;
                }
                if (this.actParameterPanel.OnUpdateAndDraw() == 0)
                {
                    this.bAnimationComplete = false;
                }
                if (this.actRank.OnUpdateAndDraw() == 0)
                {
                    this.bAnimationComplete = false;
                }
                if (base.ePhaseID == CStage.EPhase.Common_FadeIn)
                {
                    if (this.actFI.OnUpdateAndDraw() != 0)
                    {
                        base.ePhaseID = CStage.EPhase.Common_DefaultState;
                    }
                }
                else if ((base.ePhaseID == CStage.EPhase.Common_FadeOut))                                       //&& ( this.actFO.OnUpdateAndDraw() != 0 ) )
                {
                    return((int)this.eReturnValueWhenFadeOutCompleted);
                }
                #region [ #24609 2011.3.14 yyagi ランク更新or演奏型スキル更新時、リザルト画像をpngで保存する ]
                if (this.bAnimationComplete == true && this.bIsCheckedWhetherResultScreenShouldSaveOrNot == false &&                    // #24609 2011.3.14 yyagi; to save result screen in case BestRank or HiSkill.
                    CDTXMania.ConfigIni.bScoreIniを出力する &&
                    CDTXMania.ConfigIni.bIsAutoResultCapture)                                                                           // #25399 2011.6.9 yyagi
                {
                    CheckAndSaveResultScreen(true);
                    this.bIsCheckedWhetherResultScreenShouldSaveOrNot = true;
                }
                #endregion

                // キー入力

                if (CDTXMania.actPluginOccupyingInput == null)
                {
                    if (CDTXMania.ConfigIni.bドラム打音を発声する && CDTXMania.ConfigIni.bDrumsEnabled)
                    {
                        for (int i = 0; i < 11; i++)
                        {
                            List <STInputEvent> events = CDTXMania.Pad.GetEvents(EInstrumentPart.DRUMS, (EPad)i);
                            if ((events != null) && (events.Count > 0))
                            {
                                foreach (STInputEvent event2 in events)
                                {
                                    if (!event2.b押された)
                                    {
                                        continue;
                                    }
                                    CDTX.CChip rChip = this.rEmptyDrumChip[i];
                                    if (rChip == null)
                                    {
                                        switch (((EPad)i))
                                        {
                                        case EPad.HH:
                                            rChip = this.rEmptyDrumChip[7];
                                            if (rChip == null)
                                            {
                                                rChip = this.rEmptyDrumChip[9];
                                            }
                                            break;

                                        case EPad.FT:
                                            rChip = this.rEmptyDrumChip[4];
                                            break;

                                        case EPad.CY:
                                            rChip = this.rEmptyDrumChip[8];
                                            break;

                                        case EPad.HHO:
                                            rChip = this.rEmptyDrumChip[0];
                                            if (rChip == null)
                                            {
                                                rChip = this.rEmptyDrumChip[9];
                                            }
                                            break;

                                        case EPad.RD:
                                            rChip = this.rEmptyDrumChip[6];
                                            break;

                                        case EPad.LC:
                                            rChip = this.rEmptyDrumChip[0];
                                            if (rChip == null)
                                            {
                                                rChip = this.rEmptyDrumChip[7];
                                            }
                                            break;
                                        }
                                    }
                                    if (((rChip != null) && (rChip.nChannelNumber >= 0x11)) && (rChip.nChannelNumber <= 0x1b))
                                    {
                                        int nLane = this.nチャンネル0Atoレーン07[rChip.nChannelNumber - 0x11];
                                        if ((nLane == 1) && ((rChip.nChannelNumber == 0x11) || ((rChip.nChannelNumber == 0x18) && (this.n最後に再生したHHのチャンネル番号 != 0x18))))
                                        {
                                            CDTXMania.DTX.tStopPlayingWav(this.n最後に再生したHHのWAV番号);
                                            this.n最後に再生したHHのWAV番号   = rChip.nIntegerValue_InternalNumber;
                                            this.n最後に再生したHHのチャンネル番号 = rChip.nChannelNumber;
                                        }
                                        CDTXMania.DTX.tPlayChip(rChip, CDTXMania.Timer.nシステム時刻, nLane, CDTXMania.ConfigIni.n手動再生音量, CDTXMania.ConfigIni.b演奏音を強調する.Drums);
                                    }
                                }
                            }
                        }
                    }
                    if (((CDTXMania.Pad.bPressedDGB(EPad.CY) || CDTXMania.Pad.bPressed(EInstrumentPart.DRUMS, EPad.RD)) || (CDTXMania.Pad.bPressed(EInstrumentPart.DRUMS, EPad.LC) || CDTXMania.InputManager.Keyboard.bKeyPressed((int)SlimDXKey.Return))) && !this.bAnimationComplete)
                    {
                        this.actFI.tフェードイン完了();                                                         // #25406 2011.6.9 yyagi
                        this.actResultImage.tアニメを完了させる();
                        this.actParameterPanel.tアニメを完了させる();
                        this.actRank.tアニメを完了させる();
                        this.ct登場用.tStop();
                    }
                    #region [ #24609 2011.4.7 yyagi リザルト画面で[F12]を押下すると、リザルト画像をpngで保存する機能は、CDTXManiaに移管。 ]
//					if ( CDTXMania.InputManager.Keyboard.bKeyPressed( (int) SlimDXKey.F12 ) &&
//						CDTXMania.ConfigIni.bScoreIniを出力する )
//					{
//						CheckAndSaveResultScreen(false);
//						this.bIsCheckedWhetherResultScreenShouldSaveOrNot = true;
//					}
                    #endregion
                    if (base.ePhaseID == CStage.EPhase.Common_DefaultState)
                    {
                        if (CDTXMania.InputManager.Keyboard.bKeyPressed((int)SlimDXKey.Escape))
                        {
                            CDTXMania.Skin.soundCancel.tPlay();
                            this.actFO.tStartFadeOut();
                            base.ePhaseID = CStage.EPhase.Common_FadeOut;
                            this.eReturnValueWhenFadeOutCompleted = EReturnValue.Complete;
                        }
                        if (((CDTXMania.Pad.bPressedDGB(EPad.CY) || CDTXMania.Pad.bPressed(EInstrumentPart.DRUMS, EPad.RD)) || (CDTXMania.Pad.bPressed(EInstrumentPart.DRUMS, EPad.LC) || CDTXMania.InputManager.Keyboard.bKeyPressed((int)SlimDXKey.Return))) && this.bAnimationComplete)
                        {
                            CDTXMania.Skin.soundCancel.tPlay();
                            base.ePhaseID = CStage.EPhase.Common_FadeOut;
                            this.eReturnValueWhenFadeOutCompleted = EReturnValue.Complete;
                        }
                    }
                }
            }
            return(0);
        }