[banshee] TrackInfoDisplay: Don't display last track when idle
- From: Gabriel Burt <gburt src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [banshee] TrackInfoDisplay: Don't display last track when idle
- Date: Fri, 18 Feb 2011 16:41:43 +0000 (UTC)
commit df725ea2d193b9924885289796264521f1e81057
Author: Gabriel Burt <gabriel burt gmail com>
Date: Fri Feb 18 10:33:58 2011 -0600
TrackInfoDisplay: Don't display last track when idle
This would happen if the TID's allocation changed.
.../Banshee.Gui.Widgets/TrackInfoDisplay.cs | 9 ++++++++-
1 files changed, 8 insertions(+), 1 deletions(-)
---
diff --git a/src/Core/Banshee.ThickClient/Banshee.Gui.Widgets/TrackInfoDisplay.cs b/src/Core/Banshee.ThickClient/Banshee.Gui.Widgets/TrackInfoDisplay.cs
index aae18b4..bfca4e1 100644
--- a/src/Core/Banshee.ThickClient/Banshee.Gui.Widgets/TrackInfoDisplay.cs
+++ b/src/Core/Banshee.ThickClient/Banshee.Gui.Widgets/TrackInfoDisplay.cs
@@ -49,6 +49,7 @@ namespace Banshee.Gui.Widgets
public abstract class TrackInfoDisplay : Widget
{
private string current_artwork_id;
+ private bool idle;
private ArtworkManager artwork_manager;
protected ArtworkManager ArtworkManager {
@@ -134,6 +135,7 @@ namespace Banshee.Gui.Widgets
if (ServiceManager.PlayerEngine != null) {
connected = value;
if (value) {
+ idle = ServiceManager.PlayerEngine.CurrentState == PlayerState.Idle;
ServiceManager.PlayerEngine.ConnectEvent (OnPlayerEvent,
PlayerEvent.StartOfStream |
PlayerEvent.TrackInfoUpdated |
@@ -188,7 +190,7 @@ namespace Banshee.Gui.Widgets
ResetMissingImages ();
- if (current_track == null) {
+ if (current_track == null && !idle) {
LoadCurrentTrack ();
} else {
Invalidate ();
@@ -379,6 +381,7 @@ namespace Banshee.Gui.Widgets
private void OnPlayerEvent (PlayerEventArgs args)
{
if (args.Event == PlayerEvent.StartOfStream) {
+ idle = false;
LoadCurrentTrack ();
} else if (args.Event == PlayerEvent.TrackInfoUpdated) {
LoadCurrentTrack (true);
@@ -399,7 +402,11 @@ namespace Banshee.Gui.Widgets
ServiceManager.PlayerEngine.CurrentState == PlayerState.Idle) {
incoming_track = null;
incoming_image = null;
+
current_artwork_id = null;
+ current_track = null;
+ current_image = null;
+ idle = true;
if (stage != null && stage.Actor == null) {
stage.Reset ();
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]