public static RadioTrackInfo OpenPlay(SafeUri uri) { RadioTrackInfo track = Open(uri); if (track != null) { track.Play(); } return(track); }
public static RadioTrackInfo Open (SafeUri uri) { try { RadioTrackInfo radio_track = new RadioTrackInfo (uri); radio_track.ParsingPlaylistEvent += delegate { ThreadAssist.ProxyToMain (delegate { if (radio_track.PlaybackError != StreamPlaybackError.None) { Log.Error (Catalog.GetString ("Error opening stream"), Catalog.GetString ("Could not open stream or playlist"), true); radio_track = null; } }); }; return radio_track; } catch { Log.Error (Catalog.GetString ("Error opening stream"), Catalog.GetString("Problem parsing playlist"), true); return null; } }
public static RadioTrackInfo Open(SafeUri uri) { try { RadioTrackInfo radio_track = new RadioTrackInfo(uri); radio_track.ParsingPlaylistEvent += delegate { ThreadAssist.ProxyToMain(delegate { if (radio_track.PlaybackError != StreamPlaybackError.None) { Log.Error(Catalog.GetString("Error opening stream"), Catalog.GetString("Could not open stream or playlist"), true); radio_track = null; } }); }; return(radio_track); } catch { Log.Error(Catalog.GetString("Error opening stream"), Catalog.GetString("Problem parsing playlist"), true); return(null); } }
private void PlayGenre(object sender, ButtonPressEventArgs args) { MenuTile tile = sender as MenuTile; Genre g = genre_map[tile.PrimaryText]; string type = RadioSource.MembershipTypeSchema.Get (); RadioTrackInfo rti; if (type != "") { string user = RadioSource.UsernameSchema.Get (); string pass = RadioSource.PasswordSchema.Get (); rti = new RadioTrackInfo (g.GetM3uUri (type, user, pass)); } else { rti = new RadioTrackInfo (g.GetM3uUri ()); } Log.Debug (string.Format ("Tuning Magnatune to {0}", g.GetM3uUri ()), null); rti.Play (); }