banshee r3487 - in trunk/banshee: . src/Core/Banshee.Core/Banshee.Streaming src/Core/Banshee.ThickClient/Banshee.Gui.Widgets src/Extensions/Banshee.NotificationArea/Banshee.NotificationArea
- From: gburt svn gnome org
- To: svn-commits-list gnome org
- Subject: banshee r3487 - in trunk/banshee: . src/Core/Banshee.Core/Banshee.Streaming src/Core/Banshee.ThickClient/Banshee.Gui.Widgets src/Extensions/Banshee.NotificationArea/Banshee.NotificationArea
- Date: Wed, 19 Mar 2008 23:44:37 +0000 (GMT)
Author: gburt
Date: Wed Mar 19 23:44:36 2008
New Revision: 3487
URL: http://svn.gnome.org/viewvc/banshee?rev=3487&view=rev
Log:
2008-03-19 Gabriel Burt <gabriel burt gmail com>
* src/Core/Banshee.Core/Banshee.Streaming/StreamTagger.cs: Take the title
from the filename if needed.
* src/Core/Banshee.ThickClient/Banshee.Gui.Widgets/TrackInfoDisplay.cs:
Display a video icon for missing video 'album art'.
* src/Extensions/Banshee.NotificationArea/Banshee.NotificationArea/NotificationAreaService.cs:
Change 'song' to 'item' in a few places.
Modified:
trunk/banshee/ChangeLog
trunk/banshee/src/Core/Banshee.Core/Banshee.Streaming/StreamTagger.cs
trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Gui.Widgets/TrackInfoDisplay.cs
trunk/banshee/src/Extensions/Banshee.NotificationArea/Banshee.NotificationArea/NotificationAreaService.cs
Modified: trunk/banshee/src/Core/Banshee.Core/Banshee.Streaming/StreamTagger.cs
==============================================================================
--- trunk/banshee/src/Core/Banshee.Core/Banshee.Streaming/StreamTagger.cs (original)
+++ trunk/banshee/src/Core/Banshee.Core/Banshee.Streaming/StreamTagger.cs Wed Mar 19 23:44:36 2008
@@ -124,6 +124,16 @@
track.TrackCount = Choose ((int)file.Tag.TrackCount, track.TrackCount, preferTrackInfo);
track.Disc = Choose ((int)file.Tag.Disc, track.Disc, preferTrackInfo);
track.Year = Choose ((int)file.Tag.Year, track.Year, preferTrackInfo);
+
+ if (String.IsNullOrEmpty (track.TrackTitle)) {
+ try {
+ string filename = System.IO.Path.GetFileName (track.Uri.LocalPath);
+ if (!String.IsNullOrEmpty (filename)) {
+ filename = filename.Substring (0, filename.LastIndexOf ('.'));
+ track.TrackTitle = filename;
+ }
+ } catch {}
+ }
}
public static void TrackInfoMerge (TrackInfo track, StreamTag tag)
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 Wed Mar 19 23:44:36 2008
@@ -51,7 +51,8 @@
private ArtworkManager artwork_manager;
private Gdk.Pixbuf current_pixbuf;
private Gdk.Pixbuf incoming_pixbuf;
- private Gdk.Pixbuf missing_pixbuf;
+ private Gdk.Pixbuf missing_audio_pixbuf;
+ private Gdk.Pixbuf missing_video_pixbuf;
private Cairo.Color background_color;
private Cairo.Color text_color;
@@ -239,9 +240,14 @@
text_light_color = CairoExtensions.ColorAdjustBrightness (text_color, 0.5);
background_color = CairoExtensions.GdkColorToCairoColor (Style.Background (StateType.Normal));
- if (missing_pixbuf != null) {
- missing_pixbuf.Dispose ();
- missing_pixbuf = null;
+ if (missing_audio_pixbuf != null) {
+ missing_audio_pixbuf.Dispose ();
+ missing_audio_pixbuf = null;
+ }
+
+ if (missing_video_pixbuf != null) {
+ missing_video_pixbuf.Dispose ();
+ missing_video_pixbuf = null;
}
}
@@ -344,7 +350,12 @@
private void RenderCoverArt (Cairo.Context cr, Gdk.Pixbuf pixbuf)
{
ArtworkRenderer.RenderThumbnail (cr, pixbuf, false, 0, 0, Allocation.Height, Allocation.Height,
- pixbuf != missing_pixbuf, 0, pixbuf == missing_pixbuf, background_color);
+ IsMissingPixbuf (pixbuf), 0, IsMissingPixbuf (pixbuf), background_color);
+ }
+
+ private bool IsMissingPixbuf (Gdk.Pixbuf pb)
+ {
+ return (pb == missing_audio_pixbuf || pb == missing_video_pixbuf);
}
private void RenderTrackInfo (Cairo.Context cr, TrackInfo track, bool renderTrack, bool renderArtistAlbum)
@@ -411,7 +422,7 @@
{
TrackInfo track = ServiceManager.PlayerEngine.CurrentTrack;
- if (track == current_track && current_pixbuf != missing_pixbuf) {
+ if (track == current_track && !IsMissingPixbuf (current_pixbuf)) {
return;
} else if (track == null) {
incoming_track = null;
@@ -424,10 +435,17 @@
Gdk.Pixbuf pixbuf = artwork_manager.LookupScale (track.ArtistAlbumId, Allocation.Height);
if (pixbuf == null) {
- if (missing_pixbuf == null) {
- missing_pixbuf = IconThemeUtils.LoadIcon (32, "audio-x-generic");
+ if ((track.MediaAttributes & TrackMediaAttributes.VideoStream) != 0) {
+ if (missing_video_pixbuf == null) {
+ 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 (32, "audio-x-generic");
+ }
+ incoming_pixbuf = missing_audio_pixbuf;
}
- incoming_pixbuf = missing_pixbuf;
} else {
incoming_pixbuf = pixbuf;
}
@@ -452,7 +470,7 @@
Log.DebugFormat ("TrackInfoDisplay RenderAnimation: {0:0.00} FPS", last_fps);
}
- if (current_pixbuf != incoming_pixbuf && current_pixbuf != missing_pixbuf) {
+ if (current_pixbuf != incoming_pixbuf && !IsMissingPixbuf (current_pixbuf)) {
ArtworkRenderer.DisposePixbuf (current_pixbuf);
}
Modified: trunk/banshee/src/Extensions/Banshee.NotificationArea/Banshee.NotificationArea/NotificationAreaService.cs
==============================================================================
--- trunk/banshee/src/Extensions/Banshee.NotificationArea/Banshee.NotificationArea/NotificationAreaService.cs (original)
+++ trunk/banshee/src/Extensions/Banshee.NotificationArea/Banshee.NotificationArea/NotificationAreaService.cs Wed Mar 19 23:44:36 2008
@@ -120,7 +120,7 @@
actions.Add (new ToggleActionEntry [] {
new ToggleActionEntry ("ToggleNotificationsAction", null,
Catalog.GetString ("_Show Notifications"), null,
- Catalog.GetString ("Show notifications when song changes"), ToggleNotifications, ShowNotifications)
+ Catalog.GetString ("Show notifications when item changes"), ToggleNotifications, ShowNotifications)
});
interface_action_service.AddActionGroup (actions);
@@ -364,7 +364,7 @@
nf.Urgency = Urgency.Low;
nf.Timeout = 4500;
if (interface_action_service.PlaybackActions["NextAction"].Sensitive) {
- nf.AddAction ("skip-song", Catalog.GetString("Play next song"), OnSongSkipped);
+ nf.AddAction ("skip-song", Catalog.GetString("Play next item"), OnSongSkipped);
}
nf.Show ();
@@ -423,7 +423,7 @@
"plugins.notification_area", "show_notifications",
true,
"Show notifications",
- "Show track information notifications when track starts playing"
+ "Show information notifications when item starts playing"
);
public static readonly SchemaEntry<bool> NotifyOnCloseSchema = new SchemaEntry<bool> (
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]