Add pause/play display again
Signed-off-by: Mahyar Koshkouei <deltabeard@users.noreply.github.com>
This commit is contained in:
@@ -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);
|
||||||
|
|
||||||
|
|||||||
@@ -167,6 +167,11 @@ void stopPlayback(void)
|
|||||||
stop = true;
|
stop = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool isPlaying(void)
|
||||||
|
{
|
||||||
|
return !stop;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Obtains file type.
|
* Obtains file type.
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -19,6 +19,8 @@ bool togglePlayback(void);
|
|||||||
|
|
||||||
void stopPlayback(void);
|
void stopPlayback(void);
|
||||||
|
|
||||||
|
bool isPlaying(void);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Obtains file type.
|
* Obtains file type.
|
||||||
*
|
*
|
||||||
|
|||||||
Reference in New Issue
Block a user