summaryrefslogtreecommitdiffstats
path: root/input/input.h
diff options
context:
space:
mode:
Diffstat (limited to 'input/input.h')
-rw-r--r--input/input.h72
1 files changed, 24 insertions, 48 deletions
diff --git a/input/input.h b/input/input.h
index 12a56c8509..82718b9b29 100644
--- a/input/input.h
+++ b/input/input.h
@@ -90,6 +90,7 @@ typedef enum {
MP_CMD_KEYDOWN_EVENTS,
MP_CMD_VO_BORDER,
MP_CMD_SET_PROPERTY,
+ MP_CMD_SET_PROPERTY_OSD,
MP_CMD_GET_PROPERTY,
MP_CMD_OSD_SHOW_PROPERTY_TEXT,
MP_CMD_SEEK_CHAPTER,
@@ -113,6 +114,7 @@ typedef enum {
MP_CMD_RADIO_SET_FREQ,
MP_CMD_SET_MOUSE_POS,
MP_CMD_STEP_PROPERTY,
+ MP_CMD_STEP_PROPERTY_OSD,
MP_CMD_RADIO_STEP_FREQ,
MP_CMD_TV_STEP_FREQ,
MP_CMD_LOOP,
@@ -140,18 +142,6 @@ typedef enum {
MP_CMD_DVDNAV_PREVMENU,
MP_CMD_DVDNAV_MOUSECLICK,
- /// GUI commands
- MP_CMD_GUI_EVENTS = 5000,
- MP_CMD_GUI_LOADFILE,
- MP_CMD_GUI_LOADSUBTITLE,
- MP_CMD_GUI_ABOUT,
- MP_CMD_GUI_PLAY,
- MP_CMD_GUI_STOP,
- MP_CMD_GUI_PLAYLIST,
- MP_CMD_GUI_PREFERENCES,
- MP_CMD_GUI_FULLSCREEN,
- MP_CMD_GUI_SKINBROWSER,
-
/// DVB commands
MP_CMD_DVB_SET_CHANNEL = 5101,
@@ -193,6 +183,8 @@ typedef enum {
#define MP_MAX_KEY_DOWN 32
#endif
+struct input_ctx;
+
typedef union mp_cmd_arg_value {
int i;
float f;
@@ -214,21 +206,11 @@ typedef struct mp_cmd {
} mp_cmd_t;
-typedef struct mp_cmd_bind {
- int input[MP_MAX_KEY_DOWN+1];
- char* cmd;
-} mp_cmd_bind_t;
-
-typedef struct mp_key_name {
- int key;
- char* name;
-} mp_key_name_t;
-
// These typedefs are for the drivers. They are the functions used to retrieve
// the next key code or command.
// These functions should return the key code or one of the error codes
-typedef int (*mp_key_func_t)(int fd);
+typedef int (*mp_key_func_t)(void *ctx, int fd);
// These functions should act like read but they must use our error code (if needed ;-)
typedef int (*mp_cmd_func_t)(int fd,char* dest,int size);
// These are used to close the driver
@@ -246,25 +228,20 @@ typedef int (*mp_input_cmd_filter)(mp_cmd_t* cmd, int paused, void* ctx);
// fd will be used.
// The last arg can be NULL if nothing is needed to close the driver. The close
// function can be used
-int
-mp_input_add_cmd_fd(int fd, int select, mp_cmd_func_t read_func, mp_close_func_t close_func);
+int mp_input_add_cmd_fd(struct input_ctx *ictx, int fd, int select,
+ mp_cmd_func_t read_func, mp_close_func_t close_func);
// This removes a cmd driver, you usually don't need to use it.
-void
-mp_input_rm_cmd_fd(int fd);
+void mp_input_rm_cmd_fd(struct input_ctx *ictx, int fd);
// The args are the same as for the key's drivers. If you don't use any valid fd you MUST
// give a read_func.
-int
-mp_input_add_key_fd(int fd, int select, mp_key_func_t read_func, mp_close_func_t close_func);
+int mp_input_add_key_fd(struct input_ctx *ictx, int fd, int select,
+ mp_key_func_t read_func, mp_close_func_t close_func,
+ void *ctx);
// As for the cmd one you usually don't need this function.
-void
-mp_input_rm_key_fd(int fd);
-
-int mp_input_add_event_fd(int fd, void (*read_func)(void));
-
-void mp_input_rm_event_fd(int fd);
+void mp_input_rm_key_fd(struct input_ctx *ictx, int fd);
/// Get input key from its name.
int mp_input_get_key_from_name(const char *name);
@@ -272,13 +249,12 @@ int mp_input_get_key_from_name(const char *name);
// This function can be used to put a command in the system again. It's used by libmpdemux
// when it performs a blocking operation to resend the command it received to the main
// loop.
-int
-mp_input_queue_cmd(mp_cmd_t* cmd);
+int mp_input_queue_cmd(struct input_ctx *ictx, mp_cmd_t* cmd);
// This function retrieves the next available command waiting no more than time msec.
// If pause is true, the next input will always return a pause command.
mp_cmd_t*
-mp_input_get_cmd(int time, int paused, int peek_only);
+mp_input_get_cmd(struct input_ctx *ictx, int time, int paused, int peek_only);
mp_cmd_t*
mp_input_parse_cmd(char* str);
@@ -287,7 +263,7 @@ mp_input_parse_cmd(char* str);
* Parse and queue commands separated by '\n'.
* @return count of commands new queued.
*/
-int mp_input_parse_and_queue_cmds(const char *str);
+int mp_input_parse_and_queue_cmds(struct input_ctx *ictx, const char *str);
/// These filters allow you to process the command before MPlayer.
/// If a filter returns a true value mp_input_get_cmd will return NULL.
@@ -304,23 +280,23 @@ mp_cmd_t*
mp_cmd_clone(mp_cmd_t* cmd);
// Set current input section
-void
-mp_input_set_section(char *name);
+void mp_input_set_section(struct input_ctx *ictx, char *name);
// Get current input section
-char*
-mp_input_get_section(void);
+char *mp_input_get_section(struct input_ctx *ictx);
// When you create a new driver you should add it in these 2 functions.
-void
-mp_input_init(int use_gui);
+struct input_conf;
+struct input_ctx *mp_input_init(struct input_conf *input_conf);
-void
-mp_input_uninit(void);
+void mp_input_uninit(struct input_ctx *ictx);
+
+struct m_config;
+void mp_input_register_options(struct m_config *cfg);
// Interruptible usleep: (used by libmpdemux)
int
-mp_input_check_interrupt(int time);
+mp_input_check_interrupt(struct input_ctx *ictx, int time);
extern int async_quit_request;