# HG changeset patch # User nicodvb # Date 1157837877 0 # Node ID 1069a634fc922948c43e35d5a63bcd4d5e730340 # Parent df81093327a6458bfe162b72fa12b3c529667821 added mp_dvdnav_handle_input to handle user's input (revived from the repository with few changes) diff -r df81093327a6 -r 1069a634fc92 stream/stream_dvdnav.c --- a/stream/stream_dvdnav.c Sat Sep 09 21:32:06 2006 +0000 +++ b/stream/stream_dvdnav.c Sat Sep 09 21:37:57 2006 +0000 @@ -430,6 +430,46 @@ return STREAM_OK; } + +int mp_dvdnav_handle_input(stream_t *stream, int cmd) { + dvdnav_priv_t * dvdnav_priv=(dvdnav_priv_t*)stream->priv; + dvdnav_t *nav = dvdnav_priv->dvdnav; + dvdnav_status_t status; + pci_t *pci = dvdnav_get_current_nav_pci(nav); + int reset = 0; + + if(cmd != MP_CMD_DVDNAV_SELECT && !pci) + return 0; + + switch(cmd) { + case MP_CMD_DVDNAV_UP: + status = dvdnav_upper_button_select(nav, pci); + break; + case MP_CMD_DVDNAV_DOWN: + status = dvdnav_lower_button_select(nav, pci); + break; + case MP_CMD_DVDNAV_LEFT: + status = dvdnav_left_button_select(nav, pci); + break; + case MP_CMD_DVDNAV_RIGHT: + status = dvdnav_right_button_select(nav, pci); + break; + case MP_CMD_DVDNAV_MENU: + status = dvdnav_menu_call(nav,DVD_MENU_Root); + reset = 1; + break; + case MP_CMD_DVDNAV_SELECT: + status = dvdnav_button_activate(nav, pci); + reset = 1; + break; + default: + mp_msg(MSGT_CPLAYER, MSGL_V, "Unknown DVDNAV cmd %d\n", cmd); + break; + } + + return reset; +} + stream_info_t stream_info_dvdnav = { "DVDNAV stream", "null", diff -r df81093327a6 -r 1069a634fc92 stream/stream_dvdnav.h --- a/stream/stream_dvdnav.h Sat Sep 09 21:32:06 2006 +0000 +++ b/stream/stream_dvdnav.h Sat Sep 09 21:37:57 2006 +0000 @@ -43,5 +43,6 @@ void dvdnav_stream_fullstart(dvdnav_priv_t *dvdnav_priv); unsigned int * dvdnav_stream_get_palette(dvdnav_priv_t * dvdnav_priv); +int mp_dvdnav_handle_input(stream_t *stream, int cmd); #endif