GUI
This commit is contained in:
@@ -7,6 +7,7 @@
|
||||
#include "metadata.h"
|
||||
#include "file.h"
|
||||
#include "all.h"
|
||||
#include "gui.h"
|
||||
|
||||
/* Internal helper functions */
|
||||
static int extractId3v2Metadata(FILE* fp, struct metadata_t* metadata);
|
||||
@@ -96,56 +97,11 @@ void clearMetadata(struct metadata_t* metadata)
|
||||
|
||||
/**
|
||||
* Display metadata on the top screen
|
||||
* (Now uses GUI rendering - this is a wrapper for compatibility)
|
||||
*/
|
||||
void displayMetadata(struct metadata_t* metadata, const char* filename)
|
||||
{
|
||||
if(!metadata || !filename)
|
||||
return;
|
||||
|
||||
/* Clear the top screen info area */
|
||||
consoleClear();
|
||||
|
||||
/* Extract just the filename without path and extension for fallback */
|
||||
const char* basename = strrchr(filename, '/');
|
||||
if(!basename)
|
||||
basename = filename;
|
||||
else
|
||||
basename++; /* Skip the '/' */
|
||||
|
||||
/* Remove file extension for display */
|
||||
char displayName[64];
|
||||
strncpy(displayName, basename, sizeof(displayName) - 1);
|
||||
displayName[sizeof(displayName) - 1] = '\0';
|
||||
char* dot = strrchr(displayName, '.');
|
||||
if(dot) *dot = '\0';
|
||||
|
||||
/* Display song title */
|
||||
if(metadata->title[0])
|
||||
printf("%.47s\n", metadata->title);
|
||||
else
|
||||
printf("%.47s\n", displayName);
|
||||
|
||||
/* Display album */
|
||||
if(metadata->album[0])
|
||||
printf("%.47s\n", metadata->album);
|
||||
else
|
||||
printf("Unknown Album\n");
|
||||
|
||||
/* Display artist with album art indicator */
|
||||
if(metadata->artist[0])
|
||||
{
|
||||
printf("%.45s", metadata->artist);
|
||||
if(metadata->hasAlbumArt)
|
||||
printf(" 🖼️");
|
||||
printf("\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
printf("Unknown Artist");
|
||||
if(metadata->hasAlbumArt)
|
||||
printf(" 🖼️");
|
||||
printf("\n");
|
||||
}
|
||||
guiDisplayMetadata(metadata, filename);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user