From 54e31581a3cc8cd5501baa8553ab0a1cf2a75bee Mon Sep 17 00:00:00 2001 From: albeu Date: Thu, 14 Nov 2002 23:41:44 +0000 Subject: Add the possibilty to grab the keys and to filter the commands Add the commands for the osd menu git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@8197 b3059339-0415-0410-9bf9-f77b7e298cf2 --- input/input.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'input/input.h') diff --git a/input/input.h b/input/input.h index d03b6d5aa5..f81f42a0ce 100644 --- a/input/input.h +++ b/input/input.h @@ -31,6 +31,8 @@ #define MP_CMD_GAMMA 29 #define MP_CMD_SUB_VISIBILITY 30 #define MP_CMD_VOBSUB_LANG 31 +#define MP_CMD_MENU 32 +#define MP_CMD_SET_MENU 33 #define MP_CMD_GUI_EVENTS 5000 #define MP_CMD_GUI_LOADFILE 5001 @@ -52,6 +54,11 @@ #define MP_CMD_DVDNAV_MENU 5 #define MP_CMD_DVDNAV_SELECT 6 +/// Console command +#define MP_CMD_CHELP 7000 +#define MP_CMD_CEXIT 7001 +#define MP_CMD_CHIDE 7002 + // The args types #define MP_CMD_ARG_INT 0 #define MP_CMD_ARG_FLOAT 1 @@ -122,6 +129,11 @@ typedef int (*mp_cmd_func_t)(int fd,char* dest,int size); // These are used to close the driver typedef void (*mp_close_func_t)(int fd); +// Set this to grab all incoming key code +extern void (*mp_input_key_cb)(int code); +// Should return 1 if the command was processed +typedef int (*mp_input_cmd_filter)(mp_cmd_t* cmd, int paused, void* ctx); + // This function add a new key driver. // The first arg is a file descriptor (use a negative value if you don't use any fd) // The second arg tell if we use select on the fd to know if something is avaible. @@ -156,6 +168,14 @@ mp_input_queue_cmd(mp_cmd_t* cmd); mp_cmd_t* mp_input_get_cmd(int time, int paused); +mp_cmd_t* +mp_input_parse_cmd(char* str); + +/// These filter allow you to process the command before mplayer +/// If a filter return a true value mp_input_get_cmd will return NULL +void +mp_input_add_cmd_filter(mp_input_cmd_filter, void* ctx); + // After getting a command from mp_input_get_cmd you need to free it using this // function void -- cgit v1.2.3