2002-01-30 12:46:03 +00:00
|
|
|
|
|
|
|
#ifdef HAVE_NEW_INPUT
|
|
|
|
|
|
|
|
#define MP_CMD_SEEK 0
|
|
|
|
#define MP_CMD_AUDIO_DELAY 1
|
|
|
|
#define MP_CMD_QUIT 2
|
|
|
|
#define MP_CMD_PAUSE 3
|
|
|
|
#define MP_CMD_GRAB_FRAMES 4
|
|
|
|
#define MP_CMD_PLAY_TREE_STEP 5
|
|
|
|
#define MP_CMD_PLAY_TREE_UP_STEP 6
|
|
|
|
#define MP_CMD_PLAY_ALT_SRC_STEP 7
|
|
|
|
#define MP_CMD_SUB_DELAY 8
|
|
|
|
#define MP_CMD_OSD 9
|
|
|
|
#define MP_CMD_VOLUME 10
|
|
|
|
#define MP_CMD_MIXER_USEMASTER 11
|
|
|
|
#define MP_CMD_CONTRAST 12
|
|
|
|
#define MP_CMD_BRIGHTNESS 13
|
|
|
|
#define MP_CMD_HUE 14
|
|
|
|
#define MP_CMD_SATURATION 15
|
|
|
|
#define MP_CMD_FRAMEDROPPING 16
|
|
|
|
#define MP_CMD_TV_STEP_CHANNEL 17
|
|
|
|
#define MP_CMD_TV_STEP_NORM 18
|
|
|
|
#define MP_CMD_TV_STEP_CHANNEL_LIST 19
|
2002-02-17 01:06:50 +00:00
|
|
|
#define MP_CMD_VO_FULLSCREEN 20
|
2002-01-30 12:46:03 +00:00
|
|
|
|
2002-02-25 13:14:27 +00:00
|
|
|
#define MP_CMD_GUI_EVENTS 5000
|
|
|
|
#define MP_CMD_GUI_LOADFILE 5001
|
|
|
|
#define MP_CMD_GUI_LOADSUBTITLE 5002
|
|
|
|
#define MP_CMD_GUI_ABOUT 5003
|
|
|
|
#define MP_CMD_GUI_PLAY 5004
|
|
|
|
#define MP_CMD_GUI_STOP 5005
|
|
|
|
#define MP_CMD_GUI_PLAYLIST 5006
|
|
|
|
#define MP_CMD_GUI_PREFERENCES 5007
|
|
|
|
#define MP_CMD_GUI_FULLSCREEN 5008
|
|
|
|
#define MP_CMD_GUI_SKINBROWSER 5009
|
|
|
|
|
2002-01-30 12:46:03 +00:00
|
|
|
#define MP_CMD_ARG_INT 0
|
|
|
|
#define MP_CMD_ARG_FLOAT 1
|
|
|
|
#define MP_CMD_ARG_STRING 2
|
|
|
|
|
|
|
|
#define MP_CMD_MAX_ARGS 10
|
|
|
|
|
|
|
|
#define MP_INPUT_ERROR -1
|
|
|
|
#define MP_INPUT_DEAD -2
|
|
|
|
#define MP_INPUT_NOTHING -3
|
|
|
|
|
2002-02-11 11:42:08 +00:00
|
|
|
#define MP_KEY_DOWN (1<<29)
|
2002-02-08 18:10:56 +00:00
|
|
|
// Key up is the default
|
2002-02-11 11:42:08 +00:00
|
|
|
#define MP_NO_REPEAT_KEY (1<<28)
|
2002-02-08 18:10:56 +00:00
|
|
|
|
|
|
|
#ifndef MP_MAX_KEY_DOWN
|
|
|
|
#define MP_MAX_KEY_DOWN 32
|
|
|
|
#endif
|
|
|
|
|
2002-01-30 12:46:03 +00:00
|
|
|
typedef union mp_cmd_arg_value {
|
|
|
|
int i;
|
|
|
|
float f;
|
|
|
|
char* s;
|
|
|
|
} mp_cmd_arg_value_t;
|
|
|
|
|
|
|
|
typedef struct mp_cmd_arg {
|
|
|
|
int type;
|
|
|
|
mp_cmd_arg_value_t v;
|
|
|
|
} mp_cmd_arg_t;
|
|
|
|
|
|
|
|
typedef struct mp_cmd {
|
|
|
|
int id;
|
|
|
|
char* name;
|
|
|
|
int nargs;
|
|
|
|
mp_cmd_arg_t args[MP_CMD_MAX_ARGS];
|
|
|
|
} mp_cmd_t;
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct mp_cmd_bind {
|
2002-02-08 18:10:56 +00:00
|
|
|
int input[MP_MAX_KEY_DOWN+1];
|
2002-01-30 12:46:03 +00:00
|
|
|
char* cmd;
|
|
|
|
} mp_cmd_bind_t;
|
|
|
|
|
2002-02-08 18:10:56 +00:00
|
|
|
typedef struct mp_key_name {
|
|
|
|
int key;
|
|
|
|
char* name;
|
|
|
|
} mp_key_name_t;
|
|
|
|
|
2002-01-30 12:46:03 +00:00
|
|
|
typedef int (*mp_key_func_t)(int fd);
|
|
|
|
typedef int (*mp_cmd_func_t)(int fd,char* dest,int size);
|
|
|
|
typedef void (*mp_close_func_t)(int fd);
|
|
|
|
|
|
|
|
int
|
|
|
|
mp_input_add_cmd_fd(int fd, int select, mp_cmd_func_t read_func, mp_close_func_t close_func);
|
|
|
|
|
|
|
|
void
|
|
|
|
mp_input_rm_cmd_fd(int fd);
|
|
|
|
|
|
|
|
int
|
|
|
|
mp_input_add_key_fd(int fd, int select, mp_key_func_t read_func, mp_close_func_t close_func);
|
|
|
|
|
|
|
|
void
|
|
|
|
mp_input_rm_key_fd(int fd);
|
|
|
|
|
2002-02-23 21:13:35 +00:00
|
|
|
int
|
|
|
|
mp_input_queue_cmd(mp_cmd_t* cmd);
|
|
|
|
|
2002-01-30 12:46:03 +00:00
|
|
|
mp_cmd_t*
|
|
|
|
mp_input_get_cmd(int time, int paused);
|
|
|
|
|
|
|
|
void
|
|
|
|
mp_cmd_free(mp_cmd_t* cmd);
|
|
|
|
|
2002-02-11 11:42:08 +00:00
|
|
|
mp_cmd_t*
|
|
|
|
mp_cmd_clone(mp_cmd_t* cmd);
|
|
|
|
|
2002-01-30 12:46:03 +00:00
|
|
|
void
|
|
|
|
mp_input_init(void);
|
|
|
|
|
2002-01-31 09:37:12 +00:00
|
|
|
void
|
|
|
|
mp_input_uninit(void);
|
|
|
|
|
2002-01-30 12:46:03 +00:00
|
|
|
#endif /* HAVE_NEW_INPUT */
|