comparison input/input.h @ 4418:8141d2c399e4

A new configurable input system and joystick support for this system
author albeu
date Wed, 30 Jan 2002 12:46:03 +0000
parents
children 44c23fd75005
comparison
equal deleted inserted replaced
4417:4f507d28716d 4418:8141d2c399e4
1
2 #ifdef HAVE_NEW_INPUT
3
4 #define MP_CMD_SEEK 0
5 #define MP_CMD_AUDIO_DELAY 1
6 #define MP_CMD_QUIT 2
7 #define MP_CMD_PAUSE 3
8 #define MP_CMD_GRAB_FRAMES 4
9 #define MP_CMD_PLAY_TREE_STEP 5
10 #define MP_CMD_PLAY_TREE_UP_STEP 6
11 #define MP_CMD_PLAY_ALT_SRC_STEP 7
12 #define MP_CMD_SUB_DELAY 8
13 #define MP_CMD_OSD 9
14 #define MP_CMD_VOLUME 10
15 #define MP_CMD_MIXER_USEMASTER 11
16 #define MP_CMD_CONTRAST 12
17 #define MP_CMD_BRIGHTNESS 13
18 #define MP_CMD_HUE 14
19 #define MP_CMD_SATURATION 15
20 #define MP_CMD_FRAMEDROPPING 16
21 #define MP_CMD_TV_STEP_CHANNEL 17
22 #define MP_CMD_TV_STEP_NORM 18
23 #define MP_CMD_TV_STEP_CHANNEL_LIST 19
24
25 #define MP_CMD_ARG_INT 0
26 #define MP_CMD_ARG_FLOAT 1
27 #define MP_CMD_ARG_STRING 2
28
29 #define MP_CMD_MAX_ARGS 10
30
31 #define MP_INPUT_ERROR -1
32 #define MP_INPUT_DEAD -2
33 #define MP_INPUT_NOTHING -3
34
35 typedef union mp_cmd_arg_value {
36 int i;
37 float f;
38 char* s;
39 } mp_cmd_arg_value_t;
40
41 typedef struct mp_cmd_arg {
42 int type;
43 mp_cmd_arg_value_t v;
44 } mp_cmd_arg_t;
45
46 typedef struct mp_cmd {
47 int id;
48 char* name;
49 int nargs;
50 mp_cmd_arg_t args[MP_CMD_MAX_ARGS];
51 } mp_cmd_t;
52
53
54 typedef struct mp_cmd_bind {
55 int input;
56 char* cmd;
57 } mp_cmd_bind_t;
58
59 typedef int (*mp_key_func_t)(int fd);
60 typedef int (*mp_cmd_func_t)(int fd,char* dest,int size);
61 typedef void (*mp_close_func_t)(int fd);
62
63 int
64 mp_input_add_cmd_fd(int fd, int select, mp_cmd_func_t read_func, mp_close_func_t close_func);
65
66 void
67 mp_input_rm_cmd_fd(int fd);
68
69 int
70 mp_input_add_key_fd(int fd, int select, mp_key_func_t read_func, mp_close_func_t close_func);
71
72 void
73 mp_input_rm_key_fd(int fd);
74
75 mp_cmd_t*
76 mp_input_get_cmd(int time, int paused);
77
78 void
79 mp_cmd_free(mp_cmd_t* cmd);
80
81 void
82 mp_input_init(void);
83
84 #endif /* HAVE_NEW_INPUT */