protected void SkipTrackIfRemoved ()
{
var playback_src = ServiceManager.PlaybackController.Source as DatabaseSource;
if (playback_src == null || (playback_src != this && playback_src.Parent != this))
return;
var track = ServiceManager.PlayerEngine.CurrentTrack as DatabaseTrackInfo;
if (track == null || playback_src.DatabaseTrackModel.Contains (track))
return;
Log.DebugFormat ("Playing track was removed from {0}, so stopping it", this);
if (ServiceManager.PlaybackController.StopWhenFinished) {
ServiceManager.PlayerEngine.Close ();
} else {
// Set the PriorTrack to the track before the one we removed, so that, if we're in non-shuffle mode,
// we'll pick the first non-removed track after the one that was playing
if (first_nonremoved_track != null) {
ServiceManager.PlaybackController.PriorTrack = first_nonremoved_track;
}
ServiceManager.PlaybackController.Next ();
}
}