예제 #1
0
        /// <summary>Starts playing</summary>
        public void Play()
        {
            if (isPlaying)
            {
                return;
            }
            isPlaying = true;
            maxTime   = chartFile.Length + 1000;
            timer.Start(CurrentTime);

            StartPlaying?.Invoke(this, new EventArgs());
        }
예제 #2
0
 public void PlayNext()
 {
     if (Files != null && Files.Count() > 0)
     {
         int Pos = random.Next(Files.Count);
         if (Files[Pos] == NowPlaying)
         {
             Pos = random.Next(Files.Count);
         }
         NowPlaying = Files[Pos];
         StartPlaying?.Invoke(this, new PlayingEventArgs(NowPlaying));
     }
 }
예제 #3
0
 public void Play(IEnumerable <string> list, string current)
 {
     Files      = list.ToList();
     NowPlaying = current;
     if (current != null)
     {
         StartPlaying?.Invoke(this, new PlayingEventArgs(NowPlaying));
     }
     else
     {
         PlayNext();
     }
 }
예제 #4
0
 public static void CallStartPlaying()
 {
     StartPlaying?.Invoke();
 }