added mp_dvdnav_handle_input to handle user's input (revived from the repository with few changes)

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@19774 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
nicodvb 2006-09-09 21:37:57 +00:00
parent 6462618244
commit f817575e5f
2 changed files with 41 additions and 0 deletions

View File

@ -430,6 +430,46 @@ static int open_s(stream_t *stream,int mode, void* opts, int* file_format) {
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",

View File

@ -43,5 +43,6 @@ int dvdnav_stream_sleeping(dvdnav_priv_t * dvdnav_priv);
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