diff options
author | Uoti Urpala <uau@symbol.nonexistent.invalid> | 2008-06-23 03:58:44 +0300 |
---|---|---|
committer | Uoti Urpala <uau@symbol.nonexistent.invalid> | 2008-06-23 03:58:44 +0300 |
commit | de560e8167c21a8fd9ea34f5f42f377102d65232 (patch) | |
tree | d5ef49221ccbb17308b0d14a96e6bd8cfba5916f /command.c | |
parent | 68e70b3ec34af2e1002d17d0dc81b3408a399ade (diff) | |
parent | 5eee4632d3e2bcf17a29483467d247c71c202e0d (diff) | |
download | mpv-de560e8167c21a8fd9ea34f5f42f377102d65232.tar.bz2 mpv-de560e8167c21a8fd9ea34f5f42f377102d65232.tar.xz |
Merge svn changes up to r27123
Conflicts:
libmenu/menu_filesel.c
libmenu/menu_pt.c
Diffstat (limited to 'command.c')
-rw-r--r-- | command.c | 39 |
1 files changed, 38 insertions, 1 deletions
@@ -2290,6 +2290,35 @@ 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 }, + + /* + * 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 int run_command(MPContext *mpctx, mp_cmd_t *cmd) { @@ -3113,10 +3142,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); |