feat: refactor album art handling, implement progress bar display, and update application version to dev63
Some checks failed
Build (3DS) / build (push) Failing after 2m6s
Some checks failed
Build (3DS) / build (push) Failing after 2m6s
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
/**
|
||||
* mice - 3DS Music Player
|
||||
* Copyright (C) 2016 Mahyar Koshkouei
|
||||
* Copyright (C) 2016 sillyangel
|
||||
*
|
||||
* This program comes with ABSOLUTELY NO WARRANTY and is free software. You are
|
||||
* welcome to redistribute it under certain conditions; for details see the
|
||||
@@ -614,18 +614,24 @@ int main(int argc __attribute__((unused)), char **argv __attribute__((unused)))
|
||||
/* Display metadata if we have any */
|
||||
if(currentMetadata.title[0] || currentMetadata.artist[0] || currentMetadata.album[0])
|
||||
{
|
||||
const char* currentFile = (fileNum > 0 && fileNum <= dirList.dirNum + dirList.fileNum) ?
|
||||
(fileNum > dirList.dirNum ? dirList.files[fileNum - dirList.dirNum - 1] : "..") : "";
|
||||
guiDisplayMetadata(¤tMetadata, currentFile);
|
||||
guiDisplayAlbumArt(¤tMetadata);
|
||||
const char* currentFile = (fileNum > 0 && fileNum <= dirList.dirNum + dirList.fileNum) ?
|
||||
(fileNum > dirList.dirNum ? dirList.files[fileNum - dirList.dirNum - 1] : "..") : "";
|
||||
guiDisplayMetadata(¤tMetadata, currentFile);
|
||||
}
|
||||
|
||||
/* Calculate scroll position to keep selection visible (14 lines visible) */
|
||||
/* Calculate scroll position to keep selection visible (13 lines visible with path) */
|
||||
int scroll = from;
|
||||
if(fileNum < scroll)
|
||||
scroll = fileNum;
|
||||
else if(fileNum >= scroll + 14)
|
||||
scroll = fileNum - 13;
|
||||
else if(fileNum >= scroll + 13)
|
||||
scroll = fileNum - 12;
|
||||
|
||||
/* Display current directory path */
|
||||
char currentPath[256];
|
||||
if(getcwd(currentPath, sizeof(currentPath)))
|
||||
{
|
||||
guiDisplayCurrentPath(currentPath);
|
||||
}
|
||||
|
||||
/* Display file list on bottom screen */
|
||||
guiDisplayFileList(fileList, fileListCount, fileNum, scroll);
|
||||
@@ -633,11 +639,12 @@ int main(int argc __attribute__((unused)), char **argv __attribute__((unused)))
|
||||
/* Display logs on top screen */
|
||||
guiDisplayLog((const char**)logMessages, logMessageCount, logScroll);
|
||||
|
||||
/* Display playback status */
|
||||
/* Display playback status and progress bar */
|
||||
if(playbackInfo.samples_per_second > 0)
|
||||
{
|
||||
float position = (float)playbackInfo.samples_played / playbackInfo.samples_per_second;
|
||||
float duration = (float)playbackInfo.samples_total / playbackInfo.samples_per_second;
|
||||
guiDisplayProgressBar(position, duration);
|
||||
guiDisplayPlaybackStatus(isPlaying(), isPaused(), position, duration);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user