Ejemplo n.º 1
0
 public void Stop()
 {
     this.mSong              = null;
     this.mIsPlaying         = false;
     this.mSongQueuePosition = -1;
     mBroadcastNeeded        = true;
     if (this.mRoomOutputItem != null)
     {
         this.mRoomOutputItem.ExtraData = "0";
         this.mRoomOutputItem.bool_0    = false;
         this.mRoomOutputItem.UpdateState(true, true);
     }
 }
Ejemplo n.º 2
0
 public void PlaySong()
 {
     if (this.mSongQueuePosition >= this.mPlaylist.Count)
     {
         this.mSongQueuePosition = 0;
     }
     if (this.mPlaylist.Count == 0)
     {
         this.Stop();
     }
     else
     {
         if (!this.mPlaylist.ContainsKey(this.mSongQueuePosition))
         {
             this.mSongQueuePosition = 0;
         }
         this.mSong       = this.mPlaylist[this.mSongQueuePosition];
         this.mSongLength = this.mSong.SongData.Length / 1000;
         this.mStartedPlayingTimestamp = Essential.GetUnixTimestamp();
         mBroadcastNeeded = true;
     }
 }
Ejemplo n.º 3
0
        public SongItem RemoveDisk(int PlaylistIndex)
        {
            SongInstance instance = null;

            lock (this.mPlaylist)
            {
                if (!this.mPlaylist.ContainsKey(PlaylistIndex))
                {
                    return(null);
                }
                instance = this.mPlaylist[PlaylistIndex];
                this.mPlaylist.Remove(PlaylistIndex);
            }
            lock (this.mLoadedDisks)
            {
                this.mLoadedDisks.Remove(instance.DiskItem.itemID);
            }
            this.RepairPlaylist();
            if (PlaylistIndex == this.mSongQueuePosition)
            {
                this.PlaySong();
            }
            return(instance.DiskItem);
        }
Ejemplo n.º 4
0
 public void Stop()
 {
     this.mSong = null;
     this.mIsPlaying = false;
     this.mSongQueuePosition = -1;
     mBroadcastNeeded = true;
     if (this.mRoomOutputItem != null)
     {
         this.mRoomOutputItem.ExtraData = "0";
         this.mRoomOutputItem.bool_0 = false;
         this.mRoomOutputItem.UpdateState(true, true);
     }
 }
Ejemplo n.º 5
0
 public void PlaySong()
 {
     if (this.mSongQueuePosition >= this.mPlaylist.Count)
     {
         this.mSongQueuePosition = 0;
     }
     if (this.mPlaylist.Count == 0)
     {
         this.Stop();
     }
     else
     {
         if (!this.mPlaylist.ContainsKey(this.mSongQueuePosition))
         {
             this.mSongQueuePosition = 0;
         }
         this.mSong = this.mPlaylist[this.mSongQueuePosition];
         this.mSongLength = this.mSong.SongData.Length / 1000;
         this.mStartedPlayingTimestamp = Essential.GetUnixTimestamp();
         mBroadcastNeeded = true;
     }
 }