Пример #1
0
 public void Next()
 {
     actionQueue.Enqueue(() =>
     {
         Paused = false;
         SongCancelSource.Cancel();
     });
 }
Пример #2
0
 public void Next()
 {
     lock (playlistLock) {
         if (!SongCancelSource.IsCancellationRequested)
         {
             Paused = false;
             SongCancelSource.Cancel();
         }
     }
 }
Пример #3
0
 public void Stop()
 {
     lock (playlistLock) {
         playlist.Clear();
         CurrentSong = null;
         if (!SongCancelSource.IsCancellationRequested)
         {
             SongCancelSource.Cancel();
         }
     }
 }
Пример #4
0
 public void Stop()
 {
     actionQueue.Enqueue(() =>
     {
         RepeatPlaylist = false;
         RepeatSong = false;
         Autoplay = false;
         _playlist.Clear();
         if (!SongCancelSource.IsCancellationRequested)
             SongCancelSource.Cancel();
     });
 }
Пример #5
0
 public void Destroy()
 {
     lock (playlistLock) {
         playlist.Clear();
         Destroyed   = true;
         CurrentSong = null;
         if (!SongCancelSource.IsCancellationRequested)
         {
             SongCancelSource.Cancel();
         }
         audioClient.Disconnect();
     }
 }
Пример #6
0
        public void Destroy()
        {
            actionQueue.Enqueue(async () =>
            {
                RepeatPlaylist = false;
                RepeatSong = false;
                Autoplay = false;
                destroyed = true;
                _playlist.Clear();

                try { await audioClient.DisconnectAsync(); } catch { }
                if (!SongCancelSource.IsCancellationRequested)
                    SongCancelSource.Cancel();
            });
        }
Пример #7
0
 public void Destroy()
 {
     actionQueue.Enqueue(() =>
     {
         RepeatPlaylist = false;
         RepeatSong     = false;
         Destroyed      = true;
         playlist.Clear();
         if (!SongCancelSource.IsCancellationRequested)
         {
             SongCancelSource.Cancel();
         }
         audioClient.Disconnect();
     });
 }
Пример #8
0
 public void Stop()
 {
     lock (playlistLock) {
         _playlist.Clear();
         try {
             if (!SongCancelSource.IsCancellationRequested)
             {
                 SongCancelSource.Cancel();
             }
         }
         catch {
             Console.WriteLine("STOP");
         }
     }
 }