상속: Banshee.Collection.TrackInfo
예제 #1
0
        public static RadioTrackInfo OpenPlay(SafeUri uri)
        {
            RadioTrackInfo track = Open(uri);

            if (track != null)
            {
                track.Play();
            }
            return(track);
        }
예제 #2
0
        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;
            }
        }
예제 #3
0
        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 ();
 }