private void onBassEvent(object sender, BassEventArgs args) { if (args.Event == BassEvent.PlaybackFinished) { PlaybackState = PlaybackState.Stopped; var listItem = NowPlaying.Current(); if (listItem.Key < NowPlaying.Count - 1) { Play(NowPlaying.Forward().Value); } else { if (Repeat) { Play(NowPlaying.Forward().Value); } } } }
public bool Enqueue(int identifier) { var item = LibraryActor.GetItem(identifier); if (item != null) { var added = NowPlaying.Enqueue(item); if (added.Value != null) { if (PlaybackState == PlaybackState.Stopped) { var current = NowPlaying.Forward(); return(Play(current.Value)); } return(true); } } return(false); }