Esempio n. 1
0
 // Methods :: Public :: GetWeb
 /// <summary>
 ///	Get the cover from a URL.
 /// </summary>
 /// <remarks>
 ///	Immediately returns a temporary cover.
 ///	The actual downloading occurs in
 ///	<see cref="GetWebThread" />.
 /// </remarks>
 /// <param name="key">
 ///	Album key.
 /// </param>
 /// <param name="url">
 ///	The URL from which to get the cover.
 /// </param>
 /// <param name="done_func">
 ///	A <see cref="GotCoverDelegate" />.
 /// </param>
 /// <returns>
 ///	A <see cref="Gdk.Pixbuf" /> of the temporary cover.
 /// </returns>
 public Pixbuf GetWeb
     (string key, string url, GotCoverDelegate done_func)
 {
     db.RemoveCover(key);
     new GetWebThread(this, key, url, done_func);
     return(db.DownloadingPixbuf);
 }
Esempio n. 2
0
            // Constructor
            /// <summary>
            ///	Create a new <see cref="GetWebThread" />.
            /// </summary>
            /// <param name="getter">
            ///	A <see cref="CoverGetter" />.
            /// </param>
            /// <param name="key">
            ///     The album key.
            /// </param>
            /// <param name="url">
            ///	The URL from which to download the cover.
            /// </param>
            /// <param name="done_func">
            ///	The delegate to call when the cover is done downloading.
            /// </param>
            /// <returns>
            ///	A <see cref="Gdk.Pixbuf" /> of the modified cover.
            /// </returns>
            public GetWebThread(CoverGetter getter, string key, string url,
                                GotCoverDelegate done_func)
            {
                this.getter    = getter;
                this.key       = key;
                this.url       = url;
                this.done_func = done_func;

                Thread thread = new Thread(new ThreadStart(ThreadFunc));

                thread.IsBackground = true;
                thread.Priority     = ThreadPriority.BelowNormal;
                thread.Start();
            }