banshee r4355 - in trunk/banshee: . src/Core/Banshee.ThickClient src/Core/Banshee.ThickClient/Banshee.Collection.Gui src/Core/Banshee.ThickClient/Banshee.Gui.Widgets src/Extensions/Banshee.Lastfm src/Extensions/Banshee.Lastfm/Banshee.Lastfm.Radio src/Extensions/Banshee.Lastfm/Resources src/Extensions/Banshee.NowPlaying src/Extensions/Banshee.NowPlaying/Banshee.NowPlaying src/Libraries/Hyena.Gui/Hyena.Gui src/Libraries/Hyena/Hyena src/Libraries/Hyena/Hyena.Data src/Libraries/Lastfm src/Libraries/Lastfm/Lastfm src/Libraries/Lastfm/Lastfm.Data src/Libraries/Migo/Migo.Syndication src/Libraries/Migo/Migo.Syndication/Enumerations src/Libraries/Mtp src/Libraries/Mtp/Mtp



Author: abock
Date: Tue Aug 12 18:05:07 2008
New Revision: 4355
URL: http://svn.gnome.org/viewvc/banshee?rev=4355&view=rev

Log:
2008-08-12  Aaron Bockover  <abock gnome org>

    * Revert: svn merge -r 4350:4349; backed out my large commit from yesterday
    due to some apparent internal windowing regressions experience by some;
    unfortunately no bling for 1.2.1, but I'll work to get it back into 1.2.2



Removed:
   trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Gui.Widgets/LargeTrackInfoDisplay.cs
   trunk/banshee/src/Extensions/Banshee.NowPlaying/Banshee.NowPlaying/NowPlayingContents.cs
   trunk/banshee/src/Extensions/Banshee.NowPlaying/Banshee.NowPlaying/NowPlayingTrackInfoDisplay.cs
Modified:
   trunk/banshee/ChangeLog
   trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Collection.Gui/ArtworkRenderer.cs
   trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Gui.Widgets/ClassicTrackInfoDisplay.cs
   trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Gui.Widgets/TrackInfoDisplay.cs
   trunk/banshee/src/Core/Banshee.ThickClient/Banshee.ThickClient.mdp
   trunk/banshee/src/Core/Banshee.ThickClient/Makefile.am
   trunk/banshee/src/Extensions/Banshee.Lastfm/Banshee.Lastfm.Radio/   (props changed)
   trunk/banshee/src/Extensions/Banshee.Lastfm/Banshee.Lastfm.Radio/LastfmSource.cs   (props changed)
   trunk/banshee/src/Extensions/Banshee.Lastfm/Banshee.Lastfm.Radio/LastfmTrackInfo.cs   (props changed)
   trunk/banshee/src/Extensions/Banshee.Lastfm/Banshee.Lastfm.Radio/StationEditor.cs   (props changed)
   trunk/banshee/src/Extensions/Banshee.Lastfm/Banshee.Lastfm.Radio/StationSource.cs   (props changed)
   trunk/banshee/src/Extensions/Banshee.Lastfm/Banshee.Lastfm.Radio/StationType.cs   (props changed)
   trunk/banshee/src/Extensions/Banshee.Lastfm/Banshee.Lastfm.addin.xml   (props changed)
   trunk/banshee/src/Extensions/Banshee.Lastfm/Banshee.Lastfm.mdp   (props changed)
   trunk/banshee/src/Extensions/Banshee.Lastfm/Resources/GlobalUI.xml   (props changed)
   trunk/banshee/src/Extensions/Banshee.NowPlaying/Banshee.NowPlaying.mdp
   trunk/banshee/src/Extensions/Banshee.NowPlaying/Banshee.NowPlaying/FullscreenWindow.cs
   trunk/banshee/src/Extensions/Banshee.NowPlaying/Banshee.NowPlaying/NowPlayingInterface.cs
   trunk/banshee/src/Extensions/Banshee.NowPlaying/Banshee.NowPlaying/VideoDisplay.cs
   trunk/banshee/src/Extensions/Banshee.NowPlaying/Banshee.NowPlaying/XOverlayVideoDisplay.cs
   trunk/banshee/src/Extensions/Banshee.NowPlaying/Makefile.am
   trunk/banshee/src/Libraries/Hyena.Gui/Hyena.Gui/CairoExtensions.cs
   trunk/banshee/src/Libraries/Hyena/Hyena.Data/ICacheableItem.cs   (props changed)
   trunk/banshee/src/Libraries/Hyena/Hyena/Log.cs   (props changed)
   trunk/banshee/src/Libraries/Lastfm/Lastfm/   (props changed)
   trunk/banshee/src/Libraries/Lastfm/Lastfm.Data/LastfmUserData.cs   (props changed)
   trunk/banshee/src/Libraries/Lastfm/Lastfm.mdp   (props changed)
   trunk/banshee/src/Libraries/Lastfm/Lastfm/RadioConnection.cs   (props changed)
   trunk/banshee/src/Libraries/Migo/Migo.Syndication/Enumerations/FeedBackgroundSyncAction.cs   (props changed)
   trunk/banshee/src/Libraries/Migo/Migo.Syndication/Enumerations/FeedBackgroundSyncStatus.cs   (props changed)
   trunk/banshee/src/Libraries/Migo/Migo.Syndication/Enumerations/FeedDownloadError.cs   (props changed)
   trunk/banshee/src/Libraries/Migo/Migo.Syndication/Enumerations/FeedDownloadStatus.cs   (props changed)
   trunk/banshee/src/Libraries/Migo/Migo.Syndication/Enumerations/FeedSyncSetting.cs   (props changed)
   trunk/banshee/src/Libraries/Migo/Migo.Syndication/Rfc822DateTime.cs   (props changed)
   trunk/banshee/src/Libraries/Migo/Migo.Syndication/RssParser.cs   (props changed)
   trunk/banshee/src/Libraries/Mtp/Mtp.mdp   (props changed)
   trunk/banshee/src/Libraries/Mtp/Mtp/Album.cs   (props changed)
   trunk/banshee/src/Libraries/Mtp/Mtp/Error.cs   (props changed)
   trunk/banshee/src/Libraries/Mtp/Mtp/File.cs   (props changed)
   trunk/banshee/src/Libraries/Mtp/Mtp/FileSampleData.cs   (props changed)
   trunk/banshee/src/Libraries/Mtp/Mtp/Folder.cs   (props changed)
   trunk/banshee/src/Libraries/Mtp/Mtp/MtpDevice.cs   (props changed)
   trunk/banshee/src/Libraries/Mtp/Mtp/Playlist.cs   (props changed)
   trunk/banshee/src/Libraries/Mtp/Mtp/Track.cs   (props changed)

Modified: trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Collection.Gui/ArtworkRenderer.cs
==============================================================================
--- trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Collection.Gui/ArtworkRenderer.cs	(original)
+++ trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Collection.Gui/ArtworkRenderer.cs	Tue Aug 12 18:05:07 2008
@@ -49,14 +49,6 @@
             double x, double y, double width, double height, bool drawBorder, double radius, 
             bool fill, Color fillColor)
         {
-            RenderThumbnail (cr, pixbuf, dispose, x, y, width, height, drawBorder, radius, 
-                fill, fillColor, CairoCorners.All);
-        }
-        
-        public static void RenderThumbnail (Cairo.Context cr, Gdk.Pixbuf pixbuf, bool dispose,
-            double x, double y, double width, double height, bool drawBorder, double radius, 
-            bool fill, Color fillColor, CairoCorners corners)
-        {
             if (pixbuf == null || pixbuf.Handle == IntPtr.Zero) {
                 return;
             }
@@ -74,15 +66,11 @@
                 cr.Fill();
             }
             
-            CairoExtensions.RoundedRectangle (cr, p_x, p_y, pixbuf.Width, pixbuf.Height, radius, corners);
+            CairoExtensions.RoundedRectangle (cr, p_x, p_y, pixbuf.Width, pixbuf.Height, radius);
             Gdk.CairoHelper.SetSourcePixbuf (cr, pixbuf, p_x, p_y);
             cr.Fill ();
             
             if (!drawBorder) {
-                if (dispose) {
-                    DisposePixbuf (pixbuf);
-                }
-                
                 return;
             }
             
@@ -90,12 +78,12 @@
             if (radius < 1) {
                 cr.Antialias = Antialias.None;
                 
-                CairoExtensions.RoundedRectangle (cr, x + 1.5, y + 1.5, width - 3, height - 3, radius, corners);
+                CairoExtensions.RoundedRectangle (cr, x + 1.5, y + 1.5, width - 3, height - 3, radius);
                 cr.Color = cover_border_light_color;
                 cr.Stroke ();
             }
             
-            CairoExtensions.RoundedRectangle (cr, x + 0.5, y + 0.5, width - 1, height - 1, radius, corners);
+            CairoExtensions.RoundedRectangle (cr, x + 0.5, y + 0.5, width - 1, height - 1, radius);
             cr.Color = cover_border_dark_color;
             cr.Stroke ();
             

Modified: trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Gui.Widgets/ClassicTrackInfoDisplay.cs
==============================================================================
--- trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Gui.Widgets/ClassicTrackInfoDisplay.cs	(original)
+++ trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Gui.Widgets/ClassicTrackInfoDisplay.cs	Tue Aug 12 18:05:07 2008
@@ -64,7 +64,8 @@
         
         protected override void OnRealized ()
         {
-            base.OnRealized ();
+            WidgetFlags |= WidgetFlags.Realized | WidgetFlags.NoWindow;
+            GdkWindow = Parent.GdkWindow;
             
             WindowAttr attributes = new WindowAttr ();
             attributes.WindowType = Gdk.WindowType.Child;
@@ -84,6 +85,8 @@
             
             event_window = new Gdk.Window (GdkWindow, attributes, attributes_mask);
             event_window.UserData = Handle;
+            
+            base.OnRealized ();
         }
         
         protected override void OnUnrealized ()
@@ -91,7 +94,7 @@
             WidgetFlags ^= WidgetFlags.Realized;
             
             event_window.UserData = IntPtr.Zero;
-            Hyena.Gui.GtkWorkarounds.WindowDestroy (event_window);
+            event_window.Destroy ();
             event_window = null;
             
             base.OnUnrealized ();

Modified: trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Gui.Widgets/TrackInfoDisplay.cs
==============================================================================
--- trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Gui.Widgets/TrackInfoDisplay.cs	(original)
+++ trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Gui.Widgets/TrackInfoDisplay.cs	Tue Aug 12 18:05:07 2008
@@ -28,7 +28,7 @@
 //
 
 using System;
-using System.Collections.Generic;
+using System.Collections;
 using Mono.Unix;
 
 using Gtk;
@@ -74,17 +74,17 @@
         }
         
         private Cairo.Color background_color;
-        protected virtual Cairo.Color BackgroundColor {
+        protected Cairo.Color BackgroundColor {
             get { return background_color; }
         }
         
         private Cairo.Color text_color;
-        protected virtual Cairo.Color TextColor {
+        protected Cairo.Color TextColor {
             get { return text_color; }
         }
         
         private Cairo.Color text_light_color;
-        protected virtual Cairo.Color TextLightColor {
+        protected Cairo.Color TextLightColor {
             get { return text_light_color; }
         }
         
@@ -100,7 +100,6 @@
         
         private uint idle_timeout_id = 0;
         private SingleActorStage stage = new SingleActorStage ();
-        private Dictionary<Pixbuf, Cairo.Surface> surface_cache = new Dictionary<Pixbuf, Cairo.Surface> ();
         
         protected TrackInfoDisplay (IntPtr native) : base (native)
         {
@@ -118,8 +117,6 @@
                 PlayerEvent.StartOfStream | 
                 PlayerEvent.TrackInfoUpdated | 
                 PlayerEvent.StateChange);
-                
-            WidgetFlags |= WidgetFlags.NoWindow;
         }
         
         public override void Dispose ()
@@ -135,31 +132,15 @@
             stage.Iteration -= OnStageIteration;
             stage = null;
             
-            SurfaceCacheFlush ();
-            
             base.Dispose ();
         }
         
-        protected override void OnRealized ()
-        {
-            GdkWindow = Parent.GdkWindow;
-            base.OnRealized ();
-        }
-        
-        protected override void OnUnrealized ()
-        {
-            base.OnUnrealized ();
-            SurfaceCacheFlush ();
-        }
-        
         protected override void OnSizeAllocated (Rectangle allocation)
         {
             base.OnSizeAllocated (allocation);
             
             if (current_track == null) {
                 LoadCurrentTrack ();
-            } else {
-                LoadPixbuf (current_track);
             }
         }
 
@@ -184,38 +165,18 @@
         
         protected override bool OnExposeEvent (EventExpose evnt)
         {
-            bool idle = incoming_track == null && current_track == null;
-            if (!Visible || !IsMapped || (idle && !CanRenderIdle)) {
+            if (!Visible || !IsMapped || (incoming_track == null && current_track == null)) {
                 return true;
             }
             
             Cairo.Context cr = Gdk.CairoHelper.Create (evnt.Window);
-            
-            foreach (Gdk.Rectangle damage in evnt.Region.GetRectangles ()) {
-                cr.Rectangle (damage.X, damage.Y, damage.Width, damage.Height);
-                cr.Clip ();
-            
-                if (idle) {
-                    RenderIdle (cr);
-                } else {
-                    RenderAnimation (cr);
-                }
-            
-                cr.ResetClip ();
-            }
-            
+            cr.Rectangle (Allocation.X, Allocation.Y, Allocation.Width, Allocation.Height);
+            cr.Clip ();
+            RenderAnimation (cr);
             CairoExtensions.DisposeContext (cr);
             
             return true;
         }
-
-        protected virtual bool CanRenderIdle {
-            get { return false; }
-        }
-        
-        protected virtual void RenderIdle (Cairo.Context cr)
-        {
-        }
         
         private void RenderAnimation (Cairo.Context cr)
         {
@@ -277,10 +238,8 @@
         
         protected virtual void RenderCoverArt (Cairo.Context cr, Pixbuf pixbuf)
         {
-            ArtworkRenderer.RenderThumbnail (cr, pixbuf, false, Allocation.X, Allocation.Y, 
-                ArtworkSizeRequest, ArtworkSizeRequest, 
-                !IsMissingPixbuf (pixbuf), 0, 
-                IsMissingPixbuf (pixbuf), BackgroundColor);
+            ArtworkRenderer.RenderThumbnail (cr, pixbuf, false, Allocation.X, Allocation.Y, Allocation.Height, Allocation.Height, 
+                !IsMissingPixbuf (pixbuf), 0, IsMissingPixbuf (pixbuf), background_color);
         }
 
         protected bool IsMissingPixbuf (Pixbuf pb)
@@ -290,14 +249,6 @@
         
         protected abstract void RenderTrackInfo (Cairo.Context cr, TrackInfo track, bool renderTrack, bool renderArtistAlbum);
         
-        protected virtual int ArtworkSizeRequest {
-            get { return Allocation.Height; }
-        }
-        
-        protected virtual int MissingIconSizeRequest {
-            get { return 32; }
-        }
-        
         private void OnPlayerEvent (PlayerEventArgs args)
         {
             if (args.Event == PlayerEvent.StartOfStream || args.Event == PlayerEvent.TrackInfoUpdated) {
@@ -343,27 +294,18 @@
             }
 
             incoming_track = track;
-            
-            LoadPixbuf (track);
-
-            if (stage.Actor == null) {
-                stage.Reset ();
-            }
-        }
-        
-        private void LoadPixbuf (TrackInfo track)
-        {
-            Gdk.Pixbuf pixbuf = artwork_manager.LookupScale (track.ArtworkId, ArtworkSizeRequest);
 
+            Gdk.Pixbuf pixbuf = artwork_manager.LookupScale (track.ArtworkId, Allocation.Height);
+            
             if (pixbuf == null) {
                 if ((track.MediaAttributes & TrackMediaAttributes.VideoStream) != 0) {
                     if (missing_video_pixbuf == null) {
-                        missing_video_pixbuf = IconThemeUtils.LoadIcon (MissingIconSizeRequest, "video-x-generic");
+                        missing_video_pixbuf = IconThemeUtils.LoadIcon (32, "video-x-generic");
                     }
                     incoming_pixbuf = missing_video_pixbuf;
                 } else {
                     if (missing_audio_pixbuf == null) {
-                        missing_audio_pixbuf = IconThemeUtils.LoadIcon (MissingIconSizeRequest, "audio-x-generic");
+                        missing_audio_pixbuf = IconThemeUtils.LoadIcon (32, "audio-x-generic");
                     }
                     incoming_pixbuf = missing_audio_pixbuf;
                 }
@@ -371,8 +313,8 @@
                 incoming_pixbuf = pixbuf;
             }
             
-            if (track == current_track) {
-                current_pixbuf = incoming_pixbuf;
+            if (stage.Actor == null) {
+                stage.Reset ();
             }
         }
         
@@ -380,15 +322,13 @@
         
         private void OnStageIteration (object o, EventArgs args)
         {
-            Invalidate ();
+            QueueDraw ();
             
             if (stage.Actor != null) {
                 last_fps = stage.Actor.FramesPerSecond;
                 return;
             }
             
-            SurfaceCacheFlush ();
-            
             if (ApplicationContext.Debugging) {
                 Log.DebugFormat ("TrackInfoDisplay RenderAnimation: {0:0.00} FPS", last_fps);
             }
@@ -405,11 +345,6 @@
             OnArtworkChanged ();
         }
         
-        protected virtual void Invalidate ()
-        {
-            QueueDraw ();
-        }
-        
         protected virtual void OnArtworkChanged ()
         {
         }
@@ -454,7 +389,7 @@
             }
             
             return String.Format ("<span color=\"{0}\">{1}</span>",  
-                CairoExtensions.ColorGetHex (TextColor, false),
+                CairoExtensions.ColorGetHex (text_color, false),
                 markup);
         }
         
@@ -462,7 +397,7 @@
         {
             string [] new_args = new string [args.Length + 2];
             new_args[0] = String.Format ("<span color=\"{0}\" size=\"small\">", 
-                CairoExtensions.ColorGetHex (TextLightColor, false));
+                CairoExtensions.ColorGetHex (text_light_color, false));
             new_args[1] = "</span>";
             
             for (int i = 0; i < args.Length; i++) {
@@ -495,46 +430,5 @@
             }
             return markup;
         }
-        
-        protected void SurfaceExpire (Gdk.Pixbuf pixbuf)
-        {
-            if (pixbuf == null) {
-                return;
-            }
-            
-            Cairo.Surface surface = null;
-            if (surface_cache.TryGetValue (pixbuf, out surface)) {
-                surface.Destroy ();
-                surface_cache.Remove (pixbuf);
-            }
-        }
-        
-        protected void SurfaceCacheFlush ()
-        {
-            foreach (Cairo.Surface surface in surface_cache.Values) {
-                surface.Destroy ();
-            }
-            
-            surface_cache.Clear ();
-        }
-        
-        protected void SurfaceCache (Gdk.Pixbuf pixbuf, Cairo.Surface surface)
-        {
-            if (pixbuf == null || surface == null) {
-                return;
-            }
-            
-            SurfaceExpire (pixbuf);
-            surface_cache.Add (pixbuf, surface);
-        }
-        
-        protected Cairo.Surface SurfaceLookup (Gdk.Pixbuf pixbuf)
-        {
-            Cairo.Surface surface = null;
-            if (pixbuf != null) {
-                surface_cache.TryGetValue (pixbuf, out surface);
-            }
-            return surface;
-        }
     }
 }

Modified: trunk/banshee/src/Core/Banshee.ThickClient/Banshee.ThickClient.mdp
==============================================================================
--- trunk/banshee/src/Core/Banshee.ThickClient/Banshee.ThickClient.mdp	(original)
+++ trunk/banshee/src/Core/Banshee.ThickClient/Banshee.ThickClient.mdp	Tue Aug 12 18:05:07 2008
@@ -119,7 +119,6 @@
     <File name="Banshee.Collection.Gui/QueryFilterView.cs" subtype="Code" buildaction="Compile" />
     <File name="Banshee.Gui.Widgets/ClassicTrackInfoDisplay.cs" subtype="Code" buildaction="Compile" />
     <File name="Banshee.Library.Gui/PhotoFolderImportSource.cs" subtype="Code" buildaction="Compile" />
-    <File name="Banshee.Gui.Widgets/LargeTrackInfoDisplay.cs" subtype="Code" buildaction="Compile" />
   </Contents>
   <References>
     <ProjectReference type="Project" localcopy="False" refto="Hyena.Gui" />

Modified: trunk/banshee/src/Core/Banshee.ThickClient/Makefile.am
==============================================================================
--- trunk/banshee/src/Core/Banshee.ThickClient/Makefile.am	(original)
+++ trunk/banshee/src/Core/Banshee.ThickClient/Makefile.am	Tue Aug 12 18:05:07 2008
@@ -52,7 +52,6 @@
 	Banshee.Gui.Widgets/ConnectedMessageBar.cs \
 	Banshee.Gui.Widgets/ConnectedSeekSlider.cs \
 	Banshee.Gui.Widgets/ConnectedVolumeButton.cs \
-	Banshee.Gui.Widgets/LargeTrackInfoDisplay.cs \
 	Banshee.Gui.Widgets/MainMenu.cs \
 	Banshee.Gui.Widgets/NextButton.cs \
 	Banshee.Gui.Widgets/PlaylistMenuItem.cs \

Modified: trunk/banshee/src/Extensions/Banshee.NowPlaying/Banshee.NowPlaying.mdp
==============================================================================
--- trunk/banshee/src/Extensions/Banshee.NowPlaying/Banshee.NowPlaying.mdp	(original)
+++ trunk/banshee/src/Extensions/Banshee.NowPlaying/Banshee.NowPlaying.mdp	Tue Aug 12 18:05:07 2008
@@ -1,4 +1,4 @@
-<Project name="Banshee.NowPlaying" fileversion="2.0" language="C#" UseParentDirectoryAsNamespace="True" clr-version="Net_2_0" ctype="DotNetProject">
+<Project name="Banshee.NowPlaying" fileversion="2.0" language="C#" clr-version="Net_2_0" UseParentDirectoryAsNamespace="True" ctype="DotNetProject">
   <Configurations active="Debug">
     <Configuration name="Debug" ctype="DotNetProjectConfiguration">
       <Output directory="../../../bin" assemblyKeyFile="." assembly="Banshee.NowPlaying" />
@@ -12,6 +12,7 @@
     <File name="Banshee.NowPlaying/NowPlayingSource.cs" subtype="Code" buildaction="Compile" />
     <File name="Banshee.NowPlaying/NowPlayingInterface.cs" subtype="Code" buildaction="Compile" />
     <File name="Banshee.NowPlaying/VideoDisplay.cs" subtype="Code" buildaction="Compile" />
+    <File name="Resources/idle-logo.png" subtype="Code" buildaction="EmbedAsResource" />
     <File name="Banshee.NowPlaying/FullscreenWindow.cs" subtype="Code" buildaction="Compile" />
     <File name="Resources/ActiveSourceUI.xml" subtype="Code" buildaction="EmbedAsResource" />
     <File name="Banshee.NowPlaying/XOverlayVideoDisplay.cs" subtype="Code" buildaction="Compile" />
@@ -21,9 +22,6 @@
     <File name="Banshee.NowPlaying/FullscreenAdapter.cs" subtype="Code" buildaction="Compile" />
     <File name="Banshee.NowPlaying/IScreensaverManager.cs" subtype="Code" buildaction="Compile" />
     <File name="Banshee.NowPlaying/ScreensaverManager.cs" subtype="Code" buildaction="Compile" />
-    <File name="Banshee.NowPlaying/NowPlayingContents.cs" subtype="Code" buildaction="Compile" />
-    <File name="Banshee.NowPlaying/NowPlayingTrackInfoDisplay.cs" subtype="Code" buildaction="Compile" />
-    <File name="Resources/idle-logo.png" subtype="Code" buildaction="EmbedAsResource" />
   </Contents>
   <References>
     <ProjectReference type="Project" localcopy="True" refto="Banshee.Core" />
@@ -38,7 +36,6 @@
     <ProjectReference type="Gac" localcopy="True" refto="gdk-sharp, Version=2.10.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" />
     <ProjectReference type="Gac" localcopy="True" refto="Mono.Cairo, Version=2.0.0.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756" />
   </References>
-  <GtkDesignInfo gtkVersion="2.12.1" />
   <MonoDevelop.Autotools.MakefileInfo IntegrationEnabled="True" RelativeMakefileName="./Makefile.am">
     <BuildFilesVar Sync="True" Name="SOURCES" />
     <DeployFilesVar />

Modified: trunk/banshee/src/Extensions/Banshee.NowPlaying/Banshee.NowPlaying/FullscreenWindow.cs
==============================================================================
--- trunk/banshee/src/Extensions/Banshee.NowPlaying/Banshee.NowPlaying/FullscreenWindow.cs	(original)
+++ trunk/banshee/src/Extensions/Banshee.NowPlaying/Banshee.NowPlaying/FullscreenWindow.cs	Tue Aug 12 18:05:07 2008
@@ -46,7 +46,6 @@
         public FullscreenWindow (Window parent) : base (WindowType.Toplevel)
         {
             Title = parent.Title;
-            AppPaintable = true;
             
             this.parent = parent;
             this.action_service = ServiceManager.Get<InterfaceActionService> ();
@@ -56,12 +55,6 @@
             SetupWidget ();
         }
         
-        protected override bool OnExposeEvent (Gdk.EventExpose evnt)
-        {
-            evnt.Window.DrawRectangle (Style.BlackGC, true, Allocation);
-            return base.OnExposeEvent (evnt);
-        }
-        
         protected override bool OnKeyPressEvent (Gdk.EventKey evnt)
         {
             PlayerEngineService player = ServiceManager.PlayerEngine;
@@ -152,10 +145,6 @@
         protected override void OnShown ()
         {
             base.OnShown ();
-            if (Child != null) {
-                Child.Show ();
-            }
-            
             OnHideCursorTimeout ();
             ConfigureWindow ();
             HasFocus = true;

Modified: trunk/banshee/src/Extensions/Banshee.NowPlaying/Banshee.NowPlaying/NowPlayingInterface.cs
==============================================================================
--- trunk/banshee/src/Extensions/Banshee.NowPlaying/Banshee.NowPlaying/NowPlayingInterface.cs	(original)
+++ trunk/banshee/src/Extensions/Banshee.NowPlaying/Banshee.NowPlaying/NowPlayingInterface.cs	Tue Aug 12 18:05:07 2008
@@ -41,17 +41,21 @@
     public class NowPlayingInterface : VBox, ISourceContents
     {   
         private NowPlayingSource source;
+        private VideoDisplay video_display;
         private Hyena.Widgets.RoundedFrame frame;
         private Gtk.Window video_window;
         private FullscreenAdapter fullscreen_adapter;
         private ScreensaverManager screensaver;
-        private NowPlayingContents contents;
+
+        public VideoDisplay VideoDisplay {
+            get { return video_display; }
+        }
         
         public NowPlayingInterface ()
         {
             GtkElementsService service = ServiceManager.Get<GtkElementsService> ();
             
-            contents = new NowPlayingContents ();
+            video_display = new XOverlayVideoDisplay ();
             
             // This is my really sweet hack - it's where the video widget
             // is sent when the source is not active. This keeps the video
@@ -61,7 +65,7 @@
             video_window = new FullscreenWindow (service.PrimaryWindow);
             video_window.Hidden += OnFullscreenWindowHidden;
             video_window.Realize ();
-            video_window.Add (contents);
+            video_window.Add (video_display);
             
             frame = new Hyena.Widgets.RoundedFrame ();
             frame.SetFillColor (new Cairo.Color (0, 0, 0));
@@ -80,19 +84,20 @@
             screensaver.Dispose ();
         }
 
+        
         private void MoveVideoExternal (bool hidden)
         {
-            if (contents.Parent != video_window) {
-                contents.Visible = !hidden;
-                contents.Reparent (video_window);
+            if (video_display.Parent != video_window) {
+                video_display.Visible = !hidden;
+                video_display.Reparent (video_window);
             }
         }
         
         private void MoveVideoInternal ()
         {
-            if (contents.Parent != frame) {
-                contents.Reparent (frame);
-                contents.Show ();
+            if (video_display.Parent != frame) {
+                video_display.Reparent (frame);
+                video_display.Show ();
             }
         }
         
@@ -157,7 +162,7 @@
         {
             if (fullscreen) {
                 MoveVideoExternal (true);
-                video_window.Show ();
+                video_window.ShowAll ();
                 fullscreen_adapter.Fullscreen (video_window, true);
                 screensaver.Inhibit ();
             } else {

Modified: trunk/banshee/src/Extensions/Banshee.NowPlaying/Banshee.NowPlaying/VideoDisplay.cs
==============================================================================
--- trunk/banshee/src/Extensions/Banshee.NowPlaying/Banshee.NowPlaying/VideoDisplay.cs	(original)
+++ trunk/banshee/src/Extensions/Banshee.NowPlaying/Banshee.NowPlaying/VideoDisplay.cs	Tue Aug 12 18:05:07 2008
@@ -37,20 +37,17 @@
 {   
     public abstract class VideoDisplay : Gtk.Widget
     {
-        private bool is_idle = true;
-        
-        public event EventHandler IdleStateChanged;
-        
-        public bool IsIdle {
-            get { return is_idle; }
-        }
+        private Gdk.Pixbuf idle_pixbuf;
+        private bool render_idle = true;
+        private bool render_video = false;
+        private Gdk.Pixbuf last_coverart_pixbuf;
+        private string last_coverart_id;
 
         public VideoDisplay ()
         {
             ServiceManager.PlayerEngine.ConnectEvent (OnPlayerEvent,
                 PlayerEvent.StartOfStream |
                 PlayerEvent.EndOfStream);
-            
             ToggleIdleVisibility ();
         }
 
@@ -66,17 +63,64 @@
         
         protected override bool OnExposeEvent (Gdk.EventExpose evnt)
         {
-            RenderWindow.DrawRectangle (Style.BlackGC, true, 
-                new Gdk.Rectangle (0, 0, Allocation.Width, Allocation.Height));
-            
             if (RenderWindow == null || !RenderWindow.IsVisible) {
                 return true;
             }
             
-            if (!is_idle && ServiceManager.PlayerEngine.SupportsVideo) {
+            if (render_video && ServiceManager.PlayerEngine.SupportsVideo) {
                 ExposeVideo (evnt);
+                return true;
+            }
+
+            if (render_idle || !DrawCoverArt ()) {
+                DrawIdle ();
+            }
+
+            return true;
+        }
+        
+        private void DrawIdle ()
+        {
+            if (idle_pixbuf == null) {
+                idle_pixbuf = Gdk.Pixbuf.LoadFromResource ("idle-logo.png");
+            }
+            
+            if (idle_pixbuf == null) {
+                return;
+            }
+            
+            RenderWindow.DrawPixbuf (Style.BackgroundGC (StateType.Normal), idle_pixbuf, 0, 0, 
+                (Allocation.Width - idle_pixbuf.Width) / 2, (Allocation.Height - idle_pixbuf.Height) / 2, 
+                idle_pixbuf.Width, idle_pixbuf.Height, Gdk.RgbDither.Normal, 0, 0);
+        }
+        
+        private bool DrawCoverArt ()
+        {
+            TrackInfo track = ServiceManager.PlayerEngine.CurrentTrack;
+            if (track == null) {
+                return false;
             }
             
+            Gdk.Pixbuf display_pixbuf = null;
+            
+            if (track.ArtworkId == last_coverart_id) {
+                display_pixbuf = last_coverart_pixbuf;
+            } else if (Banshee.Base.CoverArtSpec.CoverExists (track.ArtworkId)) {
+                if (last_coverart_pixbuf != null) {
+                    last_coverart_pixbuf.Dispose ();
+                }
+                last_coverart_id = track.ArtworkId;
+                display_pixbuf = last_coverart_pixbuf = new Gdk.Pixbuf (Banshee.Base.CoverArtSpec.GetPath (last_coverart_id));
+            } else {
+                return false;
+            }
+            
+            int img_w = Math.Min (Allocation.Width, display_pixbuf.Width);
+            int img_h = Math.Min (Allocation.Height, display_pixbuf.Height);
+            RenderWindow.DrawPixbuf (Style.BackgroundGC (StateType.Normal), display_pixbuf, 0, 0, 
+                (Allocation.Width - img_w) / 2, (Allocation.Height - img_h) / 2, 
+                img_w, img_h, Gdk.RgbDither.Normal, 0, 0
+            );
             return true;
         }
         
@@ -88,18 +132,9 @@
         private void ToggleIdleVisibility ()
         {
             TrackInfo track = ServiceManager.PlayerEngine.CurrentTrack;
-            is_idle = track == null || (track.MediaAttributes & TrackMediaAttributes.VideoStream) == 0;
+            render_idle = track == null;
+            render_video = !render_idle && (track.MediaAttributes & TrackMediaAttributes.VideoStream) != 0;
             QueueDraw ();
-            
-            OnIdleStateChanged ();
-        }
-        
-        protected virtual void OnIdleStateChanged ()
-        {
-            EventHandler handler = IdleStateChanged;
-            if (handler != null) {
-                handler (this, EventArgs.Empty);
-            }
         }
         
         public new void QueueDraw ()

Modified: trunk/banshee/src/Extensions/Banshee.NowPlaying/Banshee.NowPlaying/XOverlayVideoDisplay.cs
==============================================================================
--- trunk/banshee/src/Extensions/Banshee.NowPlaying/Banshee.NowPlaying/XOverlayVideoDisplay.cs	(original)
+++ trunk/banshee/src/Extensions/Banshee.NowPlaying/Banshee.NowPlaying/XOverlayVideoDisplay.cs	Tue Aug 12 18:05:07 2008
@@ -42,23 +42,40 @@
 
         public XOverlayVideoDisplay () : base ()
         {
-            WidgetFlags = WidgetFlags.NoWindow;
         }
         
         protected override void OnRealized ()
         {
             WidgetFlags |= WidgetFlags.Realized;
+        
+            Gdk.WindowAttr attributes = new Gdk.WindowAttr ();
+            attributes.WindowType = Gdk.WindowType.Child;
+            attributes.X = Allocation.X;
+            attributes.Y = Allocation.Y;
+            attributes.Width = Allocation.Width;
+            attributes.Height = Allocation.Height;
+            attributes.Visual = Visual;
+            attributes.Wclass = Gdk.WindowClass.InputOutput;
+            attributes.Colormap = Colormap;
+            attributes.EventMask = (int)(Gdk.EventMask.ExposureMask | Gdk.EventMask.VisibilityNotifyMask);
             
-            GdkWindow = Parent.GdkWindow;
+            Gdk.WindowAttributesType attributes_mask = 
+                Gdk.WindowAttributesType.X | 
+                Gdk.WindowAttributesType.Y | 
+                Gdk.WindowAttributesType.Visual | 
+                Gdk.WindowAttributesType.Colormap;
+                
+            GdkWindow = new Gdk.Window (Parent.GdkWindow, attributes, attributes_mask);
+            GdkWindow.UserData = Handle;
             
             if (video_window != null) {
                 video_window.Reparent (GdkWindow, 0, 0);
-                video_window.MoveResize (Allocation.X, Allocation.Y, Allocation.Width, Allocation.Height);
+                video_window.MoveResize (0, 0, Allocation.Width, Allocation.Height);
                 video_window.ShowUnraised ();
                 return;
             }
             
-            Gdk.WindowAttr attributes = new Gdk.WindowAttr ();
+            attributes = new Gdk.WindowAttr ();
             attributes.WindowType = Gdk.WindowType.Child;
             attributes.X = 0;
             attributes.Y = 0;
@@ -69,7 +86,7 @@
             attributes.Colormap = Colormap;
             attributes.EventMask = (int)(Gdk.EventMask.ExposureMask | Gdk.EventMask.VisibilityNotifyMask);
             
-            Gdk.WindowAttributesType attributes_mask = 
+            attributes_mask = 
                 Gdk.WindowAttributesType.X | 
                 Gdk.WindowAttributesType.Y | 
                 Gdk.WindowAttributesType.Visual | 
@@ -93,14 +110,18 @@
 
         protected override void OnMapped ()
         {
-            base.OnMapped ();
+            WidgetFlags |= WidgetFlags.Mapped;
+            
+            GdkWindow.Show ();
             video_window.ShowUnraised ();
         }
         
         protected override void OnUnmapped ()
         {
+            WidgetFlags &= ~WidgetFlags.Mapped;
+            
             video_window.Hide ();
-            base.OnUnmapped ();
+            GdkWindow.Hide ();
         }
         
         protected override void OnSizeAllocated (Gdk.Rectangle allocation)
@@ -109,7 +130,7 @@
                 return;
             }
             
-            Gdk.Rectangle rect = new Gdk.Rectangle (allocation.X, allocation.Y, allocation.Width, allocation.Height);
+            Gdk.Rectangle rect = new Gdk.Rectangle (0, 0, allocation.Width, allocation.Height);
             video_window.MoveResize (rect);
             
             base.OnSizeAllocated (allocation);

Modified: trunk/banshee/src/Extensions/Banshee.NowPlaying/Makefile.am
==============================================================================
--- trunk/banshee/src/Extensions/Banshee.NowPlaying/Makefile.am	(original)
+++ trunk/banshee/src/Extensions/Banshee.NowPlaying/Makefile.am	Tue Aug 12 18:05:07 2008
@@ -9,10 +9,8 @@
 	Banshee.NowPlaying/FullscreenWindow.cs \
 	Banshee.NowPlaying/IFullscreenAdapter.cs \
 	Banshee.NowPlaying/IScreensaverManager.cs \
-	Banshee.NowPlaying/NowPlayingContents.cs \
 	Banshee.NowPlaying/NowPlayingInterface.cs \
 	Banshee.NowPlaying/NowPlayingSource.cs \
-	Banshee.NowPlaying/NowPlayingTrackInfoDisplay.cs \
 	Banshee.NowPlaying/OverlayWindow.cs \
 	Banshee.NowPlaying/ScreensaverManager.cs \
 	Banshee.NowPlaying/VideoDisplay.cs \

Modified: trunk/banshee/src/Libraries/Hyena.Gui/Hyena.Gui/CairoExtensions.cs
==============================================================================
--- trunk/banshee/src/Libraries/Hyena.Gui/Hyena.Gui/CairoExtensions.cs	(original)
+++ trunk/banshee/src/Libraries/Hyena.Gui/Hyena.Gui/CairoExtensions.cs	Tue Aug 12 18:05:07 2008
@@ -63,17 +63,6 @@
                 PangoCairoHelper.ContextSetResolution (context, resolution);
             }
         }
-        
-        public static Surface CreateSurfaceForPixbuf (Cairo.Context cr, Gdk.Pixbuf pixbuf)
-        {
-            Surface surface = cr.Target.CreateSimilar (cr.Target.Content, pixbuf.Width, pixbuf.Height);
-            Cairo.Context surface_cr = new Context (surface);
-            surface_cr.Rectangle (0, 0, pixbuf.Width, pixbuf.Height);
-            Gdk.CairoHelper.SetSourcePixbuf (surface_cr, pixbuf, 0, 0);
-            surface_cr.Fill ();
-            ((IDisposable)surface_cr).Dispose ();
-            return surface;
-        }
     
         public static Cairo.Color GdkColorToCairoColor(Gdk.Color color)
         {



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