/// <summary>
        /// Initializes a new instance of the <see cref="MainWindow" /> class.
        /// </summary>
        public MainWindow()
        {
            InitializeComponent();
            QueueList.DataContext = uploadedTracks;

            PlayRequestManager.Attach(this);
            List<PlayRequest> requests = PlayRequestManager.GetPlayList(PlayRequest.PlayRequestTypeEnum.Queue);
            foreach (var request in requests)
            {
                uploadedTracks.Add(request);
            }

            if (uploadedTracks.Count != 0)
            {
                QueueList.SelectedIndex = 0;
            }

            _player = new DoublePlayer(Player1, Player1Progress, Player1Remaining, Player2, Player2Progress, Player2Remaining);
            _player.mediaEnded += _player_mediaEnded;

            Application.Current.Exit += CloseServer;
        }
 protected virtual void Dispose(bool b)
 {
     if (b)
     {
         _server.Dispose();
         _player = null;
     }
 }