* vout_sdl.c: SDL video output display method
*****************************************************************************
* Copyright (C) 1998-2001 VideoLAN
- * $Id: vout_sdl.c,v 1.72 2001/12/19 18:14:23 sam Exp $
+ * $Id: vout_sdl.c,v 1.73 2001/12/20 15:43:15 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
* Pierre Baillet <oct@zoy.org>
#include "interface.h"
+#include "stream_control.h" /* needed by input_ext-intf.h... */
+#include "input_ext-intf.h"
+
#include "modules.h"
#include "modules_export.h"
free( p_vout->p_sys );
}
+static __inline__ void vout_Seek( off_t i_seek )
+{
+#define area p_main->p_intf->p_input->stream.p_selected_area
+ off_t i_tell = area->i_tell;
+
+ i_tell += i_seek * (off_t)50 * p_main->p_intf->p_input->stream.i_mux_rate;
+
+ i_tell = ( i_tell <= area->i_start ) ? area->i_start
+ : ( i_tell >= area->i_size ) ? area->i_size
+ : i_tell;
+
+ input_Seek( p_main->p_intf->p_input, i_tell );
+#undef area
+}
+
/*****************************************************************************
* vout_Manage: handle Sys events
*****************************************************************************
switch( event.button.button )
{
case SDL_BUTTON_LEFT:
- /* Handle clicks */
+ /* In this part we will eventually manage
+ * clicks for DVD navigation for instance. For the
+ * moment just pause the stream. */
+ input_SetStatus( p_main->p_intf->p_input, INPUT_STATUS_PAUSE );
+ break;
+
+ case 4:
+ vout_Seek( 15 );
+ break;
+
+ case 5:
+ vout_Seek( -15 );
break;
}
break;
case SDLK_MENU:
p_main->p_intf->b_menu_change = 1;
break;
-
+
+ case SDLK_LEFT:
+ vout_Seek( -5 );
+ break;
+
+ case SDLK_RIGHT:
+ vout_Seek( 5 );
+ break;
+
+ case SDLK_UP:
+ vout_Seek( 60 );
+ break;
+
+ case SDLK_DOWN:
+ vout_Seek( -60 );
+ break;
+
case SDLK_F10: network_ChannelJoin( 0 ); break;
case SDLK_F1: network_ChannelJoin( 1 ); break;
case SDLK_F2: network_ChannelJoin( 2 ); break;
* vout_common.c: Functions common to the X11 and XVideo plugins
*****************************************************************************
* Copyright (C) 1998-2001 VideoLAN
- * $Id: vout_common.c,v 1.6 2001/12/19 18:14:23 sam Exp $
+ * $Id: vout_common.c,v 1.7 2001/12/20 15:43:15 sam Exp $
*
* Authors: Vincent Seguin <seguin@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org>
#include "modules.h"
#include "modules_export.h"
-/*****************************************************************************
- * vout_Manage: handle X11 events
- *****************************************************************************
- * This function should be called regularly by video output thread. It manages
- * X11 events and allows window resizing. It returns a non null value on
- * error.
- *****************************************************************************/
-static __inline__ void vout_Seek( int i_seek )
+static __inline__ void vout_Seek( off_t i_seek )
{
- int i_tell = p_main->p_intf->p_input->stream.p_selected_area->i_tell;
+#define area p_main->p_intf->p_input->stream.p_selected_area
+ off_t i_tell = area->i_tell;
- i_tell += i_seek * 50 * p_main->p_intf->p_input->stream.i_mux_rate;
+ i_tell += i_seek * (off_t)50 * p_main->p_intf->p_input->stream.i_mux_rate;
- if( i_tell < p_main->p_intf->p_input->stream.p_selected_area->i_start )
- {
- i_tell = p_main->p_intf->p_input->stream.p_selected_area->i_start;
- }
- else if( i_tell > p_main->p_intf->p_input->stream.p_selected_area->i_size )
- {
- i_tell = p_main->p_intf->p_input->stream.p_selected_area->i_size;
- }
+ i_tell = ( i_tell <= area->i_start ) ? area->i_start
+ : ( i_tell >= area->i_size ) ? area->i_size
+ : i_tell;
input_Seek( p_main->p_intf->p_input, i_tell );
+#undef area
}
+/*****************************************************************************
+ * vout_Manage: handle X11 events
+ *****************************************************************************
+ * This function should be called regularly by video output thread. It manages
+ * X11 events and allows window resizing. It returns a non null value on
+ * error.
+ *****************************************************************************/
int _M( vout_Manage ) ( vout_thread_t *p_vout )
{
XEvent xevent; /* X11 event */
input_SetStatus( p_main->p_intf->p_input,
INPUT_STATUS_PAUSE );
break;
+
+ case Button4:
+ vout_Seek( 15 );
+ break;
+
+ case Button5:
+ vout_Seek( -15 );
+ break;
}
}
/* Mouse release */