changeset 1235:7918849bad3e trunk

[svn] - more sanity for input_get_song_tuple() - playlist_get_tuple(gint pos)
author nenolod
date Wed, 14 Jun 2006 22:17:20 -0700
parents 3f0412bb5887
children fc478bfe6fe6
files ChangeLog audacious/input.c audacious/playlist.c audacious/playlist.h
diffstat 4 files changed, 41 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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 <nenolod@nenolod.net>
+  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 <nenolod@nenolod.net>
   revision [1380]
   - get_song_tuple() implementation
--- 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;
--- 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)
 {
--- 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);