Ejemplo n.º 1
0
        public Item RemoveDisk(int PlaylistIndex)
        {
            SongInstance Instance = null;

            lock (mPlaylist)
            {
                if (!mPlaylist.ContainsKey(PlaylistIndex))
                {
                    return(null);
                }

                Instance = mPlaylist[PlaylistIndex];
                mPlaylist.Remove(PlaylistIndex);
            }

            lock (mLoadedDisks)
            {
                mLoadedDisks.Remove(Instance.DiskItem.Id);
            }

            RepairPlaylist();

            if (PlaylistIndex == mSongQueuePosition)
            {
                PlaySong();
            }

            return(Instance.DiskItem);
        }
Ejemplo n.º 2
0
        public void PlaySong()
        {
            if (mSongQueuePosition >= mPlaylist.Count)
            {
                mSongQueuePosition = 0;
            }

            if (mPlaylist.Count == 0)
            {
                Stop();
                return;
            }

            mSong = mPlaylist[mSongQueuePosition];
            mStartedPlayingTimestamp = UnixTimestamp.GetCurrent();
            mBroadcastNeeded         = true;
        }
Ejemplo n.º 3
0
 public void Stop()
 {
     mSong              = null;
     mIsPlaying         = false;
     mSongQueuePosition = -1;
 }