Exemplo n.º 1
0
        public RadioSource(RadioPlugin plugin) : base(Catalog.GetString("Radio"), 150)
        {
            this.plugin = plugin;

            PlayerEngineCore.EventChanged += OnPlayerEventChanged;
            PlayerEngineCore.StateChanged += OnPlayerStateChanged;

            plugin.StationManager.StationsLoaded += delegate {
                if (status_bar != null)
                {
                    status_bar.Hide();
                }

                OnUpdated();
            };

            plugin.StationManager.StationsRefreshing += delegate {
                if (status_bar != null)
                {
                    status_bar.Message = String.Format("<big>{0}</big>", GLib.Markup.EscapeText(Catalog.GetString(
                                                                                                    "Refreshing radio stations from the Banshee Radio Web Service")));
                    status_bar.Pixbuf          = refresh_pixbuf;
                    status_bar.ShowCloseButton = false;
                    status_bar.Show();
                }
            };

            plugin.StationManager.StationsLoadFailed += delegate(object o, StationManager.StationsLoadFailedArgs args) {
                if (status_bar != null)
                {
                    status_bar.Message = String.Format("<big>{0}</big>", GLib.Markup.EscapeText(Catalog.GetString(
                                                                                                    "Failed to load radio stations: " + args.Message)));
                    status_bar.Pixbuf          = error_pixbuf;
                    status_bar.ShowCloseButton = true;
                    status_bar.Show();
                }
            };

            plugin.Actions.GetAction("CopyUriAction").Activated += OnCopyUri;

            BuildInterface();
        }
        public RadioSource(RadioPlugin plugin)
            : base(Catalog.GetString("Radio"), 150)
        {
            this.plugin = plugin;

            PlayerEngineCore.EventChanged += OnPlayerEventChanged;
            PlayerEngineCore.StateChanged += OnPlayerStateChanged;

            plugin.StationManager.StationsLoaded += delegate {
                if(status_bar != null) {
                    status_bar.Hide();
                }

                OnUpdated();
            };

            plugin.StationManager.StationsRefreshing += delegate {
                if(status_bar != null) {
                    status_bar.Message = String.Format("<big>{0}</big>", GLib.Markup.EscapeText(Catalog.GetString(
                        "Refreshing radio stations from the Banshee Radio Web Service")));
                    status_bar.Pixbuf = refresh_pixbuf;
                    status_bar.ShowCloseButton = false;
                    status_bar.Show();
                }
            };

            plugin.StationManager.StationsLoadFailed += delegate(object o, StationManager.StationsLoadFailedArgs args) {
                if(status_bar != null) {
                    status_bar.Message = String.Format("<big>{0}</big>", GLib.Markup.EscapeText(Catalog.GetString(
                        "Failed to load radio stations: " + args.Message)));
                    status_bar.Pixbuf = error_pixbuf;
                    status_bar.ShowCloseButton = true;
                    status_bar.Show();
                }
            };

            plugin.Actions.GetAction("CopyUriAction").Activated += OnCopyUri;

            BuildInterface();
        }
        public RadioSource(RadioPlugin plugin)
            : base(Catalog.GetString("Internet Radio"), 150)
        {
            this.plugin = plugin;

            stations_file = Path.Combine(Paths.UserPluginDirectory, "radio-stations.xml");

            if(!File.Exists(stations_file)) {
                string default_xml = Resource.GetFileContents("stations.xml");
                TextWriter writer = new StreamWriter(stations_file);
                writer.Write(default_xml);
                writer.Close();
            }

            stations = Stations.Load(stations_file);
            stations.Updated += delegate {
                view.QueueDraw();
            };

            store = new StationStore(stations);

            BuildInterface();
        }
        public RadioSource(RadioPlugin plugin) : base(Catalog.GetString("Internet Radio"), 150)
        {
            this.plugin = plugin;

            stations_file = Path.Combine(Paths.UserPluginDirectory, "radio-stations.xml");

            if (!File.Exists(stations_file))
            {
                string     default_xml = Resource.GetFileContents("stations.xml");
                TextWriter writer      = new StreamWriter(stations_file);
                writer.Write(default_xml);
                writer.Close();
            }

            stations          = Stations.Load(stations_file);
            stations.Updated += delegate {
                view.QueueDraw();
            };

            store = new StationStore(stations);

            BuildInterface();
        }
Exemplo n.º 5
0
 public StationModel(RadioPlugin plugin) : base(
         typeof(string), typeof(string), typeof(Track), typeof(RadioTrackInfo))
 {
     this.plugin = plugin;
     plugin.StationManager.StationsLoaded += OnStationsLoaded;
 }
 public StationModel(RadioPlugin plugin)
     : base(typeof(string), typeof(string), typeof(Track), typeof(RadioTrackInfo))
 {
     this.plugin = plugin;
     plugin.StationManager.StationsLoaded += OnStationsLoaded;
 }