summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 22196e8)
raw | patch | inline | side by side (parent: 22196e8)
author | Max Kellermann <max@duempel.org> | |
Thu, 9 Jul 2009 17:21:38 +0000 (19:21 +0200) | ||
committer | Max Kellermann <max@duempel.org> | |
Thu, 9 Jul 2009 17:21:38 +0000 (19:21 +0200) |
src/playlist.h | patch | blob | history | |
src/screen_browser.c | patch | blob | history |
diff --git a/src/playlist.h b/src/playlist.h
index 77983f6ed6ec1b2a0beccd4e52d808e282dde286..ca0950d34c41bf953d3e688f51fd65c3fd3239e6 100644 (file)
--- a/src/playlist.h
+++ b/src/playlist.h
gint
playlist_get_index_from_file(const struct mpdclient *c, const gchar *filename);
+static inline gint
+playlist_get_index_from_same_song(const struct mpdclient *c,
+ const struct mpd_song *song)
+{
+ return playlist_get_index_from_file(c, song->file);
+}
+
#endif
diff --git a/src/screen_browser.c b/src/screen_browser.c
index 152ee9a1c4baadcbfd59374cbbd834f8e01dac1e..f8386bb426a45e1904ded9680882238fcb311ff1 100644 (file)
--- a/src/screen_browser.c
+++ b/src/screen_browser.c
if ( entity && entity->type==MPD_INFO_ENTITY_TYPE_SONG ) {
mpd_Song *song = entity->info.song;
- if( playlist_get_index_from_file(c, song->file) >= 0 )
+ if (playlist_get_index_from_same_song(c, song) >= 0)
entry->flags |= HIGHLIGHT;
else
entry->flags &= ~HIGHLIGHT;
}
#endif
- idx = playlist_get_index_from_file(c, song->file);
+ idx = playlist_get_index_from_same_song(c, song);
mpdclient_cmd_play(c, idx);
return true;
}
entry->flags &= ~HIGHLIGHT;
- while ((idx = playlist_get_index_from_file(c, song->file)) >=0)
+ while ((idx = playlist_get_index_from_same_song(c, song)) >= 0)
mpdclient_cmd_delete(c, idx);
#endif
}