summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 3ddf03b)
raw | patch | inline | side by side (parent: 3ddf03b)
author | Max Kellermann <max@duempel.org> | |
Mon, 2 Nov 2009 19:57:38 +0000 (20:57 +0100) | ||
committer | Max Kellermann <max@duempel.org> | |
Mon, 2 Nov 2009 19:57:38 +0000 (20:57 +0100) |
Get the current song id from mpd_status_get_song_id().
src/player_command.c | patch | blob | history | |
src/screen.c | patch | blob | history | |
src/status_bar.c | patch | blob | history |
diff --git a/src/player_command.c b/src/player_command.c
index 505d2fc596d47709089fbb4bef3cbda925a3a1d5..a366b2a3003cccd08cdd3c8a0593b54ccc665f14 100644 (file)
--- a/src/player_command.c
+++ b/src/player_command.c
static bool
setup_seek(struct mpdclient *c)
{
- const struct mpd_song *song;
-
- song = mpdclient_get_current_song(c);
- if (song == NULL)
+ if (!mpdclient_is_playing(c))
return false;
- if (seek_id != (int)mpd_song_get_id(song)) {
- seek_id = mpd_song_get_id(song);
+ if (seek_id != (int)mpd_status_get_song_id(c->status)) {
+ seek_id = mpd_status_get_song_id(c->status);
seek_target_time = mpd_status_get_elapsed_time(c->status);
}
diff --git a/src/screen.c b/src/screen.c
index 5d6e4091698cc70b61635b7fbdaab4dfe945f58d..d3a826523b548380a9638d539113d31d764ebc38 100644 (file)
--- a/src/screen.c
+++ b/src/screen.c
{
unsigned elapsed, duration;
- if (c->song != NULL && seek_id == (int)mpd_song_get_id(c->song))
+ if (c->status == NULL)
+ elapsed = 0;
+ else if (seek_id >= 0 && seek_id == mpd_status_get_song_id(c->status))
elapsed = seek_target_time;
- else if (c->status != NULL)
- elapsed = mpd_status_get_elapsed_time(c->status);
else
- elapsed = 0;
+ elapsed = mpd_status_get_elapsed_time(c->status);
duration = mpdclient_is_playing(c)
? mpd_status_get_total_time(c->status)
diff --git a/src/status_bar.c b/src/status_bar.c
index 00724e3aae062952b1a9ab96ca74368f0c6de862..2e9449963058e00a7dec38be20a41e81249dd145 100644 (file)
--- a/src/status_bar.c
+++ b/src/status_bar.c
char elapsed_string[32], duration_string[32];
/*checks the conf to see whether to display elapsed or remaining time */
- if (song != NULL &&
- seek_id == (int)mpd_song_get_id(song))
+ if (seek_id >= 0 &&
+ seek_id == mpd_status_get_song_id(status))
elapsedTime = seek_target_time;
else if (options.display_remaining_time)
elapsedTime = total_time -