Commit 72499a50 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

input: define proper controls for menu navigation

parent 2cb909b3
...@@ -161,6 +161,13 @@ enum demux_query_e ...@@ -161,6 +161,13 @@ enum demux_query_e
DEMUX_CAN_SEEK, /* arg1= bool* can fail (assume false)*/ DEMUX_CAN_SEEK, /* arg1= bool* can fail (assume false)*/
DEMUX_GET_SIGNAL, /* arg1= double * arg2= double * can fail */ DEMUX_GET_SIGNAL, /* arg1= double * arg2= double * can fail */
/* Navigation */
DEMUX_NAV_ACTIVATE, /* res=can fail */
DEMUX_NAV_UP, /* res=can fail */
DEMUX_NAV_DOWN, /* res=can fail */
DEMUX_NAV_LEFT, /* res=can fail */
DEMUX_NAV_RIGHT, /* res=can fail */
}; };
VLC_API int demux_vaControlHelper( stream_t *, int64_t i_start, int64_t i_end, int64_t i_bitrate, int i_align, int i_query, va_list args ); VLC_API int demux_vaControlHelper( stream_t *, int64_t i_start, int64_t i_end, int64_t i_bitrate, int i_align, int i_query, va_list args );
......
...@@ -470,6 +470,13 @@ enum input_query_e ...@@ -470,6 +470,13 @@ enum input_query_e
INPUT_GET_SPU_DELAY, /* arg1 = int* res=can fail */ INPUT_GET_SPU_DELAY, /* arg1 = int* res=can fail */
INPUT_SET_SPU_DELAY, /* arg1 = int res=can fail */ INPUT_SET_SPU_DELAY, /* arg1 = int res=can fail */
/* Menu navigation */
INPUT_NAV_ACTIVATE,
INPUT_NAV_UP,
INPUT_NAV_DOWN,
INPUT_NAV_LEFT,
INPUT_NAV_RIGHT,
/* Meta datas */ /* Meta datas */
INPUT_ADD_INFO, /* arg1= char* arg2= char* arg3=... res=can fail */ INPUT_ADD_INFO, /* arg1= char* arg2= char* arg3=... res=can fail */
INPUT_REPLACE_INFOS,/* arg1= info_category_t * res=cannot fail */ INPUT_REPLACE_INFOS,/* arg1= info_category_t * res=cannot fail */
......
...@@ -136,6 +136,15 @@ int input_vaControl( input_thread_t *p_input, int i_query, va_list args ) ...@@ -136,6 +136,15 @@ int input_vaControl( input_thread_t *p_input, int i_query, va_list args )
i_64 = (int64_t)va_arg( args, int64_t ); i_64 = (int64_t)va_arg( args, int64_t );
return var_SetTime( p_input, "spu-delay", i_64 ); return var_SetTime( p_input, "spu-delay", i_64 );
case INPUT_NAV_ACTIVATE:
case INPUT_NAV_UP:
case INPUT_NAV_DOWN:
case INPUT_NAV_LEFT:
case INPUT_NAV_RIGHT:
input_ControlPush( p_input, i_query - INPUT_NAV_ACTIVATE
+ INPUT_CONTROL_NAV_ACTIVATE, NULL );
return VLC_SUCCESS;
case INPUT_ADD_INFO: case INPUT_ADD_INFO:
{ {
char *psz_cat = (char *)va_arg( args, char * ); char *psz_cat = (char *)va_arg( args, char * );
......
...@@ -1581,6 +1581,11 @@ static bool ControlIsSeekRequest( int i_type ) ...@@ -1581,6 +1581,11 @@ static bool ControlIsSeekRequest( int i_type )
case INPUT_CONTROL_SET_SEEKPOINT_NEXT: case INPUT_CONTROL_SET_SEEKPOINT_NEXT:
case INPUT_CONTROL_SET_SEEKPOINT_PREV: case INPUT_CONTROL_SET_SEEKPOINT_PREV:
case INPUT_CONTROL_SET_BOOKMARK: case INPUT_CONTROL_SET_BOOKMARK:
case INPUT_CONTROL_NAV_ACTIVATE:
case INPUT_CONTROL_NAV_UP:
case INPUT_CONTROL_NAV_DOWN:
case INPUT_CONTROL_NAV_LEFT:
case INPUT_CONTROL_NAV_RIGHT:
return true; return true;
default: default:
return false; return false;
...@@ -2175,6 +2180,15 @@ static bool Control( input_thread_t *p_input, ...@@ -2175,6 +2180,15 @@ static bool Control( input_thread_t *p_input,
break; break;
} }
case INPUT_CONTROL_NAV_ACTIVATE:
case INPUT_CONTROL_NAV_UP:
case INPUT_CONTROL_NAV_DOWN:
case INPUT_CONTROL_NAV_LEFT:
case INPUT_CONTROL_NAV_RIGHT:
demux_Control( p_input->p->input.p_demux, i_type
- INPUT_CONTROL_NAV_ACTIVATE + DEMUX_NAV_ACTIVATE );
break;
default: default:
msg_Err( p_input, "not yet implemented" ); msg_Err( p_input, "not yet implemented" );
break; break;
......
...@@ -195,6 +195,12 @@ enum input_control_e ...@@ -195,6 +195,12 @@ enum input_control_e
INPUT_CONTROL_SET_BOOKMARK, INPUT_CONTROL_SET_BOOKMARK,
INPUT_CONTROL_NAV_ACTIVATE, // NOTE: INPUT_CONTROL_NAV_* values must be
INPUT_CONTROL_NAV_UP, // contiguous and in the same order as
INPUT_CONTROL_NAV_DOWN, // INPUT_NAV_* and DEMUX_NAV_*.
INPUT_CONTROL_NAV_LEFT,
INPUT_CONTROL_NAV_RIGHT,
INPUT_CONTROL_SET_ES, INPUT_CONTROL_SET_ES,
INPUT_CONTROL_RESTART_ES, INPUT_CONTROL_RESTART_ES,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment