Exemplo n.º 1
0
        /// <summary>
        /// Constructor
        /// </summary>
        public SongPlayer(IMediaDevice mediaDevice)
        {
            _mediaDevice = mediaDevice;

            _queue = new FairQueue();
            _songLibrary = new SongLibrary();
            _songLibrary.StatusChanged += OnLibraryStatusChanged;

            _updateThread = new Thread(new ThreadStart(Update));
            _updateThread.Start();
        }
Exemplo n.º 2
0
        /// <summary>
        /// Constructor
        /// </summary>
        public SongPlayer(IMediaDevice mediaDevice)
        {
            _mediaDevice = mediaDevice;

            _queue       = new FairQueue();
            _songLibrary = new SongLibrary();
            _songLibrary.StatusChanged += OnLibraryStatusChanged;

            _updateThread = new Thread(new ThreadStart(Update));
            _updateThread.Start();
        }
Exemplo n.º 3
0
        /// <summary>
        /// Enqueue song
        /// </summary>
        public void Enqueue(Song song, string requesterName)
        {
            int maximalsonginqueue;

            if (!int.TryParse(SongPlayerFactory.GetConfigFile().GetValue("player.maximalsonginqueue"), out maximalsonginqueue))
            {
                maximalsonginqueue = int.MaxValue;
            }

            if (_queue.Count >= maximalsonginqueue)
            {
                return;
            }

            SongLibrary.UpdateSingleTag(song);

            _queue.Add(new RequestedSong
            {
                Song          = song,
                RequesterName = requesterName,
                RequestedDate = DateTime.Now
            });
        }