diff options
author | Robert Hak <adiamas@rockbox.org> | 2002-10-15 11:49:15 +0000 |
---|---|---|
committer | Robert Hak <adiamas@rockbox.org> | 2002-10-15 11:49:15 +0000 |
commit | f9d3d1cd91d67b9692a44fa6408dca5758336e6d (patch) | |
tree | 830d7f378f1bfbf955719144491f5a41c95d85ba /apps | |
parent | 3148bc45b0ab0d72d9dabe54d84648554f96015b (diff) | |
download | rockbox-f9d3d1cd91d67b9692a44fa6408dca5758336e6d.tar.gz rockbox-f9d3d1cd91d67b9692a44fa6408dca5758336e6d.zip |
added %pn (playlist name) to wps
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@2651 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
-rw-r--r-- | apps/playlist.c | 14 | ||||
-rw-r--r-- | apps/playlist.h | 2 | ||||
-rw-r--r-- | apps/wps-display.c | 4 |
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 | ||
114 | void 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 | |||
114 | int playlist_next(int steps) | 128 | int 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); | |||
51 | void empty_playlist(void); | 51 | void empty_playlist(void); |
52 | void add_indices_to_playlist(void); | 52 | void add_indices_to_playlist(void); |
53 | void playlist_clear(void); | 53 | void playlist_clear(void); |
54 | void playlist_name(char *name, int name_size); | ||
54 | int playlist_add(char *filename); | 55 | int playlist_add(char *filename); |
55 | int playlist_amount(void); | 56 | int playlist_amount(void); |
56 | int playlist_first_index(void); | 57 | int 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; |