Ejemplo n.º 1
0
        public override bool UpdateGame()
        {
            _CheckStartIntroVideos();

            bool next = CConfig.Config.Theme.CoverLoading != ECoverLoading.TR_CONFIG_COVERLOADING_ATSTART || CSongs.CoverLoaded;

            if ((_IntroOutPlayed || _SkipIntro) && next && CSettings.ProgramState == EProgramState.Start && CSongs.SongsLoaded)
            {
                CSettings.ProgramState = EProgramState.Normal;
                CGraphics.FadeTo(EScreen.Main);
            }

            _Texts[_TextStatus].Text =
                CLanguage.Translate("TR_SCREENLOAD_TOTAL") + ": " + CSongs.NumAllSongs + " " +
                CLanguage.Translate("TR_SCREENLOAD_SONGS") + " (" + CSongs.NumSongsWithCoverLoaded + " " +
                CLanguage.Translate("TR_SCREENLOAD_LOADED") + ")";

            if (CSongs.SongsLoaded && !CBackgroundMusic.OwnSongsAvailable)
            {
                CBackgroundMusic.OwnSongsAvailable = true;

                if (CConfig.Config.Video.VideoBackgrounds == EOffOn.TR_CONFIG_ON || CConfig.Config.Video.VideosToBackground == EOffOn.TR_CONFIG_ON)
                {
                    CBackgroundMusic.VideoEnabled = true;
                }

                CBackgroundMusic.Play();
            }

            return(true);
        }
Ejemplo n.º 2
0
        public override bool HandleInput(KeyEvent KeyEvent)
        {
            base.HandleInput(KeyEvent);
            if (KeyEvent.KeyPressed && !Char.IsControl(KeyEvent.Unicode))
            {
            }
            else
            {
                switch (KeyEvent.Key)
                {
                case Keys.Escape:
                case Keys.Back:
                    CGraphics.HidePopup(EPopupScreens.PopupPlayerControl);
                    return(false);

                case Keys.Enter:
                    if (Buttons[htButtons(ButtonNext)].Selected)
                    {
                        CBackgroundMusic.Next();
                    }
                    if (Buttons[htButtons(ButtonPrevious)].Selected)
                    {
                        CBackgroundMusic.Previous();
                    }
                    if (Buttons[htButtons(ButtonPlay)].Selected)
                    {
                        CBackgroundMusic.Play();
                    }
                    if (Buttons[htButtons(ButtonPause)].Selected)
                    {
                        CBackgroundMusic.Pause();
                    }
                    if (Buttons[htButtons(ButtonRepeat)].Selected)
                    {
                        CBackgroundMusic.RepeatSong = !CBackgroundMusic.RepeatSong;
                    }
                    if (Buttons[htButtons(ButtonShowVideo)].Selected)
                    {
                        VideoPreview = !VideoPreview;
                    }
                    if (Buttons[htButtons(ButtonSing)].Selected)
                    {
                        StartSong(CBackgroundMusic.SongID, CBackgroundMusic.Duet);
                    }
                    if (Buttons[htButtons(ButtonToBackgroundVideo)].Selected)
                    {
                        VideoBackground = !VideoBackground;
                    }
                    break;
                }
            }

            return(true);
        }
Ejemplo n.º 3
0
 public override bool HandleMouse(MouseEvent MouseEvent)
 {
     base.HandleMouse(MouseEvent);
     if (MouseEvent.LB && IsMouseOver(MouseEvent))
     {
         if (Buttons[htButtons(ButtonNext)].Selected)
         {
             CBackgroundMusic.Next();
         }
         if (Buttons[htButtons(ButtonPrevious)].Selected)
         {
             CBackgroundMusic.Previous();
         }
         if (Buttons[htButtons(ButtonPlay)].Selected)
         {
             CBackgroundMusic.Play();
         }
         if (Buttons[htButtons(ButtonPause)].Selected)
         {
             CBackgroundMusic.Pause();
         }
         if (Buttons[htButtons(ButtonRepeat)].Selected)
         {
             CBackgroundMusic.RepeatSong = !CBackgroundMusic.RepeatSong;
         }
         if (Buttons[htButtons(ButtonShowVideo)].Selected)
         {
             VideoPreview = !VideoPreview;
         }
         if (Buttons[htButtons(ButtonSing)].Selected)
         {
             StartSong(CBackgroundMusic.SongID, CBackgroundMusic.Duet);
         }
         if (Buttons[htButtons(ButtonToBackgroundVideo)].Selected)
         {
             VideoBackground = !VideoBackground;
         }
     }
     else if (MouseEvent.LB)
     {
         //CGraphics.HidePopup(EPopupScreens.PopupPlayerControl);
         return(false);
     }
     else if (MouseEvent.RB)
     {
         //CGraphics.HidePopup(EPopupScreens.PopupPlayerControl);
         return(false);
     }
     return(true);
 }
Ejemplo n.º 4
0
 public override bool HandleMouse(SMouseEvent mouseEvent)
 {
     base.HandleMouse(mouseEvent);
     if (mouseEvent.LB && _IsMouseOverCurSelection(mouseEvent))
     {
         if (_Buttons[_ButtonNext].Selected)
         {
             CBackgroundMusic.Next();
         }
         if (_Buttons[_ButtonPrevious].Selected)
         {
             CBackgroundMusic.Previous();
         }
         if (_Buttons[_ButtonPlay].Selected)
         {
             CBackgroundMusic.Play();
         }
         if (_Buttons[_ButtonPause].Selected)
         {
             CBackgroundMusic.Pause();
         }
         if (_Buttons[_ButtonRepeat].Selected)
         {
             CBackgroundMusic.RepeatSong = !CBackgroundMusic.RepeatSong;
         }
         if (_Buttons[_ButtonShowVideo].Selected)
         {
             _VideoPreview = !_VideoPreview;
         }
         if (_Buttons[_ButtonSing].Selected)
         {
             _StartSong(CBackgroundMusic.SongID);
         }
         if (_Buttons[_ButtonToBackgroundVideo].Selected)
         {
             _VideoBackground = !_VideoBackground;
         }
     }
     else if (mouseEvent.LB)
     {
         //CGraphics.HidePopup(EPopupScreens.PopupPlayerControl);
         return(false);
     }
     else if (mouseEvent.RB)
     {
         //CGraphics.HidePopup(EPopupScreens.PopupPlayerControl);
         return(false);
     }
     return(true);
 }
Ejemplo n.º 5
0
        public override bool UpdateGame()
        {
            SongMenus[htSongMenus(SongMenu)].Update();
            Texts[htTexts(TextCategory)].Text = CSongs.GetActualCategoryName();

            int song = SongMenus[htSongMenus(SongMenu)].GetActualSelection();

            if ((CSongs.Category >= 0 || CConfig.Tabs == EOffOn.TR_CONFIG_OFF) && song >= 0 && song < CSongs.VisibleSongs.Length)
            {
                Texts[htTexts(TextSelection)].Text = CSongs.VisibleSongs[song].Artist + " - " + CSongs.VisibleSongs[song].Title;
                CBackgroundMusic.Pause();
            }
            else if (CSongs.Category == -1 && song >= 0 && song < CSongs.Categories.Length)
            {
                Texts[htTexts(TextSelection)].Text = CSongs.Categories[song].Name;
                CBackgroundMusic.Play();
            }
            else
            {
                Texts[htTexts(TextSelection)].Text = String.Empty;
            }

            Texts[htTexts(TextSearchBar)].Text = _SearchText;
            if (_SearchActive)
            {
                Texts[htTexts(TextSearchBar)].Text += '|';

                Texts[htTexts(TextSearchBar)].Visible       = true;
                Texts[htTexts(TextSearchBarTitle)].Visible  = true;
                Statics[htStatics(StaticSearchBar)].Visible = true;
            }
            else
            {
                Texts[htTexts(TextSearchBar)].Visible       = false;
                Texts[htTexts(TextSearchBarTitle)].Visible  = false;
                Statics[htStatics(StaticSearchBar)].Visible = false;
            }

            return(true);
        }
Ejemplo n.º 6
0
        public override void OnShowFinish()
        {
            base.OnShowFinish();

            if (CConfig.Config.Video.VideoBackgrounds == EOffOn.TR_CONFIG_ON)
            {
                foreach (CVideoPlayer videoPlayer in _Intros)
                {
                    videoPlayer.PreLoad();
                }
            }

            CLog.StartBenchmark("Load Songs Full");
            _SongLoaderThread = new Thread(CSongs.LoadSongs)
            {
                Name = "SongLoader", IsBackground = true
            };
            _SongLoaderThread.Start();
            CBackgroundMusic.OwnSongsAvailable = false;

            CBackgroundMusic.Play();
        }
Ejemplo n.º 7
0
        private void _SaveConfig()
        {
            CConfig.GameMusicVolume                    = _SelectSlides[_SelectSlideGameMusicVolume].Selection * 5;
            CConfig.PreviewMusicVolume                 = _SelectSlides[_SelectSlidePreviewMusicVolume].Selection * 5;
            CConfig.Config.Sound.BackgroundMusic       = (EBackgroundMusicOffOn)_SelectSlides[_SelectSlideBackgroundMusic].Selection;
            CConfig.Config.Sound.BackgroundMusicSource = (EBackgroundMusicSource)_SelectSlides[_SelectSlideBackgroundMusicSource].Selection;
            CConfig.BackgroundMusicVolume              = _SelectSlides[_SelectSlideBackgroundMusicVolume].Selection * 5;
            if (CConfig.Config.Sound.PlayBackLib == EPlaybackLib.GstreamerSharp)
            {
                CConfig.Config.Sound.KaraokeEffect = (EOffOn)_SelectSlides[_SelectSlideKaraokeEffect].Selection;
            }
            CConfig.SaveConfig();

            CBackgroundMusic.SetMusicSource(CConfig.Config.Sound.BackgroundMusicSource);
            CSound.SetGlobalVolume(CConfig.BackgroundMusicVolume);
            if (CConfig.Config.Sound.BackgroundMusic == EBackgroundMusicOffOn.TR_CONFIG_ON)
            {
                CBackgroundMusic.Play();
            }
            else
            {
                CBackgroundMusic.Stop();
            }
        }
Ejemplo n.º 8
0
        public static bool Draw()
        {
            if ((_NextScreen != EScreens.ScreenNull) && !_Fading)
            {
                _Fading = true;
                _FadingTimer.Reset();
                _FadingTimer.Start();
                _Screens[(int)_NextScreen].OnShow();
                HidePopup(EPopupScreens.PopupPlayerControl);
            }

            if (_Fading)
            {
                long FadeTime = (long)(CConfig.FadeTime * 1000);

                if ((_FadingTimer.ElapsedMilliseconds < FadeTime) && (CConfig.FadeTime > 0))
                {
                    long ms = 1;
                    if (_FadingTimer.ElapsedMilliseconds > 0)
                    {
                        ms = _FadingTimer.ElapsedMilliseconds;
                    }

                    float factor = (float)ms / FadeTime;

                    _GlobalAlpha = 1f;// -factor / 100f;
                    _ZOffset     = CSettings.zFar / 2;
                    _Screens[(int)_CurrentScreen].Draw();

                    _GlobalAlpha = factor;
                    _ZOffset     = 0f;
                    _Screens[(int)_NextScreen].Draw();

                    _GlobalAlpha = 1f;
                }
                else
                {
                    _Screens[(int)_CurrentScreen].OnClose();
                    _CurrentScreen = _NextScreen;
                    _NextScreen    = EScreens.ScreenNull;
                    if (CBackgroundMusic.Playing)
                    {
                        CBackgroundMusic.Play();
                    }
                    _Screens[(int)_CurrentScreen].OnShowFinish();
                    _Screens[(int)_CurrentScreen].ProcessMouseMove(_Cursor.X, _Cursor.Y);
                    _Screens[(int)_CurrentScreen].Draw();
                    _Fading = false;
                    _FadingTimer.Stop();
                }
            }
            else
            {
                _Screens[(int)_CurrentScreen].Draw();
            }

            for (int i = 0; i < _PopupScreens.Count; i++)
            {
                _PopupScreens[i].Draw();
            }

            _Cursor.Draw();
            DrawDebugInfos();

            return(true);
        }