Ejemplo n.º 1
0
        /// <summary>
        ///     Hide the background form elements to provide seamless transition between games or after MAME termination.
        /// </summary>
        protected void HideBackgroundForm()
        {
            BackgroundForm.HideAll();

            // Force an immediate refresh to avoid flicker of the MAME logo
            BackgroundForm.Refresh();
        }
Ejemplo n.º 2
0
        protected virtual void Dispose(bool disposing)
        {
            if (!disposing)
            {
                return;
            }

            _powerManager?.Dispose();
            BackgroundForm?.Dispose();
        }
Ejemplo n.º 3
0
        public void Run()
        {
            try
            {
                // Load list and get only selected games from it
                List <SelectableGame> gameListFull = Settings.LoadGameList();
                List <Game>           gameList     = new List <Game>();

                if (gameListFull.Count == 0)
                {
                    return;
                }

                foreach (SelectableGame game in gameListFull)
                {
                    if (game.Selected)
                    {
                        gameList.Add(game);
                    }
                }

                // Exit run method if there were no selected games
                if (gameList.Count == 0)
                {
                    return;
                }

                // Set up the timer
                int minutes = Settings.Minutes;
                timer       = new GameTimer(minutes * 60000, gameList);
                timer.Tick += timer_Tick;

                // Set up the background form
                Cursor.Hide();
                frmBackground         = new BackgroundForm();
                frmBackground.Capture = true;
                frmBackground.Load   += frmBackground_Load;

                // Set up the global hooks
                actHook = new UserActivityHook();
                actHook.OnMouseActivity += actHook_OnMouseActivity;
                actHook.KeyDown         += actHook_KeyDown;

                // Run the application
                Application.EnableVisualStyles();
                Application.Run(frmBackground);
            }
            catch (Exception x)
            {
                MessageBox.Show(x.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Ejemplo n.º 4
0
        /// <summary>
        ///     Displays the game description and details on the splash screen.
        /// </summary>
        private void DisplaySplashText()
        {
            if (!_splashSettings.Enabled)
            {
                return;
            }

            Log.Debug("Displaying splash screen");

            var game = _gamePlayManager.CurrentGame();

            BackgroundForm.SetGameText(game.Description, $@"{game.Year} {game.Manufacturer}");
        }
Ejemplo n.º 5
0
 public BlankScreen(LayoutSettings layoutSettings, PowerManager powerManager)
 {
     _powerManager  = powerManager;
     BackgroundForm = new BackgroundForm(layoutSettings);
 }
Ejemplo n.º 6
0
        public void Run()
        {
            try
            {
                // Load list and get only selected games from it
                List<SelectableGame> gameListFull = Settings.LoadGameList();
                List<Game> gameList = new List<Game>();

                if ( gameListFull.Count == 0 ) return;

                foreach (SelectableGame game in gameListFull)
                    if (game.Selected) gameList.Add(game);

                // Exit run method if there were no selected games
                if ( gameList.Count == 0 ) return;

                // Set up the timer
                int minutes = Settings.Minutes;
                timer = new GameTimer(minutes * 60000, gameList);
                timer.Tick += timer_Tick;

                // Set up the background form
                Cursor.Hide();
                frmBackground = new BackgroundForm();
                frmBackground.Capture = true;
                frmBackground.Load += frmBackground_Load;

                // Set up the global hooks
                actHook = new UserActivityHook();
                actHook.OnMouseActivity += actHook_OnMouseActivity;
                actHook.KeyDown += actHook_KeyDown;

                // Run the application
                Application.EnableVisualStyles();
                Application.Run(frmBackground);
            }
            catch(Exception x)
            {
                MessageBox.Show(x.Message, "Error",  MessageBoxButtons.OK , MessageBoxIcon.Error);
            }
        }