forked from len0rd/rockbox
%pn now allows for conditional checking
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@2698 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
a477dc6cf5
commit
73926ef5e5
3 changed files with 14 additions and 12 deletions
|
|
@ -111,18 +111,21 @@ int playlist_first_index(void)
|
||||||
return playlist.first_index;
|
return playlist.first_index;
|
||||||
}
|
}
|
||||||
|
|
||||||
void playlist_name(char *name, int name_size)
|
char *playlist_name(char *buf, int buf_size)
|
||||||
{
|
{
|
||||||
char buf[MAX_PATH+1];
|
char *sep;
|
||||||
int i = 0;
|
|
||||||
|
|
||||||
snprintf(buf, sizeof(buf), "%s", playlist.filename+playlist.dirlen);
|
snprintf(buf, buf_size, "%s", playlist.filename+playlist.dirlen);
|
||||||
while((buf[i] != '.') && (buf[i] != 0))
|
|
||||||
i++;
|
|
||||||
buf[i] = 0;
|
|
||||||
|
|
||||||
snprintf(name, name_size, "%s", buf);
|
if (0 == buf[0])
|
||||||
return;
|
return NULL;
|
||||||
|
|
||||||
|
/* Remove extension */
|
||||||
|
sep = strrchr(buf, '.');
|
||||||
|
if (NULL != sep)
|
||||||
|
*sep = 0;
|
||||||
|
|
||||||
|
return buf;
|
||||||
}
|
}
|
||||||
|
|
||||||
int playlist_next(int steps)
|
int playlist_next(int steps)
|
||||||
|
|
|
||||||
|
|
@ -45,13 +45,13 @@ int play_list(char *dir, char *file, int start_index,
|
||||||
bool shuffled_index, int start_offset,
|
bool shuffled_index, int start_offset,
|
||||||
int random_seed, int first_index);
|
int random_seed, int first_index);
|
||||||
char* playlist_peek(int steps);
|
char* playlist_peek(int steps);
|
||||||
|
char* playlist_name(char *name, int name_size);
|
||||||
int playlist_next(int steps);
|
int playlist_next(int steps);
|
||||||
void randomise_playlist( unsigned int seed );
|
void randomise_playlist( unsigned int seed );
|
||||||
void sort_playlist(bool start_current);
|
void sort_playlist(bool start_current);
|
||||||
void empty_playlist(void);
|
void empty_playlist(void);
|
||||||
void add_indices_to_playlist(void);
|
void add_indices_to_playlist(void);
|
||||||
void playlist_clear(void);
|
void playlist_clear(void);
|
||||||
void playlist_name(char *name, int name_size);
|
|
||||||
int playlist_add(char *filename);
|
int playlist_add(char *filename);
|
||||||
int playlist_amount(void);
|
int playlist_amount(void);
|
||||||
int playlist_first_index(void);
|
int playlist_first_index(void);
|
||||||
|
|
|
||||||
|
|
@ -319,8 +319,7 @@ static char* get_tag(struct mp3entry* id3,
|
||||||
return buf;
|
return buf;
|
||||||
|
|
||||||
case 'n': /* Playlist Name (without path) */
|
case 'n': /* Playlist Name (without path) */
|
||||||
playlist_name(buf, buf_size);
|
return playlist_name(buf, buf_size);
|
||||||
return buf;
|
|
||||||
|
|
||||||
case 'e': /* Playlist Total Entries */
|
case 'e': /* Playlist Total Entries */
|
||||||
snprintf(buf, buf_size, "%d", playlist_amount());
|
snprintf(buf, buf_size, "%d", playlist_amount());
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue