public void Play()
{
if (trying_to_play) {
return;
}
trying_to_play = true;
SavePlaybackError (StreamPlaybackError.None);
if (loaded) {
PlayCore ();
} else {
// Stop playing until we load this radio station and play it
ServiceManager.PlayerEngine.Close (true);
ServiceManager.PlayerEngine.TrackIntercept += OnTrackIntercept;
// Tell the seek slider that we're connecting
// TODO move all this playlist-downloading/parsing logic into PlayerEngine?
ServiceManager.PlayerEngine.StartSynthesizeContacting (this);
OnParsingPlaylistStarted ();
ThreadPool.QueueUserWorkItem (delegate {
try {
LoadStreamUris ();
} catch (Exception e) {
trying_to_play = false;
Log.Exception (this.ToString (), e);
SavePlaybackError (StreamPlaybackError.Unknown);
OnParsingPlaylistFinished ();
ServiceManager.PlayerEngine.Close ();
}
});
}
}