feat: update build tasks, enhance metadata handling, and improve GUI text display
This commit is contained in:
33
source/gui.c
33
source/gui.c
@@ -83,6 +83,12 @@ void guiClearBottomScreen(void)
|
||||
|
||||
/**
|
||||
* Draw a simple text string at specified position
|
||||
* @param screen Screen to draw on (GFX_TOP or GFX_BOTTOM)
|
||||
* @param x X position
|
||||
* @param y Y position
|
||||
* @param text Text string to draw
|
||||
* @param color Text color
|
||||
* @param scale Text scale
|
||||
*/
|
||||
void guiDrawText(gfxScreen_t screen, float x, float y, const char* text, u32 color, float scale)
|
||||
{
|
||||
@@ -101,6 +107,8 @@ void guiDrawText(gfxScreen_t screen, float x, float y, const char* text, u32 col
|
||||
|
||||
/**
|
||||
* Display metadata on the top screen
|
||||
* @param metadata Pointer to metadata structure to display
|
||||
* @param filename Filename to display if no title is available
|
||||
*/
|
||||
void guiDisplayMetadata(struct metadata_t* metadata, const char* filename)
|
||||
{
|
||||
@@ -185,6 +193,9 @@ void guiDisplayMetadata(struct metadata_t* metadata, const char* filename)
|
||||
|
||||
/**
|
||||
* Display log messages on the top screen
|
||||
* @param messages Array of log message strings
|
||||
* @param count Number of messages in the array
|
||||
* @param scroll Index of first visible message for scrolling
|
||||
*/
|
||||
void guiDisplayLog(const char** messages, int count, int scroll)
|
||||
{
|
||||
@@ -215,6 +226,10 @@ void guiDisplayLog(const char** messages, int count, int scroll)
|
||||
|
||||
/**
|
||||
* Display file list on the bottom screen
|
||||
* @param files Array of file/folder names
|
||||
* @param count Number of entries in the array
|
||||
* @param selected Index of currently selected entry
|
||||
* @param scroll Index of first visible entry for scrolling
|
||||
*/
|
||||
void guiDisplayFileList(const char** files, int count, int selected, int scroll)
|
||||
{
|
||||
@@ -269,6 +284,10 @@ void guiDisplayFileList(const char** files, int count, int selected, int scroll)
|
||||
|
||||
/**
|
||||
* Display playback controls and status on the top screen
|
||||
* @param isPlaying Whether playback is active
|
||||
* @param isPaused Whether playback is paused
|
||||
* @param position Current playback position in seconds
|
||||
* @param duration Total duration in seconds
|
||||
*/
|
||||
void guiDisplayPlaybackStatus(bool isPlaying, bool isPaused, float position, float duration)
|
||||
{
|
||||
@@ -319,6 +338,7 @@ void guiDisplayPlaybackStatus(bool isPlaying, bool isPaused, float position, flo
|
||||
|
||||
/**
|
||||
* Display version text and credits at bottom of bottom screen
|
||||
* @param version Version string to display
|
||||
*/
|
||||
void guiDisplayVersion(const char* version)
|
||||
{
|
||||
@@ -331,16 +351,20 @@ void guiDisplayVersion(const char* version)
|
||||
C2D_TextBufClear(textBuf);
|
||||
|
||||
/* Display "mice - by sillyangel" at bottom center */
|
||||
const char* credits = "mice - by sillyangel";
|
||||
char credits[64];
|
||||
if(version && version[0])
|
||||
snprintf(credits, sizeof(credits), "mice %s - by sillyangel", version);
|
||||
else
|
||||
snprintf(credits, sizeof(credits), "mice - by sillyangel");
|
||||
C2D_TextParse(&text, textBuf, credits);
|
||||
C2D_TextOptimize(&text);
|
||||
C2D_DrawText(&text, C2D_WithColor, 80.0f, 220.0f, 0.5f, 0.45f, 0.45f, GUI_COLOR_TEXT_DIM);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
/**
|
||||
* Display progress bar on top screen
|
||||
* Display progress bar on the top screen
|
||||
* @param position Current playback position in seconds
|
||||
* @param duration Total duration in seconds
|
||||
*/
|
||||
void guiDisplayProgressBar(float position, float duration)
|
||||
{
|
||||
@@ -372,6 +396,7 @@ void guiDisplayProgressBar(float position, float duration)
|
||||
|
||||
/**
|
||||
* Display current directory path on bottom screen
|
||||
* @param path Current directory path
|
||||
*/
|
||||
void guiDisplayCurrentPath(const char* path)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user