From 59346bc23a2910851596a0c36622ba49ef7b3ba3 Mon Sep 17 00:00:00 2001 From: ben Date: Thu, 19 Jun 2008 18:51:42 +0000 Subject: Change DVDNAV command key names. Parameters now use a string much more intuitive than previous int value. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@27100 b3059339-0415-0410-9bf9-f77b7e298cf2 --- command.c | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) (limited to 'command.c') diff --git a/command.c b/command.c index dbec5918c1..cbad8f6014 100644 --- a/command.c +++ b/command.c @@ -2281,6 +2281,22 @@ static int set_property_command(MPContext * mpctx, mp_cmd_t * cmd) return 1; } +#ifdef USE_DVDNAV +static const struct { + const char *name; + const mp_command_type cmd; +} mp_dvdnav_bindings[] = { + { "up", MP_CMD_DVDNAV_UP }, + { "down", MP_CMD_DVDNAV_DOWN }, + { "left", MP_CMD_DVDNAV_LEFT }, + { "right", MP_CMD_DVDNAV_RIGHT }, + { "menu", MP_CMD_DVDNAV_MENU }, + { "select", MP_CMD_DVDNAV_SELECT }, + { "prev", MP_CMD_DVDNAV_PREVMENU }, + { "mouse", MP_CMD_DVDNAV_MOUSECLICK }, + { NULL, 0 } +}; +#endif int run_command(MPContext * mpctx, mp_cmd_t * cmd) { @@ -3105,10 +3121,18 @@ int run_command(MPContext * mpctx, mp_cmd_t * cmd) #ifdef USE_DVDNAV case MP_CMD_DVDNAV:{ int button = -1; + int i; + mp_command_type command = 0; if (mpctx->stream->type != STREAMTYPE_DVDNAV) break; - mp_dvdnav_handle_input(mpctx->stream,cmd->args[0].v.i,&button); + for (i = 0; mp_dvdnav_bindings[i].name; i++) + if (cmd->args[0].v.s && + !strcasecmp (cmd->args[0].v.s, + mp_dvdnav_bindings[i].name)) + command = mp_dvdnav_bindings[i].cmd; + + mp_dvdnav_handle_input(mpctx->stream,command,&button); if (osd_level > 1 && button > 0) set_osd_msg(OSD_MSG_TEXT, 1, osd_duration, "Selected button number %d", button); -- cgit v1.2.3 From 9f722f9037c6006b48e95b630b80df5c98286f89 Mon Sep 17 00:00:00 2001 From: ben Date: Fri, 20 Jun 2008 18:54:38 +0000 Subject: Keep old dvdnav sub-command options for a while in order not to break slave-mode API too suddenly. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@27101 b3059339-0415-0410-9bf9-f77b7e298cf2 --- command.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'command.c') diff --git a/command.c b/command.c index cbad8f6014..675b5977f3 100644 --- a/command.c +++ b/command.c @@ -2294,6 +2294,19 @@ static const struct { { "select", MP_CMD_DVDNAV_SELECT }, { "prev", MP_CMD_DVDNAV_PREVMENU }, { "mouse", MP_CMD_DVDNAV_MOUSECLICK }, + + /* + * keep old dvdnav sub-command options for a while in order not to + * break slave-mode API too suddenly. + */ + { "1", MP_CMD_DVDNAV_UP }, + { "2", MP_CMD_DVDNAV_DOWN }, + { "3", MP_CMD_DVDNAV_LEFT }, + { "4", MP_CMD_DVDNAV_RIGHT }, + { "5", MP_CMD_DVDNAV_MENU }, + { "6", MP_CMD_DVDNAV_SELECT }, + { "7", MP_CMD_DVDNAV_PREVMENU }, + { "8", MP_CMD_DVDNAV_MOUSECLICK }, { NULL, 0 } }; #endif -- cgit v1.2.3