vlc | branch: master | Rémi Denis-Courmont <[email protected]> | Fri Feb 1 17:54:34 2013 +0200| [72499a50a34cbb99f11a26d455865be2012b5ab9] | committer: Rémi Denis-Courmont
input: define proper controls for menu navigation > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=72499a50a34cbb99f11a26d455865be2012b5ab9 --- include/vlc_demux.h | 7 +++++++ include/vlc_input.h | 7 +++++++ src/input/control.c | 9 +++++++++ src/input/input.c | 14 ++++++++++++++ src/input/input_internal.h | 6 ++++++ 5 files changed, 43 insertions(+) diff --git a/include/vlc_demux.h b/include/vlc_demux.h index b00468d..c0cea07 100644 --- a/include/vlc_demux.h +++ b/include/vlc_demux.h @@ -161,6 +161,13 @@ enum demux_query_e DEMUX_CAN_SEEK, /* arg1= bool* can fail (assume false)*/ 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 ); diff --git a/include/vlc_input.h b/include/vlc_input.h index 4400304..cbd6aab 100644 --- a/include/vlc_input.h +++ b/include/vlc_input.h @@ -470,6 +470,13 @@ enum input_query_e INPUT_GET_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 */ INPUT_ADD_INFO, /* arg1= char* arg2= char* arg3=... res=can fail */ INPUT_REPLACE_INFOS,/* arg1= info_category_t * res=cannot fail */ diff --git a/src/input/control.c b/src/input/control.c index d50ea97..a238373 100644 --- a/src/input/control.c +++ b/src/input/control.c @@ -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 ); 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: { char *psz_cat = (char *)va_arg( args, char * ); diff --git a/src/input/input.c b/src/input/input.c index da3f900..729b666 100644 --- a/src/input/input.c +++ b/src/input/input.c @@ -1581,6 +1581,11 @@ static bool ControlIsSeekRequest( int i_type ) case INPUT_CONTROL_SET_SEEKPOINT_NEXT: case INPUT_CONTROL_SET_SEEKPOINT_PREV: 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; default: return false; @@ -2175,6 +2180,15 @@ static bool Control( input_thread_t *p_input, 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: msg_Err( p_input, "not yet implemented" ); break; diff --git a/src/input/input_internal.h b/src/input/input_internal.h index e65acdf..b3ad9e7 100644 --- a/src/input/input_internal.h +++ b/src/input/input_internal.h @@ -195,6 +195,12 @@ enum input_control_e 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_RESTART_ES, _______________________________________________ vlc-commits mailing list [email protected] http://mailman.videolan.org/listinfo/vlc-commits
