diff options
author | William Wilgus <wilgus.william@gmail.com> | 2024-07-05 17:13:10 -0400 |
---|---|---|
committer | William Wilgus <me.theuser@yahoo.com> | 2024-07-09 01:40:02 -0400 |
commit | fdbaf7df597b404be04cecbdc83dbc0551a5b996 (patch) | |
tree | f4254d2ed63ce1174d9710a315678aeaf921399b /apps/iap | |
parent | 07cf87419189f8730eff53bb74669856a42a2016 (diff) | |
download | rockbox-fdbaf7df597b404be04cecbdc83dbc0551a5b996.tar.gz rockbox-fdbaf7df597b404be04cecbdc83dbc0551a5b996.zip |
[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
Diffstat (limited to 'apps/iap')
-rw-r--r-- | apps/iap/iap-core.c | 7 | ||||
-rw-r--r-- | apps/iap/iap-lingo4.c | 7 |
2 files changed, 4 insertions, 10 deletions
diff --git a/apps/iap/iap-core.c b/apps/iap/iap-core.c index da04a67311..3faf8237bf 100644 --- a/apps/iap/iap-core.c +++ b/apps/iap/iap-core.c | |||
@@ -685,7 +685,6 @@ bool iap_getc(const unsigned char x) | |||
685 | void iap_get_trackinfo(const unsigned int track, struct mp3entry* id3) | 685 | void iap_get_trackinfo(const unsigned int track, struct mp3entry* id3) |
686 | { | 686 | { |
687 | int tracknum; | 687 | int tracknum; |
688 | int fd; | ||
689 | struct playlist_track_info info; | 688 | struct playlist_track_info info; |
690 | 689 | ||
691 | tracknum = track; | 690 | tracknum = track; |
@@ -699,10 +698,8 @@ void iap_get_trackinfo(const unsigned int track, struct mp3entry* id3) | |||
699 | if(playlist_next(0) != tracknum) | 698 | if(playlist_next(0) != tracknum) |
700 | { | 699 | { |
701 | playlist_get_track_info(NULL, tracknum, &info); | 700 | playlist_get_track_info(NULL, tracknum, &info); |
702 | fd = open(info.filename, O_RDONLY); | 701 | /* memset(id3, 0, sizeof(*id3)) --get_metadata does this for us */ |
703 | memset(id3, 0, sizeof(*id3)); | 702 | get_metadata(id3, -1, info.filename); |
704 | get_metadata(id3, fd, info.filename); | ||
705 | close(fd); | ||
706 | } else { | 703 | } else { |
707 | memcpy(id3, audio_current_track(), sizeof(*id3)); | 704 | memcpy(id3, audio_current_track(), sizeof(*id3)); |
708 | } | 705 | } |
diff --git a/apps/iap/iap-lingo4.c b/apps/iap/iap-lingo4.c index e1ab150fd9..6eb63003a5 100644 --- a/apps/iap/iap-lingo4.c +++ b/apps/iap/iap-lingo4.c | |||
@@ -1787,7 +1787,6 @@ void iap_handlepkt_mode4(const unsigned int len, const unsigned char *buf) | |||
1787 | { | 1787 | { |
1788 | unsigned char data[70] = {0x04, 0x00, 0xFF}; | 1788 | unsigned char data[70] = {0x04, 0x00, 0xFF}; |
1789 | struct mp3entry id3; | 1789 | struct mp3entry id3; |
1790 | int fd; | ||
1791 | size_t len; | 1790 | size_t len; |
1792 | long tracknum = get_u32(&buf[3]); | 1791 | long tracknum = get_u32(&buf[3]); |
1793 | 1792 | ||
@@ -1802,10 +1801,8 @@ void iap_handlepkt_mode4(const unsigned int len, const unsigned char *buf) | |||
1802 | { | 1801 | { |
1803 | struct playlist_track_info info; | 1802 | struct playlist_track_info info; |
1804 | playlist_get_track_info(NULL, tracknum, &info); | 1803 | playlist_get_track_info(NULL, tracknum, &info); |
1805 | fd = open(info.filename, O_RDONLY); | 1804 | /* memset(&id3, 0, sizeof(struct mp3entry)); --get_metadata does this for us */ |
1806 | memset(&id3, 0, sizeof(struct mp3entry)); | 1805 | get_metadata(&id3, -1, info.filename); |
1807 | get_metadata(&id3, fd, info.filename); | ||
1808 | close(fd); | ||
1809 | } | 1806 | } |
1810 | /* Return the requested track data */ | 1807 | /* Return the requested track data */ |
1811 | switch(cmd) | 1808 | switch(cmd) |