[Feature] playlist_viewer id3 title display

Not sure this is a great idea from disk and battery standpoint
but there is no reason you can't..

using the name buffer to fill title data
prevent hitting the disk for each screen scroll

add get_metadata_ex to allow flags
 METADATA_EXCLUDE_ID3_PATH
  prevent copying the filename to the ID3 struct
 METADATA_CLOSE_FD_ON_EXIT
  instead of seeking to the beginning the file is closed before
  get_metadata returns

add logic to allow a invalid fd to signal that get_metadata
should open and close the file within its call

bugfix per Chris_s don't use the tagcache for the trackinfo

Change-Id: Ic7a595b39a8d7a57f975312bc9c8bb4111f22a88
This commit is contained in:
William Wilgus 2024-07-05 17:13:10 -04:00 committed by William Wilgus
parent 07cf874191
commit fdbaf7df59
9 changed files with 145 additions and 89 deletions

View file

@ -24,6 +24,8 @@
#include "platform.h"
#define METADATA_EXCLUDE_ID3_PATH (0x01) /* don't copy filename path to the id3 path buffer */
#define METADATA_CLOSE_FD_ON_EXIT (0x02) /* close the filedescriptor when finished */
/* Audio file types. */
/* NOTE: The values of the AFMT_* items are used for the %fc tag in the WPS
- so new entries MUST be added to the end to maintain compatibility.
@ -323,6 +325,7 @@ struct mp3entry {
unsigned int probe_file_format(const char *filename);
bool get_metadata(struct mp3entry* id3, int fd, const char* trackname);
bool get_metadata_ex(struct mp3entry* id3, int fd, const char* trackname, int flags);
bool mp3info(struct mp3entry *entry, const char *filename);
void adjust_mp3entry(struct mp3entry *entry, void *dest, const void *orig);
void copy_mp3entry(struct mp3entry *dest, const struct mp3entry *orig);