banshee r3887 - in trunk/banshee: . src/Core/Banshee.Services/Banshee.Sources src/Dap/Banshee.Dap.Mtp/Banshee.Dap.Mtp src/Dap/Banshee.Dap/Banshee.Dap src/Extensions/Banshee.Lastfm/Banshee.Lastfm.Radio
- From: gburt svn gnome org
- To: svn-commits-list gnome org
- Subject: banshee r3887 - in trunk/banshee: . src/Core/Banshee.Services/Banshee.Sources src/Dap/Banshee.Dap.Mtp/Banshee.Dap.Mtp src/Dap/Banshee.Dap/Banshee.Dap src/Extensions/Banshee.Lastfm/Banshee.Lastfm.Radio
- Date: Tue, 6 May 2008 16:44:29 +0100 (BST)
Author: gburt
Date: Tue May 6 15:44:29 2008
New Revision: 3887
URL: http://svn.gnome.org/viewvc/banshee?rev=3887&view=rev
Log:
2008-05-06 Gabriel Burt <gabriel burt gmail com>
* src/Extensions/Banshee.Lastfm/Banshee.Lastfm.Radio/StationSource.cs:
* src/Extensions/Banshee.Lastfm/Banshee.Lastfm.Radio/LastfmSource.cs:
* src/Core/Banshee.Services/Banshee.Sources/Source.cs: Make SetStatus and
HideStatus methods public.
* src/Dap/Banshee.Dap.Mtp/Banshee.Dap.Mtp/MtpSource.cs: Move loading of
tracks into LoadFromDevice method.
* src/Dap/Banshee.Dap/Banshee.Dap/DapSource.cs: Override SetStatus and
HideStatus methods to set it on the parent source and all of our children.
Modified:
trunk/banshee/ChangeLog
trunk/banshee/src/Core/Banshee.Services/Banshee.Sources/Source.cs
trunk/banshee/src/Dap/Banshee.Dap.Mtp/Banshee.Dap.Mtp/MtpSource.cs
trunk/banshee/src/Dap/Banshee.Dap/Banshee.Dap/DapSource.cs
trunk/banshee/src/Extensions/Banshee.Lastfm/Banshee.Lastfm.Radio/LastfmSource.cs
trunk/banshee/src/Extensions/Banshee.Lastfm/Banshee.Lastfm.Radio/StationSource.cs
Modified: trunk/banshee/src/Core/Banshee.Services/Banshee.Sources/Source.cs
==============================================================================
--- trunk/banshee/src/Core/Banshee.Services/Banshee.Sources/Source.cs (original)
+++ trunk/banshee/src/Core/Banshee.Services/Banshee.Sources/Source.cs Tue May 6 15:44:29 2008
@@ -236,12 +236,12 @@
#region Protected Methods
- protected virtual void SetStatus (string message, bool error)
+ public virtual void SetStatus (string message, bool error)
{
SetStatus (message, !error, !error, error ? "dialog-error" : null);
}
- protected virtual void SetStatus (string message, bool can_close, bool is_spinning, string icon_name)
+ public virtual void SetStatus (string message, bool can_close, bool is_spinning, string icon_name)
{
lock (this) {
if (status_message == null) {
@@ -262,7 +262,7 @@
status_message.ThawNotify ();
}
- protected virtual void HideStatus ()
+ public virtual void HideStatus ()
{
lock (this) {
if (status_message != null) {
Modified: trunk/banshee/src/Dap/Banshee.Dap.Mtp/Banshee.Dap.Mtp/MtpSource.cs
==============================================================================
--- trunk/banshee/src/Dap/Banshee.Dap.Mtp/Banshee.Dap.Mtp/MtpSource.cs (original)
+++ trunk/banshee/src/Dap/Banshee.Dap.Mtp/Banshee.Dap.Mtp/MtpSource.cs Tue May 6 15:44:29 2008
@@ -138,39 +138,37 @@
}
}
AcceptableMimeTypes = mimetypes.ToArray ();
+ }
- ThreadPool.QueueUserWorkItem (delegate {
- track_map = new Dictionary<int, Track> ();
- SetStatus (String.Format (Catalog.GetString ("Loading {0}"), Name), false);
- try {
- List<Track> files = mtp_device.GetAllTracks (delegate (ulong current, ulong total, IntPtr data) {
- //user_event.Progress = (double)current / total;
- SetStatus (String.Format (Catalog.GetString ("Loading {0} - {1} of {2}"), Name, current, total), false);
- return 0;
- });
-
- /*if (user_event.IsCancelRequested) {
- return;
- }*/
-
- int [] source_ids = new int [] { DbId };
- foreach (Track mtp_track in files) {
- int track_id;
- if ((track_id = DatabaseTrackInfo.GetTrackIdForUri (MtpTrackInfo.GetPathFromMtpTrack (mtp_track), source_ids)) > 0) {
- track_map[track_id] = mtp_track;
- } else {
- MtpTrackInfo track = new MtpTrackInfo (mtp_track);
- track.PrimarySource = this;
- track.Save (false);
- track_map[track.TrackId] = mtp_track;
- }
+ protected override void LoadFromDevice ()
+ {
+ track_map = new Dictionary<int, Track> ();
+ try {
+ List<Track> files = mtp_device.GetAllTracks (delegate (ulong current, ulong total, IntPtr data) {
+ //user_event.Progress = (double)current / total;
+ SetStatus (String.Format (Catalog.GetString ("Loading {0} - {1} of {2}"), Name, current, total), false);
+ return 0;
+ });
+
+ /*if (user_event.IsCancelRequested) {
+ return;
+ }*/
+
+ int [] source_ids = new int [] { DbId };
+ foreach (Track mtp_track in files) {
+ int track_id;
+ if ((track_id = DatabaseTrackInfo.GetTrackIdForUri (MtpTrackInfo.GetPathFromMtpTrack (mtp_track), source_ids)) > 0) {
+ track_map[track_id] = mtp_track;
+ } else {
+ MtpTrackInfo track = new MtpTrackInfo (mtp_track);
+ track.PrimarySource = this;
+ track.Save (false);
+ track_map[track.TrackId] = mtp_track;
}
- } catch (Exception e) {
- Log.Exception (e);
}
- OnTracksAdded ();
- HideStatus ();
- });
+ } catch (Exception e) {
+ Log.Exception (e);
+ }
}
public override void Import ()
Modified: trunk/banshee/src/Dap/Banshee.Dap/Banshee.Dap/DapSource.cs
==============================================================================
--- trunk/banshee/src/Dap/Banshee.Dap/Banshee.Dap/DapSource.cs (original)
+++ trunk/banshee/src/Dap/Banshee.Dap/Banshee.Dap/DapSource.cs Tue May 6 15:44:29 2008
@@ -133,6 +133,22 @@
get { return false; }
}
+ public override void SetStatus (string message, bool can_close, bool is_spinning, string icon_name)
+ {
+ base.SetStatus (message, can_close, is_spinning, icon_name);
+ foreach (Source child in Children) {
+ child.SetStatus (message, can_close, is_spinning, icon_name);
+ }
+ }
+
+ public override void HideStatus ()
+ {
+ base.HideStatus ();
+ foreach (Source child in Children) {
+ child.HideStatus ();
+ }
+ }
+
#endregion
#region Track Management/Syncing
Modified: trunk/banshee/src/Extensions/Banshee.Lastfm/Banshee.Lastfm.Radio/LastfmSource.cs
==============================================================================
--- trunk/banshee/src/Extensions/Banshee.Lastfm/Banshee.Lastfm.Radio/LastfmSource.cs (original)
+++ trunk/banshee/src/Extensions/Banshee.Lastfm/Banshee.Lastfm.Radio/LastfmSource.cs Tue May 6 15:44:29 2008
@@ -288,13 +288,13 @@
OnUpdated ();
}
- protected override void SetStatus (string message, bool error)
+ public override void SetStatus (string message, bool error)
{
base.SetStatus (message, error);
SetStatus (status_message, this, error, ConnectionState.Connected);
}
- private void SetStatus (string message, bool error, ConnectionState state)
+ public void SetStatus (string message, bool error, ConnectionState state)
{
base.SetStatus (message, error);
SetStatus (status_message, this, error, state);
Modified: trunk/banshee/src/Extensions/Banshee.Lastfm/Banshee.Lastfm.Radio/StationSource.cs
==============================================================================
--- trunk/banshee/src/Extensions/Banshee.Lastfm/Banshee.Lastfm.Radio/StationSource.cs (original)
+++ trunk/banshee/src/Extensions/Banshee.Lastfm/Banshee.Lastfm.Radio/StationSource.cs Tue May 6 15:44:29 2008
@@ -232,13 +232,13 @@
}
}
- protected override void SetStatus (string message, bool error)
+ public override void SetStatus (string message, bool error)
{
base.SetStatus (message, error);
LastfmSource.SetStatus (status_message, lastfm, error, ConnectionState.Connected);
}
- private void SetStatus (string message, bool error, ConnectionState state)
+ public void SetStatus (string message, bool error, ConnectionState state)
{
base.SetStatus (message, error);
LastfmSource.SetStatus (status_message, lastfm, error, state);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]