Add pause/play display again

Signed-off-by: Mahyar Koshkouei <deltabeard@users.noreply.github.com>
This commit is contained in:
Mahyar Koshkouei
2017-02-10 12:15:56 +00:00
parent 5b433f2396
commit 488a3d9357
3 changed files with 15 additions and 2 deletions

View File

@@ -83,8 +83,15 @@ int main(int argc, char **argv)
/* Pause/Play */ /* Pause/Play */
if(kDown & (KEY_R | KEY_UP)) if(kDown & (KEY_R | KEY_UP))
{ {
if(isPlaying() == false)
continue;
consoleSelect(&topScreen); consoleSelect(&topScreen);
printf("\r%s", togglePlayback() == true ? "Paused" : ""); if(togglePlayback() == true)
puts("Paused");
else
puts("Playing");
consoleSelect(&bottomScreen); consoleSelect(&bottomScreen);
continue; continue;
} }
@@ -207,7 +214,6 @@ int main(int argc, char **argv)
out: out:
puts("Exiting..."); puts("Exiting...");
/* TODO: Stop all threads */
stopPlayback(); stopPlayback();
changeFile(NULL); changeFile(NULL);

View File

@@ -167,6 +167,11 @@ void stopPlayback(void)
stop = true; stop = true;
} }
bool isPlaying(void)
{
return !stop;
}
/** /**
* Obtains file type. * Obtains file type.
* *

View File

@@ -19,6 +19,8 @@ bool togglePlayback(void);
void stopPlayback(void); void stopPlayback(void);
bool isPlaying(void);
/** /**
* Obtains file type. * Obtains file type.
* *