Exemplo n.º 1
0
        public override void Dispose()
        {
            lock (InternalLock) {
                if (load_thread != null) {
                    if (load_thread.IsAlive) {
                        load_thread.Abort ();
                    }
                    load_thread = null;
                }
            }

            Flush ();

            if (dap_info_bar != null) {
                var info_bar = dap_info_bar;
                ThreadAssist.ProxyToMain (info_bar.Destroy);
                dap_info_bar = null;
            }

            Properties.Remove ("Nereid.SourceContents.FooterWidget");

            /*Properties.Remove ("Nereid.SourceContents");
            dap_properties_display.Destroy ();
            dap_properties_display = null;*/

            if (sync != null)
                sync.Dispose ();
        }
Exemplo n.º 2
0
        protected override void Initialize()
        {
            PurgeTemporaryPlaylists ();

            base.Initialize ();

            Expanded = true;
            Properties.SetStringList ("Icon.Name", GetIconNames ());
            Properties.Set<string> ("SourcePropertiesActionLabel", Catalog.GetString ("Device Properties"));
            Properties.Set<OpenPropertiesDelegate> ("SourceProperties.GuiHandler", delegate {
                new DapPropertiesDialog (this).RunDialog ();
            });

            Properties.Set<bool> ("Nereid.SourceContents.HeaderVisible", false);
            Properties.Set<System.Reflection.Assembly> ("ActiveSourceUIResource.Assembly", System.Reflection.Assembly.GetExecutingAssembly ());
            Properties.SetString ("ActiveSourceUIResource", "ActiveSourceUI.xml");

            sync = new DapSync (this);

            /*dap_properties_display = new DapPropertiesDisplay (this);
            Properties.Set<Banshee.Sources.Gui.ISourceContents> ("Nereid.SourceContents", dap_properties_display);*/

            if (String.IsNullOrEmpty (GenericName)) {
                GenericName = Catalog.GetString ("Media Player");
            }

            if (String.IsNullOrEmpty (Name)) {
                Name = device.Name;
            }

            AddDapProperty (Catalog.GetString ("Product"), device.Product);
            AddDapProperty (Catalog.GetString ("Vendor"), device.Vendor);

            if (acceptable_mimetypes == null) {
                acceptable_mimetypes = HasMediaCapabilities ? MediaCapabilities.PlaybackMimeTypes : null;
                if (acceptable_mimetypes == null || acceptable_mimetypes.Length == 0) {
                    acceptable_mimetypes = new string [] { "taglib/mp3" };
                }
            }

            AddChildSource (music_group_source = new MusicGroupSource (this));
            // We want the group sources to be on top of the list, with Music first
            music_group_source.Order = -30;

            if (SupportsVideo) {
                video_group_source = new VideoGroupSource (this);
                video_group_source.Order = -20;
            }

            if (SupportsPodcasts) {
                podcast_group_source = new PodcastGroupSource (this);
                podcast_group_source.Order = -10;
            }

            BuildPreferences ();

            ThreadAssist.ProxyToMain (delegate {
                dap_info_bar = new DapInfoBar (this);
                Properties.Set<Gtk.Widget> ("Nereid.SourceContents.FooterWidget", dap_info_bar);

                Properties.Set<Banshee.Sources.Gui.ISourceContents> ("Nereid.SourceContents", new DapContent (this));
            });
        }
Exemplo n.º 3
0
        public override void Dispose()
        {
            Flush ();

            PurgeTemporaryPlaylists ();
            PurgeTracks ();

            if (dap_info_bar != null) {
                dap_info_bar.Destroy ();
                dap_info_bar = null;
            }

            Properties.Remove ("Nereid.SourceContents.FooterWidget");

            /*Properties.Remove ("Nereid.SourceContents");
            dap_properties_display.Destroy ();
            dap_properties_display = null;*/

            if (sync != null)
                sync.Dispose ();
        }