summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--apps/playlist.c14
-rw-r--r--apps/playlist.h2
-rw-r--r--apps/wps-display.c4
3 files changed, 20 insertions, 0 deletions
diff --git a/apps/playlist.c b/apps/playlist.c
index 3c512cd82f..091a8bb1b0 100644
--- a/apps/playlist.c
+++ b/apps/playlist.c
@@ -111,6 +111,20 @@ int playlist_first_index(void)
111 return playlist.first_index; 111 return playlist.first_index;
112} 112}
113 113
114void playlist_name(char *name, int name_size)
115{
116 char buf[MAX_PATH+1];
117 int i = 0;
118
119 snprintf(buf, "%s", playlist.filename+playlist.dirlen);
120 while((buf[i] != '.') && (buf[i] != 0))
121 i++;
122 buf[i] = 0;
123
124 snprintf(name, name_size, "%s", buf);
125 return;
126}
127
114int playlist_next(int steps) 128int playlist_next(int steps)
115{ 129{
116 playlist.index = get_next_index(steps); 130 playlist.index = get_next_index(steps);
diff --git a/apps/playlist.h b/apps/playlist.h
index c47fec4325..39ed3a568d 100644
--- a/apps/playlist.h
+++ b/apps/playlist.h
@@ -51,8 +51,10 @@ void sort_playlist(bool start_current);
51void empty_playlist(void); 51void empty_playlist(void);
52void add_indices_to_playlist(void); 52void add_indices_to_playlist(void);
53void playlist_clear(void); 53void playlist_clear(void);
54void playlist_name(char *name, int name_size);
54int playlist_add(char *filename); 55int playlist_add(char *filename);
55int playlist_amount(void); 56int playlist_amount(void);
56int playlist_first_index(void); 57int playlist_first_index(void);
57 58
58#endif /* __PLAYLIST_H__ */ 59#endif /* __PLAYLIST_H__ */
60
diff --git a/apps/wps-display.c b/apps/wps-display.c
index 59fda08cac..88bfa73687 100644
--- a/apps/wps-display.c
+++ b/apps/wps-display.c
@@ -318,6 +318,10 @@ static char* get_tag(struct mp3entry* id3,
318 snprintf(buf, buf_size, "%d", id3->index + 1); 318 snprintf(buf, buf_size, "%d", id3->index + 1);
319 return buf; 319 return buf;
320 320
321 case 'n': /* Playlist Name (without path) */
322 playlist_name(buf, buf_size);
323 return buf;
324
321 case 'e': /* Playlist Total Entries */ 325 case 'e': /* Playlist Total Entries */
322 snprintf(buf, buf_size, "%d", playlist_amount()); 326 snprintf(buf, buf_size, "%d", playlist_amount());
323 return buf; 327 return buf;