示例#1
0
        public virtual void Update()
        {
            if (_Fading != null)
            {
                bool finished;
                Volume = _Fading.GetValue(out finished);
                if (finished)
                {
                    switch (_AfterFadeAction)
                    {
                    case EStreamAction.Close:
                        Close();
                        break;

                    case EStreamAction.Stop:
                        Stop();
                        break;

                    case EStreamAction.Pause:
                        IsPaused = true;
                        break;
                    }
                    _Fading = null;
                }
            }
        }
示例#2
0
 public CTextureRef GetVideoTexture()
 {
     if (_Video == null || _Song == null)
     {
         return(null);
     }
     if (CBase.Video.GetFrame(_Video, CBase.Sound.GetPosition(_StreamID)))
     {
         if (_VideoFading != null)
         {
             bool finished;
             _Video.Texture.Color.A = _VideoFading.GetValue(out finished);
             if (finished)
             {
                 _VideoFading = null;
             }
         }
         return(_Video.Texture);
     }
     return(null);
 }
示例#3
0
文件: CCursor.cs 项目: da-ka/Vocaluxe
        public void Draw()
        {
            if (_Movetimer.ElapsedMilliseconds > CSettings.MouseMoveOffTime)
            {
                Deactivate();
            }

            if (_Fading != null)
            {
                bool finished;
                _Cursor.Color.A = _Fading.GetValue(out finished);
                if (finished)
                {
                    _Fading = null;
                }
            }

            if (Visible && (CSettings.ProgramState == EProgramState.EditTheme || ShowCursor))
            {
                CDraw.DrawTexture(_Cursor);
            }
        }
示例#4
0
        public static bool Draw()
        {
            if (NextScreen != null && _Fading == null)
            {
                _Fading = new CFading(0f, 1f, CConfig.Config.Graphics.FadeTime);

                if (NextScreen.PartyModeID != -1)
                {
                    CFonts.PartyModeID = NextScreen.PartyModeID;
                    NextScreen.OnShow();
                    CFonts.PartyModeID = -1;
                }
                else
                {
                    NextScreen.OnShow();
                }
                if (_Cursor.IsActive)
                {
                    NextScreen.ProcessMouseMove(_Cursor.X, _Cursor.Y);
                }

                HidePopup(EPopupScreens.PopupPlayerControl);
                if (NextScreen.CurrentMusicType != EMusicType.Background && NextScreen.CurrentMusicType != EMusicType.Preview && NextScreen.CurrentMusicType != EMusicType.BackgroundPreview)
                {
                    CBackgroundMusic.Disabled = true;
                }
            }

            if (_Fading != null)
            {
                Debug.Assert(NextScreen != null);
                bool  finished;
                float newAlpha = _Fading.GetValue(out finished);

                if (!finished)
                {
                    ZOffset = CSettings.ZFar / 2;
                    _DrawScreen(CurrentScreen);

                    GlobalAlpha = newAlpha;
                    ZOffset     = 0f;
                    _DrawScreen(NextScreen);

                    GlobalAlpha = 1f;
                    int oldVol = CConfig.GetVolumeByType(CurrentScreen.CurrentMusicType);
                    int newVol = CConfig.GetVolumeByType(NextScreen.CurrentMusicType);
                    CSound.SetGlobalVolume((int)((newVol - oldVol) * newAlpha + oldVol));
                }
                else
                {
                    _FinishScreenFading();
                    if (_Cursor.IsActive)
                    {
                        CurrentScreen.ProcessMouseMove(_Cursor.X, _Cursor.Y);
                    }

                    _DrawScreen(CurrentScreen);
                }
            }
            else
            {
                _DrawScreen(CurrentScreen);
            }

            foreach (IMenu popup in _PopupScreens)
            {
                popup.Draw();
            }

            _Cursor.Draw();
            _DrawDebugInfos();

            return(true);
        }