# HG changeset patch # User nenolod # Date 1150348640 25200 # Node ID 7918849bad3e6cfa5429475aaf64f6e58ca175f0 # Parent 3f0412bb58878290d32f18df4a89a2485393df64 [svn] - more sanity for input_get_song_tuple() - playlist_get_tuple(gint pos) diff -r 3f0412bb5887 -r 7918849bad3e ChangeLog --- a/ChangeLog Wed Jun 14 22:08:37 2006 -0700 +++ b/ChangeLog Wed Jun 14 22:17:20 2006 -0700 @@ -1,3 +1,12 @@ +2006-06-15 05:08:37 +0000 William Pitcock + revision [1382] + - get_song_tuple implementation + + + Changes: Modified: + +71 -58 trunk/Plugins/Input/vorbis/vorbis.c + + 2006-06-15 04:47:23 +0000 William Pitcock revision [1380] - get_song_tuple() implementation diff -r 3f0412bb5887 -r 7918849bad3e audacious/input.c --- a/audacious/input.c Wed Jun 14 22:08:37 2006 -0700 +++ b/audacious/input.c Wed Jun 14 22:17:20 2006 -0700 @@ -520,6 +520,9 @@ if ((ext = strrchr(tmp, '.'))) *ext = '\0'; + input->track_name = NULL; + input->length = -1; + input_get_song_info(filename, &input->track_name, &input->length); input->file_name = g_path_get_basename(tmp); input->file_ext = ext ? ext + 1 : NULL; input->file_path = tmp; diff -r 3f0412bb5887 -r 7918849bad3e audacious/playlist.c --- a/audacious/playlist.c Wed Jun 14 22:08:37 2006 -0700 +++ b/audacious/playlist.c Wed Jun 14 22:17:20 2006 -0700 @@ -1678,6 +1678,34 @@ return str_to_utf8(title); } +TitleInput * +playlist_get_tuple(guint pos) +{ + PlaylistEntry *entry; + TitleInput *tuple = NULL; + GList *node; + + PLAYLIST_LOCK(); + + if (!playlist) { + PLAYLIST_UNLOCK(); + return NULL; + } + + if (!(node = g_list_nth(playlist, pos))) { + PLAYLIST_UNLOCK(); + return NULL; + } + + entry = (PlaylistEntry *) node->data; + + tuple = entry->tuple; + + PLAYLIST_UNLOCK(); + + return tuple; +} + gint playlist_get_songtime(guint pos) { diff -r 3f0412bb5887 -r 7918849bad3e audacious/playlist.h --- a/audacious/playlist.h Wed Jun 14 22:08:37 2006 -0700 +++ b/audacious/playlist.h Wed Jun 14 22:17:20 2006 -0700 @@ -130,6 +130,7 @@ gchar *playlist_get_filename(guint pos); gchar *playlist_get_songtitle(guint pos); +TitleInput *playlist_get_tuple(guint pos); gint playlist_get_songtime(guint pos); GList *playlist_get_selected(void);