Example #1
0
        private void TogglePlayer(Globals.MediaPlayerSelection player)
        {
            this.toolStripMenuItemSpotify.Checked = player == Globals.MediaPlayerSelection.Spotify;
            this.toolStripMenuItemItunes.Checked  = player == Globals.MediaPlayerSelection.Itunes;

            Globals.CurrentPlayer.Unload();
            string playerName = string.Empty;

            switch (player)
            {
            case Globals.MediaPlayerSelection.Spotify:
                Globals.CurrentPlayer = new Spotify();
                playerName            = LocalizedMessages.Spotify;
                break;

            case Globals.MediaPlayerSelection.Itunes:
                Globals.CurrentPlayer = new Itunes();
                playerName            = LocalizedMessages.Itunes;
                break;

            default:
                break;
            }

            Globals.CurrentPlayer.Load();

            Globals.PlayerSelection = player;
            TextHandler.UpdateTextAndEmptyFilesMaybe(
                string.Format(
                    CultureInfo.InvariantCulture,
                    LocalizedMessages.SwitchedToPlayer,
                    playerName));
        }
Example #2
0
        private void TogglePlayer(Globals.MediaPlayerSelection player)
        {
            this.toolStripMenuItemSpotify.Checked    = player == Globals.MediaPlayerSelection.Spotify;
            this.toolStripMenuItemItunes.Checked     = player == Globals.MediaPlayerSelection.iTunes;
            this.toolStripMenuItemWinamp.Checked     = player == Globals.MediaPlayerSelection.Winamp;
            this.toolStripMenuItemFoobar2000.Checked = player == Globals.MediaPlayerSelection.foobar2000;
            this.toolStripMenuItemVlc.Checked        = player == Globals.MediaPlayerSelection.VLC;
            this.toolStripMenuItemGPMDP.Checked      = player == Globals.MediaPlayerSelection.GPMDP;
            this.toolStripMenuItemQuodLibet.Checked  = player == Globals.MediaPlayerSelection.QuodLibet;

            Globals.CurrentPlayer.Unload();
            string playerName = string.Empty;

            switch (player)
            {
            case Globals.MediaPlayerSelection.Spotify:
                Globals.CurrentPlayer = new Spotify();
                playerName            = LocalizedMessages.Spotify;
                break;

            case Globals.MediaPlayerSelection.iTunes:
                Globals.CurrentPlayer = new iTunes();
                playerName            = LocalizedMessages.iTunes;
                break;

            case Globals.MediaPlayerSelection.Winamp:
                Globals.CurrentPlayer = new Winamp();
                playerName            = LocalizedMessages.Winamp;
                break;

            case Globals.MediaPlayerSelection.foobar2000:
                Globals.CurrentPlayer = new foobar2000();
                playerName            = LocalizedMessages.foobar2000;
                break;

            case Globals.MediaPlayerSelection.VLC:
                Globals.CurrentPlayer = new VLC();
                playerName            = LocalizedMessages.VLC;
                break;

            case Globals.MediaPlayerSelection.GPMDP:
                Globals.CurrentPlayer = new GPMDP();
                playerName            = LocalizedMessages.GPMDP;
                break;

            case Globals.MediaPlayerSelection.QuodLibet:
                Globals.CurrentPlayer = new QuodLibet();
                playerName            = LocalizedMessages.QuodLibet;
                break;

            default:
                break;
            }

            Globals.CurrentPlayer.Load();

            Globals.PlayerSelection = player;
            TextHandler.UpdateTextAndEmptyFilesMaybe(
                string.Format(
                    CultureInfo.InvariantCulture,
                    LocalizedMessages.SwitchedToPlayer,
                    playerName));
        }