mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-10-28 16:26:21 -04:00
properties plugin: Make the ID3 info available on HWCODEC targets too.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@14334 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
ee44c8da52
commit
4918059225
1 changed files with 17 additions and 20 deletions
|
|
@ -34,11 +34,9 @@ char str_filecount[64];
|
||||||
char str_date[64];
|
char str_date[64];
|
||||||
char str_time[64];
|
char str_time[64];
|
||||||
|
|
||||||
#if (CONFIG_CODEC == SWCODEC)
|
|
||||||
char str_title[MAX_PATH];
|
char str_title[MAX_PATH];
|
||||||
char str_artist[MAX_PATH];
|
char str_artist[MAX_PATH];
|
||||||
char str_album[MAX_PATH];
|
char str_album[MAX_PATH];
|
||||||
#endif
|
|
||||||
|
|
||||||
int num_properties;
|
int num_properties;
|
||||||
|
|
||||||
|
|
@ -69,6 +67,7 @@ static bool file_properties(char* selected_file)
|
||||||
char tstr[MAX_PATH];
|
char tstr[MAX_PATH];
|
||||||
DIR* dir;
|
DIR* dir;
|
||||||
struct dirent* entry;
|
struct dirent* entry;
|
||||||
|
struct mp3entry id3;
|
||||||
|
|
||||||
char* ptr = rb->strrchr(selected_file, '/') + 1;
|
char* ptr = rb->strrchr(selected_file, '/') + 1;
|
||||||
int dirlen = (ptr - selected_file);
|
int dirlen = (ptr - selected_file);
|
||||||
|
|
@ -99,11 +98,12 @@ static bool file_properties(char* selected_file)
|
||||||
num_properties = 5;
|
num_properties = 5;
|
||||||
|
|
||||||
#if (CONFIG_CODEC == SWCODEC)
|
#if (CONFIG_CODEC == SWCODEC)
|
||||||
struct mp3entry id3;
|
|
||||||
int fd = rb->open(selected_file, O_RDONLY);
|
int fd = rb->open(selected_file, O_RDONLY);
|
||||||
if (fd >= 0)
|
if (fd >= 0 &&
|
||||||
{
|
rb->get_metadata(&id3, fd, selected_file, false))
|
||||||
if (rb->get_metadata(&id3, fd, selected_file, false))
|
#else
|
||||||
|
if (!rb->mp3info(&id3, selected_file, false))
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
rb->snprintf(str_artist, sizeof str_artist,
|
rb->snprintf(str_artist, sizeof str_artist,
|
||||||
"Artist: %s", id3.artist ? id3.artist : "");
|
"Artist: %s", id3.artist ? id3.artist : "");
|
||||||
|
|
@ -113,10 +113,9 @@ static bool file_properties(char* selected_file)
|
||||||
"Album: %s", id3.album ? id3.album : "");
|
"Album: %s", id3.album ? id3.album : "");
|
||||||
num_properties += 3;
|
num_properties += 3;
|
||||||
}
|
}
|
||||||
|
#if (CONFIG_CODEC == SWCODEC)
|
||||||
rb->close(fd);
|
rb->close(fd);
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
found = true;
|
found = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
@ -236,7 +235,6 @@ char * get_props(int selected_item, void* data, char *buffer)
|
||||||
case 4:
|
case 4:
|
||||||
rb->strcpy(buffer, its_a_dir ? "" : str_time);
|
rb->strcpy(buffer, its_a_dir ? "" : str_time);
|
||||||
break;
|
break;
|
||||||
#if (CONFIG_CODEC == SWCODEC)
|
|
||||||
case 5:
|
case 5:
|
||||||
rb->strcpy(buffer, its_a_dir ? "" : str_artist);
|
rb->strcpy(buffer, its_a_dir ? "" : str_artist);
|
||||||
break;
|
break;
|
||||||
|
|
@ -246,7 +244,6 @@ char * get_props(int selected_item, void* data, char *buffer)
|
||||||
case 7:
|
case 7:
|
||||||
rb->strcpy(buffer, its_a_dir ? "" : str_album);
|
rb->strcpy(buffer, its_a_dir ? "" : str_album);
|
||||||
break;
|
break;
|
||||||
#endif
|
|
||||||
default:
|
default:
|
||||||
rb->strcpy(buffer, "ERROR");
|
rb->strcpy(buffer, "ERROR");
|
||||||
break;
|
break;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue