/// <summary>Starts playing</summary> public void Play() { if (isPlaying) { return; } isPlaying = true; maxTime = chartFile.Length + 1000; timer.Start(CurrentTime); StartPlaying?.Invoke(this, new EventArgs()); }
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)); } }
public void Play(IEnumerable <string> list, string current) { Files = list.ToList(); NowPlaying = current; if (current != null) { StartPlaying?.Invoke(this, new PlayingEventArgs(NowPlaying)); } else { PlayNext(); } }
public static void CallStartPlaying() { StartPlaying?.Invoke(); }