Put playback in separate thread (WIP)
Selecting a file is possible whilst music is playing. Additionally fixes #19, an issue where the Home would not appear whilst music is playing. TODO: Remove printf from playback module. Fix pause and stop. Display errors properly using errno. Signed-off-by: Mahyar Koshkouei <deltabeard@users.noreply.github.com>
This commit is contained in:
12
source/all.h
12
source/all.h
@@ -11,6 +11,9 @@
|
||||
do { fprintf(stderr, "\nError %d:%s(): %s %s\n", __LINE__, __func__, \
|
||||
err, strerror(errno)); } while (0)
|
||||
|
||||
#define delete(ptr) \
|
||||
free(ptr); ptr = NULL
|
||||
|
||||
struct decoder_fn
|
||||
{
|
||||
int (* init)(const char* file);
|
||||
@@ -20,3 +23,12 @@ struct decoder_fn
|
||||
uint64_t (* decode)(void*);
|
||||
void (* exit)(void);
|
||||
};
|
||||
|
||||
/* Controls playback status */
|
||||
struct playback_t
|
||||
{
|
||||
bool stop;
|
||||
bool pause;
|
||||
char* file;
|
||||
int err;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user