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
This commit is contained in:
ben 2008-06-19 18:51:42 +00:00
parent 864dc16140
commit 59346bc23a
5 changed files with 66 additions and 39 deletions

View File

@ -66,14 +66,16 @@ change_rectangle <val1> <val2>
dvb_set_channel <channel_number> <card_number>
Set DVB channel.
dvdnav <button>
dvdnav <button_name>
Press the given dvdnav button.
1 up
2 down
3 left
4 right
5 menu
6 select
up
down
left
right
menu
select
prev
mouse
edl_mark
Write the current position into the EDL file.

View File

@ -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);

View File

@ -149,20 +149,20 @@ AR_VDOWN volume -1
## Requires dvdnav://
##
UP {dvdnav} dvdnav 1 # DVDNav UP
DOWN {dvdnav} dvdnav 2 # DVDNav DOWN
LEFT {dvdnav} dvdnav 3 # DVDNav LEFT
RIGHT {dvdnav} dvdnav 4 # DVDNav RIGHT
ESC {dvdnav} dvdnav 5 # DVDNav MENU
ENTER {dvdnav} dvdnav 6 # DVDNav SELECT (ok)
BS {dvdnav} dvdnav 7 # DVDNav PREVIOUS menu (in the order chapter->title->root)
UP {dvdnav} dvdnav up # DVDNav UP
DOWN {dvdnav} dvdnav down # DVDNav DOWN
LEFT {dvdnav} dvdnav left # DVDNav LEFT
RIGHT {dvdnav} dvdnav right # DVDNav RIGHT
ESC {dvdnav} dvdnav menu # DVDNav MENU
ENTER {dvdnav} dvdnav select # DVDNav SELECT (ok)
BS {dvdnav} dvdnav prev # DVDNav PREVIOUS menu (in the order chapter->title->root)
AR_VUP {dvdnav} dvdnav 1 # DVDNav UP
AR_VDOWN {dvdnav} dvdnav 2 # DVDNav DOWN
AR_PREV {dvdnav} dvdnav 3 # DVDNav LEFT
AR_NEXT {dvdnav} dvdnav 4 # DVDNav RIGHT
AR_MENU {dvdnav} dvdnav 5 # DVDNav MENU
AR_PLAY {dvdnav} dvdnav 6 # DVDNav SELECT (ok)
AR_VUP {dvdnav} dvdnav up # DVDNav UP
AR_VDOWN {dvdnav} dvdnav down # DVDNav DOWN
AR_PREV {dvdnav} dvdnav left # DVDNav LEFT
AR_NEXT {dvdnav} dvdnav right # DVDNav RIGHT
AR_MENU {dvdnav} dvdnav menu # DVDNav MENU
AR_PLAY {dvdnav} dvdnav select # DVDNav SELECT (ok)
#? seek_chapter -1 # skip to previous dvd chapter
#? seek_chapter +1 # next

View File

@ -171,7 +171,7 @@ static const mp_cmd_t mp_cmds[] = {
#endif
#ifdef USE_DVDNAV
{ MP_CMD_DVDNAV, "dvdnav", 1, { {MP_CMD_ARG_INT,{0}}, {-1,{0}} } },
{ MP_CMD_DVDNAV, "dvdnav", 1, { {MP_CMD_ARG_STRING, {0}}, {-1,{0}} } },
#endif
#ifdef HAVE_MENU
@ -347,14 +347,14 @@ static const mp_cmd_bind_t def_cmd_binds[] = {
{ { MOUSE_BTN6, 0 }, "volume -1" },
#ifdef USE_DVDNAV
{ { KEY_KP8, 0 }, "dvdnav 1" }, // up
{ { KEY_KP2, 0 }, "dvdnav 2" }, // down
{ { KEY_KP4, 0 }, "dvdnav 3" }, // left
{ { KEY_KP6, 0 }, "dvdnav 4" }, // right
{ { KEY_KP5, 0 }, "dvdnav 5" }, // menu
{ { KEY_KPENTER, 0 }, "dvdnav 6" }, // select
{ { MOUSE_BTN0, 0 }, "dvdnav 8" }, //select
{ { KEY_KP7, 0 }, "dvdnav 7" }, // previous menu
{ { KEY_KP8, 0 }, "dvdnav up" }, // up
{ { KEY_KP2, 0 }, "dvdnav down" }, // down
{ { KEY_KP4, 0 }, "dvdnav left" }, // left
{ { KEY_KP6, 0 }, "dvdnav right" }, // right
{ { KEY_KP5, 0 }, "dvdnav menu" }, // menu
{ { KEY_KPENTER, 0 }, "dvdnav select" }, // select
{ { MOUSE_BTN0, 0 }, "dvdnav mouse" }, //select
{ { KEY_KP7, 0 }, "dvdnav prev" }, // previous menu
#endif
{ { KEY_RIGHT, 0 }, "seek 10" },

View File

@ -112,6 +112,16 @@ typedef enum {
MP_CMD_SWITCH_TITLE,
MP_CMD_STOP,
/// DVDNAV commands
MP_CMD_DVDNAV_UP = 1000,
MP_CMD_DVDNAV_DOWN,
MP_CMD_DVDNAV_LEFT,
MP_CMD_DVDNAV_RIGHT,
MP_CMD_DVDNAV_MENU,
MP_CMD_DVDNAV_SELECT,
MP_CMD_DVDNAV_PREVMENU,
MP_CMD_DVDNAV_MOUSECLICK,
/// GUI commands
MP_CMD_GUI_EVENTS = 5000,
MP_CMD_GUI_LOADFILE,
@ -133,15 +143,6 @@ typedef enum {
MP_CMD_CHIDE,
} mp_command_type;
#define MP_CMD_DVDNAV_UP 1
#define MP_CMD_DVDNAV_DOWN 2
#define MP_CMD_DVDNAV_LEFT 3
#define MP_CMD_DVDNAV_RIGHT 4
#define MP_CMD_DVDNAV_MENU 5
#define MP_CMD_DVDNAV_SELECT 6
#define MP_CMD_DVDNAV_PREVMENU 7
#define MP_CMD_DVDNAV_MOUSECLICK 8
// The arg types
#define MP_CMD_ARG_INT 0
#define MP_CMD_ARG_FLOAT 1