Exemplo n.º 1
0
 public SendDispatcher(AutoQueue <SendPacket> queue,
                       ISender sender, ISendDelivery delivery)
 {
     mQueue    = queue;
     mSender   = sender;
     mDelivery = delivery;
 }
Exemplo n.º 2
0
        public static void QueueSong(string mp3)
        {
            var file     = new AudioFile(mp3);
            var duration = file.Properties.Duration;
            var song     = new Song
            {
                Name      = Path.GetFileNameWithoutExtension(mp3),
                Stream    = "/" + Path.GetFileName(mp3),
                Download  = "/download/" + Path.GetFileName(mp3),
                Duration  = duration,
                UserAdded = false
            };

            AutoQueue.Enqueue(song);
        }
Exemplo n.º 3
0
        public static Song PlayNextSong()
        {
            Song song;

            if (UserQueue.Any())
            {
                while (!UserQueue.TryDequeue(out song))
                {
                }
            }
            else
            {
                while (!AutoQueue.TryDequeue(out song))
                {
                }
                QueueRandomSong();
            }
            NowPlaying = song;
            return(song);
        }