Commit 8b62cc3c authored by Gildas Bazin's avatar Gildas Bazin

* include/input_ext-intf.h: forgot this file in my last commit.
* src/input/input_programs.c: prev/next-chapter and prev/next-title navigation variables are created only when necessary.
parent 35a3ceeb
......@@ -4,7 +4,7 @@
* control the pace of reading.
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: input_ext-intf.h,v 1.89 2003/05/05 22:23:31 gbazin Exp $
* $Id: input_ext-intf.h,v 1.90 2003/05/17 22:00:00 gbazin Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
......@@ -349,6 +349,7 @@ struct input_thread_t
#define INPUT_METHOD_DISC 0x20 /* stream is read directly from disc */
#define INPUT_METHOD_DVD 0x21 /* stream is read from DVD */
#define INPUT_METHOD_VCD 0x22 /* stream is read from VCD */
#define INPUT_METHOD_CDDA 0x23 /* stream is read from CDDA */
#define INPUT_METHOD_NETWORK 0x30 /* stream is read from network */
#define INPUT_METHOD_UCAST 0x31 /* UDP unicast */
#define INPUT_METHOD_MCAST 0x32 /* UDP multicast */
......
......@@ -2,7 +2,7 @@
* input_programs.c: es_descriptor_t, pgrm_descriptor_t management
*****************************************************************************
* Copyright (C) 1999-2002 VideoLAN
* $Id: input_programs.c,v 1.112 2003/05/15 23:05:59 gbazin Exp $
* $Id: input_programs.c,v 1.113 2003/05/17 22:00:00 gbazin Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
......@@ -97,22 +97,10 @@ int input_InitStream( input_thread_t * p_input, size_t i_data_len )
var_Create( p_input, "title", VLC_VAR_INTEGER | VLC_VAR_HASCHOICE );
text.psz_string = _("Title");
var_Change( p_input, "title", VLC_VAR_SETTEXT, &text, NULL );
var_Create( p_input, "next-title", VLC_VAR_VOID );
text.psz_string = _("Next title");
var_Change( p_input, "next-title", VLC_VAR_SETTEXT, &text, NULL );
var_Create( p_input, "prev-title", VLC_VAR_VOID );
text.psz_string = _("Previous title");
var_Change( p_input, "prev-title", VLC_VAR_SETTEXT, &text, NULL );
var_Create( p_input, "chapter", VLC_VAR_INTEGER | VLC_VAR_HASCHOICE );
text.psz_string = _("Chapter");
var_Change( p_input, "chapter", VLC_VAR_SETTEXT, &text, NULL );
var_Create( p_input, "next-chapter", VLC_VAR_VOID );
text.psz_string = _("Next Chapter");
var_Change( p_input, "next-chapter", VLC_VAR_SETTEXT, &text, NULL );
var_Create( p_input, "prev-chapter", VLC_VAR_VOID );
text.psz_string = _("Previous Chapter");
var_Change( p_input, "prev-chapter", VLC_VAR_SETTEXT, &text, NULL );
var_Create( p_input, "navigation", VLC_VAR_VARIABLE | VLC_VAR_HASCHOICE );
text.psz_string = _("Navigation");
......@@ -130,11 +118,7 @@ int input_InitStream( input_thread_t * p_input, size_t i_data_len )
var_AddCallback( p_input, "program", ProgramCallback, NULL );
var_AddCallback( p_input, "title", TitleCallback, NULL );
var_AddCallback( p_input, "next-title", TitleCallback, NULL );
var_AddCallback( p_input, "prev-title", TitleCallback, NULL );
var_AddCallback( p_input, "chapter", ChapterCallback, NULL );
var_AddCallback( p_input, "next-chapter", ChapterCallback, NULL );
var_AddCallback( p_input, "prev-chapter", ChapterCallback, NULL );
var_AddCallback( p_input, "video-es", ESCallback, NULL );
var_AddCallback( p_input, "audio-es", ESCallback, NULL );
var_AddCallback( p_input, "spu-es", ESCallback, NULL );
......@@ -389,6 +373,30 @@ input_area_t * input_AddArea( input_thread_t * p_input,
if( text2.psz_string ) free( text2.psz_string );
}
if( p_input->stream.i_area_nb == 2 )
{
vlc_value_t text;
/* Add another bunch of navigation object variables */
var_Create( p_input, "next-title", VLC_VAR_VOID );
text.psz_string = _("Next title");
var_Change( p_input, "next-title", VLC_VAR_SETTEXT, &text, NULL );
var_Create( p_input, "prev-title", VLC_VAR_VOID );
text.psz_string = _("Previous title");
var_Change( p_input, "prev-title", VLC_VAR_SETTEXT, &text, NULL );
var_AddCallback( p_input, "next-title", TitleCallback, NULL );
var_AddCallback( p_input, "prev-title", TitleCallback, NULL );
var_Create( p_input, "next-chapter", VLC_VAR_VOID );
text.psz_string = _("Next Chapter");
var_Change( p_input, "next-chapter", VLC_VAR_SETTEXT, &text, NULL );
var_Create( p_input, "prev-chapter", VLC_VAR_VOID );
text.psz_string = _("Previous Chapter");
var_Change( p_input, "prev-chapter", VLC_VAR_SETTEXT, &text, NULL );
var_AddCallback( p_input, "next-chapter", ChapterCallback, NULL );
var_AddCallback( p_input, "prev-chapter", ChapterCallback, NULL );
}
return p_area;
}
......@@ -536,6 +544,15 @@ void input_DelArea( input_thread_t * p_input, input_area_t * p_area )
/* Free the description of this area */
free( p_area );
if( p_input->stream.i_area_nb == 1 )
{
/* Del unneeded navigation object variables */
var_Destroy( p_input, "next-title" );
var_Destroy( p_input, "prev-title" );
var_Destroy( p_input, "next-chapter" );
var_Destroy( p_input, "prev-chapter" );
}
}
......
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