banshee r3938 - in trunk/banshee: . src/Core/Banshee.Services src/Core/Banshee.Services/Banshee.Collection src/Extensions/Banshee.Lastfm src/Extensions/Banshee.Lastfm/Banshee.Lastfm.Radio src/Extensions/Banshee.Lastfm/Resources src/Extensions/Banshee.NotificationArea/Resources src/Libraries/Hyena/Hyena.Data.Sqlite



Author: gburt
Date: Wed May 21 04:19:39 2008
New Revision: 3938
URL: http://svn.gnome.org/viewvc/banshee?rev=3938&view=rev

Log:
2008-05-20  Gabriel Burt  <gabriel burt gmail com>

	* src/Extensions/Banshee.NotificationArea/Resources/NotificationAreaMenu.xml:
	Add placeholder.

	* src/Extensions/Banshee.Lastfm/Banshee.Lastfm.Radio/StationSource.cs:
	Implement IBasicPlaybackController, so that if we are selected as the new
	playback source and asked to play First or Next, we will as soon as we've
	loaded some songs (and we're still the playback source).

	* src/Extensions/Banshee.Lastfm/Makefile.am:
	* src/Extensions/Banshee.Lastfm/Resources/LastfmTrackActions.xml:
	* src/Extensions/Banshee.Lastfm/Banshee.Lastfm.Radio/LastfmActions.cs:
	Load some TrackActions when we're the playback source (specifically, put
	Love/Hate in the notification menu).

	* src/Core/Banshee.Services/Banshee.Services.mdp:
	* src/Core/Banshee.Services/Makefile.am:
	* src/Core/Banshee.Services/Banshee.Collection/IHasTrackSelection.cs:
	Removed.

	* src/Libraries/Hyena/Hyena.Data.Sqlite/HyenaSqliteConnection.cs: TODO
	note.


Added:
   trunk/banshee/src/Extensions/Banshee.Lastfm/Resources/LastfmTrackActions.xml
Removed:
   trunk/banshee/src/Core/Banshee.Services/Banshee.Collection/IHasTrackSelection.cs
Modified:
   trunk/banshee/ChangeLog
   trunk/banshee/src/Core/Banshee.Services/Banshee.Services.mdp
   trunk/banshee/src/Core/Banshee.Services/Makefile.am
   trunk/banshee/src/Extensions/Banshee.Lastfm/Banshee.Lastfm.Radio/LastfmActions.cs
   trunk/banshee/src/Extensions/Banshee.Lastfm/Banshee.Lastfm.Radio/StationSource.cs
   trunk/banshee/src/Extensions/Banshee.Lastfm/Makefile.am
   trunk/banshee/src/Extensions/Banshee.NotificationArea/Resources/NotificationAreaMenu.xml
   trunk/banshee/src/Libraries/Hyena/Hyena.Data.Sqlite/HyenaSqliteConnection.cs

Modified: trunk/banshee/src/Core/Banshee.Services/Banshee.Services.mdp
==============================================================================
--- trunk/banshee/src/Core/Banshee.Services/Banshee.Services.mdp	(original)
+++ trunk/banshee/src/Core/Banshee.Services/Banshee.Services.mdp	Wed May 21 04:19:39 2008
@@ -35,7 +35,6 @@
     <File name="Banshee.Collection/ArtistListModel.cs" subtype="Code" buildaction="Compile" />
     <File name="Banshee.Collection/ExportableModel.cs" subtype="Code" buildaction="Compile" />
     <File name="Banshee.Collection/IExportableModel.cs" subtype="Code" buildaction="Compile" />
-    <File name="Banshee.Collection/IHasTrackSelection.cs" subtype="Code" buildaction="Compile" />
     <File name="Banshee.Collection/ModelHelper.cs" subtype="Code" buildaction="Compile" />
     <File name="Banshee.Collection/TrackListModel.cs" subtype="Code" buildaction="Compile" />
     <File name="Banshee.Services.addin.xml" subtype="Code" buildaction="EmbedAsResource" />
@@ -168,9 +167,7 @@
     <File name="Banshee.SmartPlaylist/SmartPlaylistDefinition.cs" subtype="Code" buildaction="Compile" />
     <File name="Banshee.Collection.Database/DatabaseBrowsableListModel.cs" subtype="Code" buildaction="Compile" />
     <File name="Banshee.Collection/BrowsableListModel.cs" subtype="Code" buildaction="Compile" />
-    <File name="Banshee.Playlists.Formats/Tests" subtype="Directory" buildaction="Compile" />
     <File name="Banshee.Playlists.Formats/Tests/PlaylistFormatTests.cs" subtype="Code" buildaction="Compile" />
-    <File name="Banshee.SmartPlaylist/Tests" subtype="Directory" buildaction="Compile" />
   </Contents>
   <References>
     <ProjectReference type="Gac" localcopy="True" refto="System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />

Modified: trunk/banshee/src/Core/Banshee.Services/Makefile.am
==============================================================================
--- trunk/banshee/src/Core/Banshee.Services/Makefile.am	(original)
+++ trunk/banshee/src/Core/Banshee.Services/Makefile.am	Wed May 21 04:19:39 2008
@@ -24,7 +24,6 @@
 	Banshee.Collection/BrowsableListModel.cs \
 	Banshee.Collection/ExportableModel.cs \
 	Banshee.Collection/IExportableModel.cs \
-	Banshee.Collection/IHasTrackSelection.cs \
 	Banshee.Collection/ImportEventHandler.cs \
 	Banshee.Collection/ImportManager.cs \
 	Banshee.Collection/MemoryTrackListModel.cs \

Modified: trunk/banshee/src/Extensions/Banshee.Lastfm/Banshee.Lastfm.Radio/LastfmActions.cs
==============================================================================
--- trunk/banshee/src/Extensions/Banshee.Lastfm/Banshee.Lastfm.Radio/LastfmActions.cs	(original)
+++ trunk/banshee/src/Extensions/Banshee.Lastfm/Banshee.Lastfm.Radio/LastfmActions.cs	Wed May 21 04:19:39 2008
@@ -423,6 +423,7 @@
             updating = false;
         }
 
+        private uint track_actions_id;
         private RadioAction old_shuffle;
         private RadioAction old_repeat;
         private bool was_lastfm = false;
@@ -452,6 +453,11 @@
             // Set sensitivity
             shuffle_actions.Sensitive = !is_lastfm;
             repeat_actions.Sensitive = !is_lastfm;
+            
+            if (is_lastfm && !was_lastfm)
+                track_actions_id = Actions.UIManager.AddUiFromResource ("LastfmTrackActions.xml");
+            else if (!is_lastfm && was_lastfm)
+                Actions.UIManager.RemoveUi (track_actions_id);
 
             was_lastfm = is_lastfm;
         }

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	Wed May 21 04:19:39 2008
@@ -47,10 +47,11 @@
 using Banshee.MediaEngine;
 using Banshee.Collection;
 using Banshee.ServiceStack;
+using Banshee.PlaybackController;
  
 namespace Banshee.Lastfm.Radio
 {
-    public class StationSource : Source, ITrackModelSource, IUnmapableSource, IDisposable
+    public class StationSource : Source, ITrackModelSource, IUnmapableSource, IDisposable, IBasicPlaybackController
     {
         private static string generic_name = Catalog.GetString ("Last.fm Station");
         
@@ -274,6 +275,30 @@
                     current_track = i;
             }
         }
+        
+#region IBasicPlaybackController
+
+        void IBasicPlaybackController.First ()
+        {
+            ((IBasicPlaybackController)this).Next (false);
+        }
+        
+        private bool playback_requested;    
+        void IBasicPlaybackController.Next (bool restart)
+        {
+            TrackInfo next = NextTrack;
+            if (next != null) {
+                ServiceManager.PlayerEngine.OpenPlay (next);
+            }  else {
+                playback_requested = true;
+            }
+        }
+        
+        void IBasicPlaybackController.Previous (bool restart)
+        {
+        }
+        
+#endregion
 
         public TrackInfo NextTrack {
             get { return GetTrack (current_track + 1); }
@@ -329,10 +354,12 @@
                             track_model.Reload ();
                             OnUpdated ();
 
-                            /*if (playback_requested) {
-                                StartPlayback ();
+                            if (playback_requested) {
+                                if (this == ServiceManager.PlaybackController.Source ) {
+                                    ((IBasicPlaybackController)this).Next (false);
+                                }
                                 playback_requested = false;
-                            }*/
+                            }
                         });
                     }
                 } else {

Modified: trunk/banshee/src/Extensions/Banshee.Lastfm/Makefile.am
==============================================================================
--- trunk/banshee/src/Extensions/Banshee.Lastfm/Makefile.am	(original)
+++ trunk/banshee/src/Extensions/Banshee.Lastfm/Makefile.am	Wed May 21 04:19:39 2008
@@ -19,6 +19,7 @@
 	Banshee.Lastfm.addin.xml \
 	Resources/ActiveSourceUI.xml \
 	Resources/AudioscrobblerMenu.xml \
+	Resources/LastfmTrackActions.xml \
 	Resources/GlobalUI.xml \
 	Resources/lastfm.glade
 

Added: trunk/banshee/src/Extensions/Banshee.Lastfm/Resources/LastfmTrackActions.xml
==============================================================================
--- (empty file)
+++ trunk/banshee/src/Extensions/Banshee.Lastfm/Resources/LastfmTrackActions.xml	Wed May 21 04:19:39 2008
@@ -0,0 +1,8 @@
+<ui>
+  <popup name="NotificationAreaIconMenu" action="NotificationAreaIconMenuAction">
+    <placeholder name="NotificationPlaceholder">
+      <menuitem name="LastfmLove" action="LastfmLoveAction"/>
+      <menuitem name="LastfmHate" action="LastfmHateAction"/>
+    </placeholder>
+  </popup>
+</ui>

Modified: trunk/banshee/src/Extensions/Banshee.NotificationArea/Resources/NotificationAreaMenu.xml
==============================================================================
--- trunk/banshee/src/Extensions/Banshee.NotificationArea/Resources/NotificationAreaMenu.xml	(original)
+++ trunk/banshee/src/Extensions/Banshee.NotificationArea/Resources/NotificationAreaMenu.xml	Wed May 21 04:19:39 2008
@@ -5,6 +5,8 @@
     <menuitem name="Next" action="NextAction"/>
     <menuitem name="Previous" action="PreviousAction"/>
     <separator/>
+    <placeholder name="NotificationPlaceholder" />
+    <separator/>
     <menuitem name="ToggleNotifications" action="ToggleNotificationsAction"/>
     <separator/>
     <menuitem name="Quit" action="QuitAction"/>

Modified: trunk/banshee/src/Libraries/Hyena/Hyena.Data.Sqlite/HyenaSqliteConnection.cs
==============================================================================
--- trunk/banshee/src/Libraries/Hyena/Hyena.Data.Sqlite/HyenaSqliteConnection.cs	(original)
+++ trunk/banshee/src/Libraries/Hyena/Hyena.Data.Sqlite/HyenaSqliteConnection.cs	Wed May 21 04:19:39 2008
@@ -84,7 +84,9 @@
         }
 
 #region Public Query Methods
-        
+
+        // TODO special case for single object param to avoid object []
+                
         // SELECT multiple column queries
         public IDataReader Query (HyenaSqliteCommand command)
         {



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]