예제 #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();
            }
        }
예제 #2
0
        public override void Dispose()
        {
            Flush();

            PurgeTemporaryPlaylists();
            PurgeTracks();

            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();
            }
        }
예제 #3
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 <bool> ("Nereid.SourceContents.FooterVisible", false);
            Properties.Set <System.Reflection.Assembly> ("ActiveSourceUIResource.Assembly", System.Reflection.Assembly.GetExecutingAssembly());
            Properties.SetString("ActiveSourceUIResource", "ActiveSourceUI.xml");

            sync = new DapSync(this);

            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 = 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 (SupportsPodcasts && null == podcast_group_source)
            {
                podcast_group_source       = new PodcastGroupSource(this);
                podcast_group_source.Order = -10;
            }

            BuildPreferences();

            Properties.Set <Gtk.Widget> ("Nereid.SourceContents.FooterWidget", dap_info_bar = dap_info_bar ?? new DapInfoBar(this));
            Properties.Set <Banshee.Sources.Gui.ISourceContents> ("Nereid.SourceContents", dap_properties_display = dap_properties_display ?? new DapContent(this));
        }