Commit f698e1fc authored by Gildas Bazin's avatar Gildas Bazin

* modules/control/hotkeys.c: use demux_Control( p_input, DEMUX_SET_TIME, ...) to seek, for better precision.
* modules/video_output/directx/events.c: fix to catch the Alt key.
parent 86982725
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* hotkeys.c: Hotkey handling for vlc * hotkeys.c: Hotkey handling for vlc
***************************************************************************** *****************************************************************************
* Copyright (C) 2003 VideoLAN * Copyright (C) 2003 VideoLAN
* $Id: hotkeys.c,v 1.6 2003/10/30 23:17:59 hartman Exp $ * $Id: hotkeys.c,v 1.7 2003/10/31 18:18:46 gbazin Exp $
* *
* Authors: Sigmund Augdal <sigmunau@idi.ntnu.no> * Authors: Sigmund Augdal <sigmunau@idi.ntnu.no>
* *
...@@ -29,6 +29,7 @@ ...@@ -29,6 +29,7 @@
#include <vlc/vlc.h> #include <vlc/vlc.h>
#include <vlc/intf.h> #include <vlc/intf.h>
#include <vlc/input.h>
#include <vlc/vout.h> #include <vlc/vout.h>
#include <vlc/aout.h> #include <vlc/aout.h>
#include <osd.h> #include <osd.h>
...@@ -196,7 +197,7 @@ static void Run( intf_thread_t *p_intf ) ...@@ -196,7 +197,7 @@ static void Run( intf_thread_t *p_intf )
if( i_action == ACTIONID_QUIT ) if( i_action == ACTIONID_QUIT )
{ {
p_intf->p_vlc->b_die = VLC_TRUE; p_intf->p_vlc->b_die = VLC_TRUE;
vout_OSDMessage( p_intf, _("Quit" ) ); vout_OSDMessage( VLC_OBJECT(p_intf), _("Quit" ) );
continue; continue;
} }
else if( i_action == ACTIONID_VOL_UP ) else if( i_action == ACTIONID_VOL_UP )
...@@ -205,7 +206,7 @@ static void Run( intf_thread_t *p_intf ) ...@@ -205,7 +206,7 @@ static void Run( intf_thread_t *p_intf )
char string[9]; char string[9];
aout_VolumeUp( p_intf, 1, &i_newvol ); aout_VolumeUp( p_intf, 1, &i_newvol );
sprintf( string, "Vol %d%%", i_newvol*100/AOUT_VOLUME_MAX ); sprintf( string, "Vol %d%%", i_newvol*100/AOUT_VOLUME_MAX );
vout_OSDMessage( p_intf, string ); vout_OSDMessage( VLC_OBJECT(p_intf), string );
} }
else if( i_action == ACTIONID_VOL_DOWN ) else if( i_action == ACTIONID_VOL_DOWN )
{ {
...@@ -213,7 +214,7 @@ static void Run( intf_thread_t *p_intf ) ...@@ -213,7 +214,7 @@ static void Run( intf_thread_t *p_intf )
char string[9]; char string[9];
aout_VolumeDown( p_intf, 1, &i_newvol ); aout_VolumeDown( p_intf, 1, &i_newvol );
sprintf( string, "Vol %d%%", i_newvol*100/AOUT_VOLUME_MAX ); sprintf( string, "Vol %d%%", i_newvol*100/AOUT_VOLUME_MAX );
vout_OSDMessage( p_intf, string ); vout_OSDMessage( VLC_OBJECT(p_intf), string );
} }
else if( i_action == ACTIONID_FULLSCREEN ) else if( i_action == ACTIONID_FULLSCREEN )
{ {
...@@ -242,7 +243,7 @@ static void Run( intf_thread_t *p_intf ) ...@@ -242,7 +243,7 @@ static void Run( intf_thread_t *p_intf )
if( p_input && if( p_input &&
p_input->stream.control.i_status != PAUSE_S ) p_input->stream.control.i_status != PAUSE_S )
{ {
vout_OSDMessage( p_intf, _( "Pause" ) ); vout_OSDMessage( VLC_OBJECT(p_intf), _( "Pause" ) );
input_SetStatus( p_input, INPUT_STATUS_PAUSE ); input_SetStatus( p_input, INPUT_STATUS_PAUSE );
} }
else else
...@@ -255,7 +256,7 @@ static void Run( intf_thread_t *p_intf ) ...@@ -255,7 +256,7 @@ static void Run( intf_thread_t *p_intf )
if( p_playlist->i_size ) if( p_playlist->i_size )
{ {
vlc_mutex_unlock( &p_playlist->object_lock ); vlc_mutex_unlock( &p_playlist->object_lock );
vout_OSDMessage( p_intf, _( "Play" ) ); vout_OSDMessage( VLC_OBJECT(p_intf), _( "Play" ) );
playlist_Play( p_playlist ); playlist_Play( p_playlist );
vlc_object_release( p_playlist ); vlc_object_release( p_playlist );
} }
...@@ -264,40 +265,48 @@ static void Run( intf_thread_t *p_intf ) ...@@ -264,40 +265,48 @@ static void Run( intf_thread_t *p_intf )
} }
else if( p_input ) else if( p_input )
{ {
uint64_t i_time;
if( i_action == ACTIONID_PAUSE ) if( i_action == ACTIONID_PAUSE )
{ {
vout_OSDMessage( p_intf, _( "Pause" ) ); vout_OSDMessage( VLC_OBJECT(p_intf), _( "Pause" ) );
input_SetStatus( p_input, INPUT_STATUS_PAUSE ); input_SetStatus( p_input, INPUT_STATUS_PAUSE );
} }
else if( i_action == ACTIONID_JUMP_BACKWARD_10SEC ) else if( i_action == ACTIONID_JUMP_BACKWARD_10SEC )
{ {
vout_OSDMessage( p_intf, _( "Jump -10 seconds" ) ); vout_OSDMessage( VLC_OBJECT(p_intf), _( "Jump -10 seconds" ) );
input_Seek( p_input, -10, INPUT_SEEK_SECONDS|INPUT_SEEK_CUR ); demux_Control( p_input, DEMUX_GET_TIME, &i_time );
demux_Control( p_input, DEMUX_SET_TIME, i_time - 10000000 );
} }
else if( i_action == ACTIONID_JUMP_FORWARD_10SEC ) else if( i_action == ACTIONID_JUMP_FORWARD_10SEC )
{ {
vout_OSDMessage( p_intf, _( "Jump +10 seconds" ) ); vout_OSDMessage( VLC_OBJECT(p_intf), _( "Jump +10 seconds" ) );
input_Seek( p_input, 10, INPUT_SEEK_SECONDS|INPUT_SEEK_CUR ); demux_Control( p_input, DEMUX_GET_TIME, &i_time );
demux_Control( p_input, DEMUX_SET_TIME, i_time + 10000000 );
} }
else if( i_action == ACTIONID_JUMP_BACKWARD_1MIN ) else if( i_action == ACTIONID_JUMP_BACKWARD_1MIN )
{ {
vout_OSDMessage( p_intf, _( "Jump -1 minute" ) ); vout_OSDMessage( VLC_OBJECT(p_intf), _( "Jump -1 minute" ) );
input_Seek( p_input, -60, INPUT_SEEK_SECONDS|INPUT_SEEK_CUR ); demux_Control( p_input, DEMUX_GET_TIME, &i_time );
demux_Control( p_input, DEMUX_SET_TIME, i_time - 60000000 );
} }
else if( i_action == ACTIONID_JUMP_FORWARD_1MIN ) else if( i_action == ACTIONID_JUMP_FORWARD_1MIN )
{ {
vout_OSDMessage( p_intf, _( "Jump +1 minute" ) ); vout_OSDMessage( VLC_OBJECT(p_intf), _( "Jump +1 minute" ) );
input_Seek( p_input, 60, INPUT_SEEK_SECONDS|INPUT_SEEK_CUR ); demux_Control( p_input, DEMUX_GET_TIME, &i_time );
demux_Control( p_input, DEMUX_SET_TIME, i_time + 60000000 );
} }
else if( i_action == ACTIONID_JUMP_BACKWARD_5MIN ) else if( i_action == ACTIONID_JUMP_BACKWARD_5MIN )
{ {
vout_OSDMessage( p_intf, _( "Jump -5 minutes" ) ); vout_OSDMessage( VLC_OBJECT(p_intf), _( "Jump -5 minutes" ) );
input_Seek( p_input, -300, INPUT_SEEK_SECONDS|INPUT_SEEK_CUR ); demux_Control( p_input, DEMUX_GET_TIME, &i_time );
demux_Control( p_input, DEMUX_SET_TIME, i_time - 300000000 );
} }
else if( i_action == ACTIONID_JUMP_FORWARD_5MIN ) else if( i_action == ACTIONID_JUMP_FORWARD_5MIN )
{ {
vout_OSDMessage( p_intf, _( "Jump +5 minutes" ) ); vout_OSDMessage( VLC_OBJECT(p_intf), _( "Jump +5 minutes" ) );
input_Seek( p_input, 300, INPUT_SEEK_SECONDS|INPUT_SEEK_CUR ); demux_Control( p_input, DEMUX_GET_TIME, &i_time );
demux_Control( p_input, DEMUX_SET_TIME, i_time + 300000000 );
} }
else if( i_action == ACTIONID_NEXT ) else if( i_action == ACTIONID_NEXT )
{ {
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* events.c: Windows DirectX video output events handler * events.c: Windows DirectX video output events handler
***************************************************************************** *****************************************************************************
* Copyright (C) 2001 VideoLAN * Copyright (C) 2001 VideoLAN
* $Id: events.c,v 1.27 2003/10/29 12:23:51 gbazin Exp $ * $Id: events.c,v 1.28 2003/10/31 18:18:46 gbazin Exp $
* *
* Authors: Gildas Bazin <gbazin@netcourrier.com> * Authors: Gildas Bazin <gbazin@netcourrier.com>
* *
...@@ -195,6 +195,7 @@ void DirectXEventThread( event_thread_t *p_event ) ...@@ -195,6 +195,7 @@ void DirectXEventThread( event_thread_t *p_event )
break; break;
case WM_KEYDOWN: case WM_KEYDOWN:
case WM_SYSKEYDOWN:
/* The key events are first processed here and not translated /* The key events are first processed here and not translated
* into WM_CHAR events because we need to know the status of the * into WM_CHAR events because we need to know the status of the
* modifier keys. */ * modifier keys. */
...@@ -211,11 +212,11 @@ void DirectXEventThread( event_thread_t *p_event ) ...@@ -211,11 +212,11 @@ void DirectXEventThread( event_thread_t *p_event )
{ {
val.i_int |= KEY_MODIFIER_CTRL; val.i_int |= KEY_MODIFIER_CTRL;
} }
else if( GetKeyState(VK_SHIFT) & 0x8000 ) if( GetKeyState(VK_SHIFT) & 0x8000 )
{ {
val.i_int |= KEY_MODIFIER_SHIFT; val.i_int |= KEY_MODIFIER_SHIFT;
} }
else if( GetKeyState(VK_MENU) & 0x8000 ) if( GetKeyState(VK_MENU) & 0x8000 )
{ {
val.i_int |= KEY_MODIFIER_ALT; val.i_int |= KEY_MODIFIER_ALT;
} }
...@@ -711,7 +712,6 @@ static struct ...@@ -711,7 +712,6 @@ static struct
{ VK_SPACE, KEY_SPACE }, { VK_SPACE, KEY_SPACE },
{ VK_ESCAPE, KEY_ESC }, { VK_ESCAPE, KEY_ESC },
{ VK_MENU, KEY_MENU },
{ VK_LEFT, KEY_LEFT }, { VK_LEFT, KEY_LEFT },
{ VK_RIGHT, KEY_RIGHT }, { VK_RIGHT, KEY_RIGHT },
{ VK_UP, KEY_UP }, { VK_UP, KEY_UP },
...@@ -721,6 +721,11 @@ static struct ...@@ -721,6 +721,11 @@ static struct
{ VK_END, KEY_END }, { VK_END, KEY_END },
{ VK_PRIOR, KEY_PAGEUP }, { VK_PRIOR, KEY_PAGEUP },
{ VK_NEXT, KEY_PAGEDOWN }, { VK_NEXT, KEY_PAGEDOWN },
{ VK_CONTROL, 0 },
{ VK_SHIFT, 0 },
{ VK_MENU, 0 },
{ 0, 0 } { 0, 0 }
}; };
......
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