diff options
| author | Louis Burda <quent.burda@gmail.com> | 2021-12-04 13:48:01 +0100 |
|---|---|---|
| committer | Louis Burda <quent.burda@gmail.com> | 2021-12-20 15:31:16 +0100 |
| commit | 9fe644f0d99375ffd3011d8828f7dbd0fb103af0 (patch) | |
| tree | 71ed89f1c7316dba818bc921d772aaa1fc957dab /player.h | |
| parent | d68d0f39ab7675745e7d177f6774736f7ec58783 (diff) | |
| download | tmus-9fe644f0d99375ffd3011d8828f7dbd0fb103af0.tar.gz tmus-9fe644f0d99375ffd3011d8828f7dbd0fb103af0.zip | |
Added more gui interaction
Diffstat (limited to 'player.h')
| -rw-r--r-- | player.h | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/player.h b/player.h new file mode 100644 index 0000000..9e4bb07 --- /dev/null +++ b/player.h @@ -0,0 +1,54 @@ +#pragma once + +#include "util.h" + +#include "sndfile.h" + +#include <signal.h> + +enum { + PLAYER_NONE, + PLAYER_PAUSE, + PLAYER_PLAY, + PLAYER_SKIP, + PLAYER_PREV, + PLAYER_STOP, + PLAYER_LOAD, + PLAYER_EXIT +}; + +enum { + PLAYER_NOTSET, + PLAYER_OK, + PLAYER_FAIL +}; + +struct player { + int action, resp; + + int reload; + char *filepath; + SNDFILE *file; + SF_INFO info; + + int sample_index; + + int alive; + pid_t pid; +}; + +struct player *player_thread(void); + +void player_main(void); + +int player_alive(void); + +void player_loadfile(const char *path); +void player_action(int action); + +int player_pause(void); +int player_play(void); +int player_prev(void); +int player_skip(void); + +extern struct player *player; |
