forked from len0rd/rockbox
Track Info [Playlist] field: Add playlist name
For any selected track that is part of a playlist, additional info about the list is now provided in the [Playlist] field of the Track Info screen. 1) Asterisk indicates if playlist has been modified. 2) Playlist filename is visible, unless the current playlist is *not* associated with a file on disk, in which case the following will be shown instead: - (Folder) for unmodified folder playlists. - (Dynamic) for playlists that are neither associated with a playlist file, nor with a folder. Change-Id: I9dcf7cbba4ac2e37b23413180a2b2bf4bbe5ee2a
This commit is contained in:
parent
759aaecdff
commit
4cfd7cc77d
3 changed files with 45 additions and 5 deletions
|
@ -523,7 +523,7 @@ static enum pv_onplay_result show_track_info(const struct playlist_entry *curren
|
||||||
}
|
}
|
||||||
|
|
||||||
return id3_retrieval_successful &&
|
return id3_retrieval_successful &&
|
||||||
browse_id3(&id3, current_track->index + 1,
|
browse_id3_ex(&id3, viewer.playlist, current_track->index + 1,
|
||||||
viewer.num_tracks, NULL, 1) ? PV_ONPLAY_USB : PV_ONPLAY_UNCHANGED;
|
viewer.num_tracks, NULL, 1) ? PV_ONPLAY_USB : PV_ONPLAY_UNCHANGED;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -397,6 +397,7 @@ struct id3view_info {
|
||||||
struct tm *modified;
|
struct tm *modified;
|
||||||
int track_ct;
|
int track_ct;
|
||||||
int count;
|
int count;
|
||||||
|
struct playlist_info *playlist;
|
||||||
int playlist_display_index;
|
int playlist_display_index;
|
||||||
int playlist_amount;
|
int playlist_amount;
|
||||||
int info_id[ARRAYLEN(id3_headers)];
|
int info_id[ARRAYLEN(id3_headers)];
|
||||||
|
@ -496,6 +497,7 @@ static const char * id3_get_or_speak_info(int selected_item, void* data,
|
||||||
const unsigned char * const *unit;
|
const unsigned char * const *unit;
|
||||||
unsigned int unit_ct;
|
unsigned int unit_ct;
|
||||||
unsigned long length;
|
unsigned long length;
|
||||||
|
bool pl_modified;
|
||||||
struct tm *tm = info->modified;
|
struct tm *tm = info->modified;
|
||||||
int info_no=selected_item/2;
|
int info_no=selected_item/2;
|
||||||
if(!(selected_item%2))
|
if(!(selected_item%2))
|
||||||
|
@ -618,14 +620,39 @@ static const char * id3_get_or_speak_info(int selected_item, void* data,
|
||||||
case LANG_ID3_PLAYLIST:
|
case LANG_ID3_PLAYLIST:
|
||||||
if (info->playlist_display_index == 0 || info->playlist_amount == 0 )
|
if (info->playlist_display_index == 0 || info->playlist_amount == 0 )
|
||||||
return NULL;
|
return NULL;
|
||||||
snprintf(buffer, buffer_len, "%d/%d",
|
|
||||||
info->playlist_display_index, info->playlist_amount);
|
pl_modified = playlist_modified(info->playlist);
|
||||||
val=buffer;
|
|
||||||
|
snprintf(buffer, buffer_len, "%d/%d%s",
|
||||||
|
info->playlist_display_index, info->playlist_amount,
|
||||||
|
pl_modified ? "* " :" ");
|
||||||
|
val = buffer;
|
||||||
|
size_t prefix_len = strlen(buffer);
|
||||||
|
buffer += prefix_len;
|
||||||
|
buffer_len -= prefix_len;
|
||||||
|
|
||||||
|
if (info->playlist)
|
||||||
|
playlist_name(info->playlist, buffer, buffer_len);
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (playlist_allow_dirplay(NULL))
|
||||||
|
strmemccpy(buffer, "(Folder)", buffer_len);
|
||||||
|
else if (playlist_dynamic_only())
|
||||||
|
strmemccpy(buffer, "(Dynamic)", buffer_len);
|
||||||
|
else
|
||||||
|
playlist_name(NULL, buffer, buffer_len);
|
||||||
|
}
|
||||||
|
|
||||||
if(say_it)
|
if(say_it)
|
||||||
{
|
{
|
||||||
talk_number(info->playlist_display_index, true);
|
talk_number(info->playlist_display_index, true);
|
||||||
talk_id(VOICE_OF, true);
|
talk_id(VOICE_OF, true);
|
||||||
talk_number(info->playlist_amount, true);
|
talk_number(info->playlist_amount, true);
|
||||||
|
|
||||||
|
if (pl_modified)
|
||||||
|
talk_spell("Modified", true);
|
||||||
|
if (buffer) /* playlist name */
|
||||||
|
talk_spell(buffer, true);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case LANG_FORMAT:
|
case LANG_FORMAT:
|
||||||
|
@ -750,7 +777,8 @@ static int id3_speak_item(int selected_item, void* data)
|
||||||
/* Note: If track_ct > 1, filesize value will be treated as
|
/* Note: If track_ct > 1, filesize value will be treated as
|
||||||
* KiB (instead of Bytes), and length as s instead of ms.
|
* KiB (instead of Bytes), and length as s instead of ms.
|
||||||
*/
|
*/
|
||||||
bool browse_id3(struct mp3entry *id3, int playlist_display_index, int playlist_amount,
|
bool browse_id3_ex(struct mp3entry *id3, struct playlist_info *playlist,
|
||||||
|
int playlist_display_index, int playlist_amount,
|
||||||
struct tm *modified, int track_ct)
|
struct tm *modified, int track_ct)
|
||||||
{
|
{
|
||||||
struct gui_synclist id3_lists;
|
struct gui_synclist id3_lists;
|
||||||
|
@ -760,6 +788,7 @@ bool browse_id3(struct mp3entry *id3, int playlist_display_index, int playlist_a
|
||||||
info.id3 = id3;
|
info.id3 = id3;
|
||||||
info.modified = modified;
|
info.modified = modified;
|
||||||
info.track_ct = track_ct;
|
info.track_ct = track_ct;
|
||||||
|
info.playlist = playlist;
|
||||||
info.playlist_amount = playlist_amount;
|
info.playlist_amount = playlist_amount;
|
||||||
bool ret = false;
|
bool ret = false;
|
||||||
int curr_activity = get_current_activity();
|
int curr_activity = get_current_activity();
|
||||||
|
@ -821,6 +850,13 @@ refresh_info:
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool browse_id3(struct mp3entry *id3, int playlist_display_index, int playlist_amount,
|
||||||
|
struct tm *modified, int track_ct)
|
||||||
|
{
|
||||||
|
return browse_id3_ex(id3, NULL, playlist_display_index, playlist_amount,
|
||||||
|
modified, track_ct);
|
||||||
|
}
|
||||||
|
|
||||||
static const char* runtime_get_data(int selected_item, void* data,
|
static const char* runtime_get_data(int selected_item, void* data,
|
||||||
char* buffer, size_t buffer_len)
|
char* buffer, size_t buffer_len)
|
||||||
{
|
{
|
||||||
|
|
|
@ -24,6 +24,7 @@
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
#include "timefuncs.h"
|
#include "timefuncs.h"
|
||||||
#include "metadata.h"
|
#include "metadata.h"
|
||||||
|
#include "playlist.h"
|
||||||
|
|
||||||
struct screen;
|
struct screen;
|
||||||
|
|
||||||
|
@ -41,6 +42,9 @@ bool set_time_screen(const char* title, struct tm *tm, bool set_date);
|
||||||
|
|
||||||
bool browse_id3(struct mp3entry *id3, int playlist_display_index, int playlist_amount,
|
bool browse_id3(struct mp3entry *id3, int playlist_display_index, int playlist_amount,
|
||||||
struct tm *modified, int track_ct);
|
struct tm *modified, int track_ct);
|
||||||
|
bool browse_id3_ex(struct mp3entry *id3, struct playlist_info *playlist,
|
||||||
|
int playlist_display_index, int playlist_amount,
|
||||||
|
struct tm *modified, int track_ct);
|
||||||
int view_runtime(void);
|
int view_runtime(void);
|
||||||
|
|
||||||
#ifdef HAVE_TOUCHSCREEN
|
#ifdef HAVE_TOUCHSCREEN
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue