public void Stop()
 {
     mSong              = null;
     mIsPlaying         = false;
     mSongQueuePosition = -1;
     mBroadcastNeeded   = true;
 }
        public SongItem 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.itemID);
            }

            RepairPlaylist();

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

            return(Instance.DiskItem);
        }
 internal void Destroy()
 {
     if (mLoadedDisks != null)
     {
         mLoadedDisks.Clear();
     }
     if (mPlaylist != null)
     {
         mPlaylist.Clear();
     }
     mPlaylist       = null;
     mLoadedDisks    = null;
     mSong           = null;
     mRoomOutputItem = null;
 }
        public void PlaySong()
        {
            if (mSongQueuePosition >= mPlaylist.Count)
            {
                mSongQueuePosition = 0;
            }

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

            mSong = mPlaylist[mSongQueuePosition];
            mStartedPlayingTimestamp = ButterflyEnvironment.GetUnixTimestamp();
            mBroadcastNeeded         = true;
        }
Beispiel #5
0
 internal void Destroy()
 {
     if (mLoadedDisks != null)
         mLoadedDisks.Clear();
     if (mPlaylist != null)
         mPlaylist.Clear();
     mPlaylist = null;
     mLoadedDisks = null;
     mSong = null;
     mRoomOutputItem = null;
 }
Beispiel #6
0
 public void Stop()
 {
     mSong = null;
     mIsPlaying = false;
     mSongQueuePosition = -1;
     mBroadcastNeeded = true;
 }
Beispiel #7
0
        public void PlaySong()
        {
            if (mSongQueuePosition >= mPlaylist.Count)
            {
                mSongQueuePosition = 0;
            }

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

            mSong = mPlaylist[mSongQueuePosition];
            mStartedPlayingTimestamp = ButterflyEnvironment.GetUnixTimestamp();
            mBroadcastNeeded = true;
        }