-
Notifications
You must be signed in to change notification settings - Fork 19
/
omxd.h
74 lines (65 loc) · 2.03 KB
/
omxd.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#ifndef OMXD_H
#define OMXD_H
/* (c) SZABO Gergely <[email protected]>, license GNU GPL v2 */
#define LINE_LENGTH 1024
#define LINE_MAX (LINE_LENGTH - 1)
#define OMX_CMDS "frFRpkKomMs-+"
#define VOL_CMDS "-+"
#define LIST_CMDS "iaAIHJL.hjnNdDxXgule"
#define STOP_CMDS "P"
#define CLIENT_CMDS "S"
#define OPT_CMDS "O"
/* From player.c */
#include <unistd.h>
enum pstate {
P_DEAD,
P_PLAYING,
P_PAUSED
};
struct player;
struct player *player_new(char *file, char *out, enum pstate state);
void player_cmd(struct player *this, char *cmd);
void player_off(struct player *this);
void player_killall(void);
const char *player_file(struct player *this);
const char *player_logfile(struct player *this);
int player_dt(struct player *this);
enum pstate player_state(struct player *this);
void player_add_opt(char *opt);
void player_set_vol(int vol_mB); /* Set volume in milliBel */
/* From omxd.c */
void quit_callback(struct player *this);
/* From utils.c */
int writedec(int fd, int num);
int writestr(int fd, char *str);
int printfd(int fd, char *fmt, ...);
int sscand(char *str, int *num);
int scatd(char *str, int num);
#include <time.h>
extern int logfd; /* logfile descriptor */
extern int loglevel;
#define LOG(level, ...) { \
if ((level) <= loglevel) { \
lseek(logfd, 0, SEEK_END); \
printfd(logfd, "%d ", time(NULL)); \
printfd(logfd, __VA_ARGS__); \
} \
}
/* Filenames */
extern int I_root;
#define LIST_FILE (I_root ? "/var/local/omxplay" : "omxplay")
#define LOG_FILE (I_root ? "/var/log/omxlog" : "omxlog")
#define STAT_FILE (I_root ? "/var/log/omxstat" : "omxstat")
#define OMX_FILE (I_root ? "/var/log/omxplayer.log." : "omxplayer.log.")
#define PID_FILE (I_root ? "/var/run/omxd.pid" : "omxd.pid")
/* From m_list.c */
char **m_list(char *cmd, char *file);
enum e_lmode { LOOP, END, SHUFFLE };
extern enum e_lmode lmode;
/* From client.c */
#include <sys/stat.h>
mode_t get_ftype(char *file);
int client(int argc, char *argv[]);
int parse_status(char *st, char *playing, int *t_play, int *t_len, int *pid);
int player_length(char *omxp_log);
#endif