* Declaration and extern access to global program object.
*****************************************************************************
* Copyright (C) 1999, 2000, 2001, 2002 VideoLAN
- * $Id: main.h,v 1.55 2003/09/24 21:31:54 gbazin Exp $
+ * $Id: main.h,v 1.56 2003/10/29 01:33:27 gbazin Exp $
*
* Authors: Vincent Seguin <seguin@via.ecp.fr>
*
char * psz_homedir; /* user's home directory */
char * psz_configfile; /* location of config file */
- /* Generic settings */
- mtime_t i_desync; /* relative desync of the audio ouput */
-
/* Fast memcpy plugin used */
module_t * p_memcpy_module;
#if defined( UNDER_CE )
/* Shared data - these structures are accessed directly from p_vlc by
* several modules */
- input_channel_t * p_channel; /* channel library data */
/* Locks */
vlc_mutex_t config_lock; /* lock for the config file */
#ifdef SYS_DARWIN
vlc_mutex_t quicktime_lock; /* QT is not thread safe on OSX */
#endif
+
+ /* Structure storing the action name / key associations */
+ struct hotkey
+ {
+ const char *psz_action;
+ int i_action;
+ int i_key;
+
+ } *p_hotkeys;
};
* variables.h: variables handling
*****************************************************************************
* Copyright (C) 2002 VideoLAN
- * $Id: variables.h,v 1.17 2003/09/29 15:45:19 sigmunau Exp $
+ * $Id: variables.h,v 1.18 2003/10/29 01:33:27 gbazin Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
#define VLC_VAR_VOID 0x0010
#define VLC_VAR_BOOL 0x0020
#define VLC_VAR_INTEGER 0x0030
+#define VLC_VAR_HOTKEY 0x0031
#define VLC_VAR_STRING 0x0040
#define VLC_VAR_MODULE 0x0041
#define VLC_VAR_FILE 0x0042
* Collection of useful common types and macros definitions
*****************************************************************************
* Copyright (C) 1998, 1999, 2000 VideoLAN
- * $Id: vlc_common.h,v 1.83 2003/10/25 00:49:13 sam Exp $
+ * $Id: vlc_common.h,v 1.84 2003/10/29 01:33:27 gbazin Exp $
*
* Authors: Samuel Hocevar <sam@via.ecp.fr>
* Vincent Seguin <seguin@via.ecp.fr>
/* Input */
typedef struct input_thread_t input_thread_t;
typedef struct input_thread_sys_t input_thread_sys_t;
-typedef struct input_channel_t input_channel_t;
typedef struct input_area_t input_area_t;
typedef struct input_buffers_t input_buffers_t;
typedef struct input_socket_t input_socket_t;
* hotkeys.h: keycode defines
*****************************************************************************
* Copyright (C) 2003 VideoLAN
- * $Id: vlc_keys.h,v 1.4 2003/10/28 20:15:48 hartman Exp $
+ * $Id: vlc_keys.h,v 1.5 2003/10/29 01:33:27 gbazin Exp $
*
* Authors: Sigmund Augdal <sigmunau@idi.ntnu.no>
*
return NULL;
}
+#define ACTIONID_QUIT 1
+#define ACTIONID_PLAY_PAUSE 2
+#define ACTIONID_PLAY 3
+#define ACTIONID_PAUSE 4
+#define ACTIONID_STOP 5
+#define ACTIONID_PREV 6
+#define ACTIONID_NEXT 7
+#define ACTIONID_SLOWER 8
+#define ACTIONID_FASTER 9
+#define ACTIONID_FULLSCREEN 10
+#define ACTIONID_VOL_UP 11
+#define ACTIONID_VOL_DOWN 12
+#define ACTIONID_NAV_ACTIVATE 13
+#define ACTIONID_NAV_UP 14
+#define ACTIONID_NAV_DOWN 15
+#define ACTIONID_NAV_LEFT 16
+#define ACTIONID_NAV_RIGHT 17
* intf.c: interface for DVD video manager
*****************************************************************************
* Copyright (C) 2002 VideoLAN
- * $Id: intf.c,v 1.8 2003/10/26 13:10:05 sigmunau Exp $
+ * $Id: intf.c,v 1.9 2003/10/29 01:33:27 gbazin Exp $
*
* Authors: Stéphane Borel <stef@via.ecp.fr>
*
#include "input_ext-intf.h"
#include "input_ext-dec.h"
+#include "vlc_keys.h"
+
#include "dvd.h"
/*****************************************************************************
vlc_object_t * p_vout = NULL;
mtime_t mtime = 0;
mtime_t mlast = 0;
- int i_nav_up = config_GetInt( p_intf, "nav-up-key" );
- int i_nav_down = config_GetInt( p_intf, "nav-down-key" );
- int i_nav_left = config_GetInt( p_intf, "nav-left-key" );
- int i_nav_right = config_GetInt( p_intf, "nav-right-key" );
- int i_nav_activate = config_GetInt( p_intf, "nav-activate-key" );
if( InitThread( p_intf ) < 0 )
{
if( p_intf->p_sys->b_key_pressed )
{
vlc_value_t val;
- int i_activate;
+ int i, i_activate, i_action = -1;
+ struct hotkey *p_hotkeys = p_intf->p_vlc->p_hotkeys;
p_intf->p_sys->b_key_pressed = VLC_FALSE;
+ /* Find action triggered by hotkey (if any) */
var_Get( p_intf->p_vlc, "key-pressed", &val );
- if ( val.i_int )
+ for( i = 0; p_hotkeys[i].psz_action != NULL; i++ )
+ {
+ if( p_hotkeys[i].i_key == val.i_int )
+ {
+ i_action = p_hotkeys[i].i_action;
+ }
+ }
+
+ if( i_action )
{
- if( val.i_int == i_nav_left )
+ if( i_action == ACTIONID_NAV_LEFT )
{
p_intf->p_sys->control.type = DVDCtrlLeftButtonSelect;
}
- else if( val.i_int == i_nav_right )
+ else if( i_action == ACTIONID_NAV_RIGHT )
{
p_intf->p_sys->control.type = DVDCtrlRightButtonSelect;
}
- else if( val.i_int == i_nav_up )
+ else if( i_action == ACTIONID_NAV_UP )
{
p_intf->p_sys->control.type = DVDCtrlUpperButtonSelect;
}
- else if( val.i_int == i_nav_down )
+ else if( i_action == ACTIONID_NAV_DOWN )
{
p_intf->p_sys->control.type = DVDCtrlLowerButtonSelect;
}
- else if( val.i_int == i_nav_activate )
+ else if( i_action == ACTIONID_NAV_ACTIVATE )
{
p_intf->p_sys->control.type = DVDCtrlButtonActivate;
}
* hotkeys.c: Hotkey handling for vlc
*****************************************************************************
* Copyright (C) 2003 VideoLAN
- * $Id: hotkeys.c,v 1.1 2003/10/26 12:46:55 sigmunau Exp $
+ * $Id: hotkeys.c,v 1.2 2003/10/29 01:33:27 gbazin Exp $
*
* Authors: Sigmund Augdal <sigmunau@idi.ntnu.no>
*
#include <vlc/aout.h>
#include <osd.h>
+#include "vlc_keys.h"
+
#define BUFFER_SIZE 10
/*****************************************************************************
* intf_sys_t: description and status of FB interface
static int GetKey ( intf_thread_t *);
static int KeyEvent( vlc_object_t *, char const *,
vlc_value_t, vlc_value_t, void * );
+static int ActionKeyCB( vlc_object_t *, char const *,
+ vlc_value_t, vlc_value_t, void * );
/*****************************************************************************
* Module descriptor
p_intf->p_sys->p_input = NULL;
p_intf->p_sys->p_vout = NULL;
+
var_AddCallback( p_intf->p_vlc, "key-pressed", KeyEvent, p_intf );
return 0;
}
playlist_t *p_playlist;
input_thread_t *p_input;
vout_thread_t *p_vout = NULL;
- int i_fullscreen = config_GetInt( p_intf, "fullscreen-key" );
- int i_quit = config_GetInt( p_intf, "quit-key" );
- int i_vol_up = config_GetInt( p_intf, "vol-up-key" );
- int i_vol_down = config_GetInt( p_intf, "vol-down-key" );
- int i_play_pause = config_GetInt( p_intf, "play-pause-key" );
- int i_play = config_GetInt( p_intf, "play-key" );
- int i_pause = config_GetInt( p_intf, "pause-key" );
- int i_stop = config_GetInt( p_intf, "stop-key" );
- int i_next = config_GetInt( p_intf, "next-key" );
- int i_prev = config_GetInt( p_intf, "prev-key" );
- int i_faster = config_GetInt( p_intf, "faster-key" );
- int i_slower = config_GetInt( p_intf, "slower-key" );
- int i_key = 0;
-
+ struct hotkey *p_hotkeys = p_intf->p_vlc->p_hotkeys;
+ vlc_value_t val;
+ int i;
+
+ /* Initialize hotkey structure */
+ for( i = 0; p_hotkeys[i].psz_action != NULL; i++ )
+ {
+ var_Create( p_intf->p_vlc, p_hotkeys[i].psz_action,
+ VLC_VAR_HOTKEY | VLC_VAR_DOINHERIT );
+
+ var_AddCallback( p_intf->p_vlc, p_hotkeys[i].psz_action,
+ ActionKeyCB, NULL );
+ var_Get( p_intf->p_vlc, p_hotkeys[i].psz_action, &val );
+ var_Set( p_intf->p_vlc, p_hotkeys[i].psz_action, val );
+ }
+
while( !p_intf->b_die )
{
+ int i_key, i_action;
+
/* Sleep a bit */
msleep( INTF_IDLE_SLEEP );
p_intf->p_sys->p_vout = NULL;
}
+ /* Find action triggered by hotkey */
+ i_action = 0;
i_key = GetKey( p_intf );
- if ( !i_key )
+ for( i = 0; p_hotkeys[i].psz_action != NULL; i++ )
+ {
+ if( p_hotkeys[i].i_key == i_key )
+ {
+ i_action = p_hotkeys[i].i_action;
+ }
+ }
+
+ if( !i_action )
{
/* No key pressed, sleep a bit more */
msleep( INTF_IDLE_SLEEP );
continue;
}
- if( i_key == i_quit )
+
+ if( i_action == ACTIONID_QUIT )
{
p_intf->p_vlc->b_die = VLC_TRUE;
Feedback( p_intf, _("Quit" ) );
continue;
}
- if( i_key == i_vol_up )
+ else if( i_action == ACTIONID_VOL_UP )
{
audio_volume_t i_newvol;
char string[9];
sprintf( string, "Vol %%%d", i_newvol*100/AOUT_VOLUME_MAX );
Feedback( p_intf, string );
}
- if( i_key == i_vol_down )
+ else if( i_action == ACTIONID_VOL_DOWN )
{
audio_volume_t i_newvol;
char string[9];
sprintf( string, "Vol %%%d", i_newvol*100/AOUT_VOLUME_MAX );
Feedback( p_intf, string );
}
- if( p_vout )
+ else if( i_action == ACTIONID_FULLSCREEN )
{
- if( i_key == i_fullscreen )
+ if( p_vout )
{
p_vout->i_changes |= VOUT_FULLSCREEN_CHANGE;
- continue;
}
}
-
- if( i_key == i_play )
+ else if( i_action == ACTIONID_PLAY )
{
p_playlist = vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
FIND_ANYWHERE );
vlc_object_release( p_playlist );
}
}
- continue;
}
-
- if( i_key == i_play_pause )
+ else if( i_action == ACTIONID_PLAY_PAUSE )
{
if( p_input &&
p_input->stream.control.i_status != PAUSE_S )
vlc_object_release( p_playlist );
}
}
- }
- continue;
+ }
}
-
else if( p_input )
{
- if( i_key == i_pause )
+ if( i_action == ACTIONID_PAUSE )
{
Feedback( p_intf, _( "Pause" ) );
input_SetStatus( p_input, INPUT_STATUS_PAUSE );
}
- else if( i_key == i_next )
+ else if( i_action == ACTIONID_NEXT )
{
p_playlist = vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
FIND_ANYWHERE );
vlc_object_release( p_playlist );
}
}
- else if( i_key == i_prev )
+ else if( i_action == ACTIONID_PREV )
{
p_playlist = vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
FIND_ANYWHERE );
vlc_object_release( p_playlist );
}
}
- else if( i_key == i_stop )
+ else if( i_action == ACTIONID_STOP )
{
p_playlist = vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
FIND_ANYWHERE );
vlc_object_release( p_playlist );
}
}
- else if( i_key == i_faster )
+ else if( i_action == ACTIONID_FASTER )
{
input_SetStatus( p_input, INPUT_STATUS_FASTER );
}
- else if( i_key == i_slower )
+ else if( i_action == ACTIONID_FASTER )
{
input_SetStatus( p_input, INPUT_STATUS_SLOWER );
}
{
if ( p_intf->p_sys->p_vout )
{
- vout_ShowTextRelative( p_intf->p_sys->p_vout, psz_string, NULL,
- OSD_ALIGN_TOP|OSD_ALIGN_RIGHT, 30,20,400000 );
+ vout_ShowTextRelative( p_intf->p_sys->p_vout, psz_string, NULL,
+ OSD_ALIGN_TOP|OSD_ALIGN_RIGHT, 30,20,400000 );
}
}
-static int GetKey ( intf_thread_t *p_intf)
+static int GetKey( intf_thread_t *p_intf)
{
vlc_mutex_lock( &p_intf->p_sys->change_lock );
if ( p_intf->p_sys->i_size == 0 )
{
vlc_mutex_unlock( &p_intf->p_sys->change_lock );
- return 0;
+ return -1;
}
else
{
* KeyEvent: callback for keyboard events
*****************************************************************************/
static int KeyEvent( vlc_object_t *p_this, char const *psz_var,
- vlc_value_t oldval, vlc_value_t newval, void *p_data )
+ vlc_value_t oldval, vlc_value_t newval, void *p_data )
{
intf_thread_t *p_intf = (intf_thread_t *)p_data;
vlc_mutex_lock( &p_intf->p_sys->change_lock );
{
p_intf->p_sys->p_keys[ p_intf->p_sys->i_size ] = newval.i_int;
p_intf->p_sys->i_size++;
- }
+ }
vlc_mutex_unlock( &p_intf->p_sys->change_lock );
return VLC_SUCCESS;
}
+static int ActionKeyCB( vlc_object_t *p_this, char const *psz_var,
+ vlc_value_t oldval, vlc_value_t newval, void *p_data )
+{
+ vlc_t *p_vlc = (vlc_t *)p_this;
+ struct hotkey *p_hotkeys = p_vlc->p_hotkeys;
+ int i;
+
+ for( i = 0; p_hotkeys[i].psz_action != NULL; i++ )
+ {
+ if( !strcmp( p_hotkeys[i].psz_action, psz_var ) )
+ {
+ p_hotkeys[i].i_key = newval.i_int;
+ }
+ }
+
+ return VLC_SUCCESS;
+}
* interface.cpp : wxWindows plugin for vlc
*****************************************************************************
* Copyright (C) 2000-2001 VideoLAN
- * $Id: interface.cpp,v 1.67 2003/10/19 22:52:11 sigmunau Exp $
+ * $Id: interface.cpp,v 1.68 2003/10/29 01:33:27 gbazin Exp $
*
* Authors: Gildas Bazin <gbazin@netcourrier.com>
*
{
/* Set some hotkeys */
wxAcceleratorEntry entries[7];
- int i_key = config_GetInt( p_intf, "quit-key" );
+ vlc_value_t val;
int i = 0;
- entries[i++].Set( ConvertHotkeyModifiers( i_key ), ConvertHotkey( i_key ),
- Exit_Event );
- i_key = config_GetInt( p_intf, "stop-key" );
- entries[i++].Set( ConvertHotkeyModifiers( i_key ), ConvertHotkey( i_key ),
- StopStream_Event );
- i_key = config_GetInt( p_intf, "play-pause-key" );
- entries[i++].Set( ConvertHotkeyModifiers( i_key ), ConvertHotkey( i_key ),
- PlayStream_Event );
- i_key = config_GetInt( p_intf, "next-key" );
- entries[i++].Set( ConvertHotkeyModifiers( i_key ), ConvertHotkey( i_key ),
- NextStream_Event );
- i_key = config_GetInt( p_intf, "prev-key" );
- entries[i++].Set( ConvertHotkeyModifiers( i_key ), ConvertHotkey( i_key ),
- PrevStream_Event );
- i_key = config_GetInt( p_intf, "faster-key" );
- entries[i++].Set( ConvertHotkeyModifiers( i_key ), ConvertHotkey( i_key ),
- FastStream_Event );
- i_key = config_GetInt( p_intf, "slower-key" );
- entries[i++].Set( ConvertHotkeyModifiers( i_key ), ConvertHotkey( i_key ),
- SlowStream_Event );
+
+ var_Get( p_intf->p_vlc, "key-quit", &val );
+ entries[i++].Set( ConvertHotkeyModifiers( val.i_int ),
+ ConvertHotkey( val.i_int ), Exit_Event );
+ var_Get( p_intf->p_vlc, "key-stop", &val );
+ entries[i++].Set( ConvertHotkeyModifiers( val.i_int ),
+ ConvertHotkey( val.i_int ), StopStream_Event );
+ var_Get( p_intf->p_vlc, "key-play-pause", &val );
+ entries[i++].Set( ConvertHotkeyModifiers( val.i_int ),
+ ConvertHotkey( val.i_int ), PlayStream_Event );
+ var_Get( p_intf->p_vlc, "key-next", &val );
+ entries[i++].Set( ConvertHotkeyModifiers( val.i_int ),
+ ConvertHotkey( val.i_int ), NextStream_Event );
+ var_Get( p_intf->p_vlc, "key-prev", &val );
+ entries[i++].Set( ConvertHotkeyModifiers( val.i_int ),
+ ConvertHotkey( val.i_int ), PrevStream_Event );
+ var_Get( p_intf->p_vlc, "key-faster", &val );
+ entries[i++].Set( ConvertHotkeyModifiers( val.i_int ),
+ ConvertHotkey( val.i_int ), FastStream_Event );
+ var_Get( p_intf->p_vlc, "key-slower", &val );
+ entries[i++].Set( ConvertHotkeyModifiers( val.i_int ),
+ ConvertHotkey( val.i_int ), SlowStream_Event );
wxAcceleratorTable accel( 7, entries );
}
-
-
/*****************************************************************************
* Event Handlers.
*****************************************************************************/
* preferences.cpp : wxWindows plugin for vlc
*****************************************************************************
* Copyright (C) 2000-2001 VideoLAN
- * $Id: preferences.cpp,v 1.38 2003/10/20 12:25:22 gbazin Exp $
+ * $Id: preferences.cpp,v 1.39 2003/10/29 01:33:27 gbazin Exp $
*
* Authors: Gildas Bazin <gbazin@netcourrier.com>
*
void PrefsPanel::ApplyChanges()
{
+ vlc_value_t val;
+
for( size_t i = 0; i < config_array.GetCount(); i++ )
{
ConfigControl *control = config_array.Item(i);
config_PutPsz( p_intf, control->GetName().mb_str(),
control->GetPszValue().mb_str() );
break;
- case CONFIG_ITEM_INTEGER:
case CONFIG_ITEM_KEY:
+ /* So you don't need to restart to have the changes take effect */
+ val.i_int = control->GetIntValue();
+ var_Set( p_intf->p_vlc, control->GetName().mb_str(), val );
+ case CONFIG_ITEM_INTEGER:
case CONFIG_ITEM_BOOL:
config_PutInt( p_intf, control->GetName().mb_str(),
control->GetIntValue() );
* events.c: Windows DirectX video output events handler
*****************************************************************************
* Copyright (C) 2001 VideoLAN
- * $Id: events.c,v 1.25 2003/10/28 17:02:14 gbazin Exp $
+ * $Id: events.c,v 1.26 2003/10/29 01:33:27 gbazin Exp $
*
* Authors: Gildas Bazin <gbazin@netcourrier.com>
*
val.i_int |= KEY_MODIFIER_ALT;
}
- if( val.i_int == config_GetInt( p_event, "fullscreen-key" ) )
- {
- p_event->p_vout->p_sys->i_changes |=
- VOUT_FULLSCREEN_CHANGE;
- }
- else
- {
- var_Set( p_event->p_vlc, "key-pressed", val );
- }
+ var_Set( p_event->p_vlc, "key-pressed", val );
}
break;
* xcommon.c: Functions common to the X11 and XVideo plugins
*****************************************************************************
* Copyright (C) 1998-2001 VideoLAN
- * $Id: xcommon.c,v 1.37 2003/10/28 21:59:12 gbazin Exp $
+ * $Id: xcommon.c,v 1.38 2003/10/29 01:33:27 gbazin Exp $
*
* Authors: Vincent Seguin <seguin@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org>
{
val.i_int |= KEY_MODIFIER_ALT;
}
-
- if( val.i_int == config_GetInt( p_vout, "fullscreen-key" ) )
- {
- p_vout->i_changes |= VOUT_FULLSCREEN_CHANGE;
- }
- else
- {
- var_Set( p_vout->p_vlc, "key-pressed", val );
- }
+ var_Set( p_vout->p_vlc, "key-pressed", val );
}
}
/* Mouse click */
* decoders.
*****************************************************************************
* Copyright (C) 1998-2002 VideoLAN
- * $Id: input.c,v 1.249 2003/10/22 17:12:31 gbazin Exp $
+ * $Id: input.c,v 1.250 2003/10/29 01:33:26 gbazin Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
/* If the desynchronisation requested by the user is < 0, we need to
* cache more data. */
- if( p_input->p_vlc->i_desync < 0 )
- p_input->i_pts_delay -= p_input->p_vlc->i_desync;
+ var_Create( p_input, "audio-desync", VLC_VAR_INTEGER | VLC_VAR_DOINHERIT );
+ var_Get( p_input, "audio-desync", &val );
+ if( val.i_int < 0 )
+ p_input->i_pts_delay -= (val.i_int * 1000);
if( p_input->p_current_data == NULL && p_input->pf_read != NULL )
{
* libvlc.c: main libvlc source
*****************************************************************************
* Copyright (C) 1998-2002 VideoLAN
- * $Id: libvlc.c,v 1.100 2003/10/27 21:54:10 gbazin Exp $
+ * $Id: libvlc.c,v 1.101 2003/10/29 01:33:27 gbazin Exp $
*
* Authors: Vincent Seguin <seguin@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org>
* Initialize hotkey handling
*/
var_Create( p_vlc, "key-pressed", VLC_VAR_INTEGER );
+ p_vlc->p_hotkeys = malloc( sizeof(p_hotkeys) );
+ /* Do a copy (we don't need to modify the strings) */
+ p_vlc->p_hotkeys = p_hotkeys;
+
/*
* Initialize playlist and get commandline files
*/
* libvlc.h: main libvlc header
*****************************************************************************
* Copyright (C) 1998-2002 VideoLAN
- * $Id: libvlc.h,v 1.97 2003/10/27 21:54:10 gbazin Exp $
+ * $Id: libvlc.h,v 1.98 2003/10/29 01:33:27 gbazin Exp $
*
* Authors: Vincent Seguin <seguin@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org>
/* Hotkey options*/
add_category_hint( N_("Hot keys"), HOTKEY_CAT_LONGTEXT , VLC_FALSE );
- add_key( "fullscreen-key", 'f', NULL, FULLSCREEN_KEY_TEXT, FULLSCREEN_KEY_LONGTEXT, VLC_FALSE );
- add_key( "play-pause-key", KEY_SPACE, NULL, PLAY_PAUSE_KEY_TEXT, PLAY_PAUSE_KEY_LONGTEXT, VLC_FALSE );
- add_key( "pause-key", 0, NULL, PAUSE_KEY_TEXT, PAUSE_KEY_LONGTEXT, VLC_TRUE );
- add_key( "play-key", 0, NULL, PLAY_KEY_TEXT, PLAY_KEY_LONGTEXT, VLC_TRUE );
- add_key( "faster-key", '+', NULL, FASTER_KEY_TEXT, FASTER_KEY_LONGTEXT, VLC_FALSE );
- add_key( "slower-key", '-', NULL, SLOWER_KEY_TEXT, SLOWER_KEY_LONGTEXT, VLC_FALSE );
- add_key( "next-key", 'n', NULL, NEXT_KEY_TEXT, NEXT_KEY_LONGTEXT, VLC_FALSE );
- add_key( "prev-key", 'p', NULL, PREV_KEY_TEXT, PREV_KEY_LONGTEXT, VLC_FALSE );
- add_key( "stop-key", 's', NULL, STOP_KEY_TEXT, STOP_KEY_LONGTEXT, VLC_FALSE );
- add_key( "nav-activate-key", KEY_ENTER, NULL, NAV_ACTIVATE_KEY_TEXT, NAV_ACTIVATE_KEY_LONGTEXT, VLC_FALSE );
- add_key( "nav-up-key", KEY_UP, NULL, NAV_UP_KEY_TEXT, NAV_UP_KEY_LONGTEXT, VLC_FALSE );
- add_key( "nav-down-key", KEY_DOWN, NULL, NAV_DOWN_KEY_TEXT, NAV_DOWN_KEY_LONGTEXT, VLC_FALSE );
- add_key( "nav-left-key", KEY_LEFT, NULL, NAV_LEFT_KEY_TEXT, NAV_LEFT_KEY_LONGTEXT, VLC_FALSE );
- add_key( "nav-right-key", KEY_RIGHT, NULL, NAV_RIGHT_KEY_TEXT, NAV_RIGHT_KEY_LONGTEXT, VLC_FALSE );
- add_key( "quit-key", KEY_MODIFIER_CTRL|KEY_SPACE, NULL, QUIT_KEY_TEXT, QUIT_KEY_LONGTEXT, VLC_FALSE );
- add_key( "vol-up-key", 'a', NULL, VOL_UP_KEY_TEXT, VOL_UP_KEY_LONGTEXT, VLC_FALSE );
- add_key( "vol-down-key", 'z', NULL, VOL_DOWN_KEY_TEXT, VOL_DOWN_KEY_LONGTEXT, VLC_FALSE );
+ add_key( "key-fullscreen", 'f', NULL, FULLSCREEN_KEY_TEXT, FULLSCREEN_KEY_LONGTEXT, VLC_FALSE );
+ add_key( "key-play-pause", KEY_SPACE, NULL, PLAY_PAUSE_KEY_TEXT, PLAY_PAUSE_KEY_LONGTEXT, VLC_FALSE );
+ add_key( "key-pause", 0, NULL, PAUSE_KEY_TEXT, PAUSE_KEY_LONGTEXT, VLC_TRUE );
+ add_key( "key-play", 0, NULL, PLAY_KEY_TEXT, PLAY_KEY_LONGTEXT, VLC_TRUE );
+ add_key( "key-faster", '+', NULL, FASTER_KEY_TEXT, FASTER_KEY_LONGTEXT, VLC_FALSE );
+ add_key( "key-slower", '-', NULL, SLOWER_KEY_TEXT, SLOWER_KEY_LONGTEXT, VLC_FALSE );
+ add_key( "key-next", 'n', NULL, NEXT_KEY_TEXT, NEXT_KEY_LONGTEXT, VLC_FALSE );
+ add_key( "key-prev", 'p', NULL, PREV_KEY_TEXT, PREV_KEY_LONGTEXT, VLC_FALSE );
+ add_key( "key-stop", 's', NULL, STOP_KEY_TEXT, STOP_KEY_LONGTEXT, VLC_FALSE );
+ add_key( "key-nav-activate", KEY_ENTER, NULL, NAV_ACTIVATE_KEY_TEXT, NAV_ACTIVATE_KEY_LONGTEXT, VLC_FALSE );
+ add_key( "key-nav-up", KEY_UP, NULL, NAV_UP_KEY_TEXT, NAV_UP_KEY_LONGTEXT, VLC_FALSE );
+ add_key( "key-nav-down", KEY_DOWN, NULL, NAV_DOWN_KEY_TEXT, NAV_DOWN_KEY_LONGTEXT, VLC_FALSE );
+ add_key( "key-nav-left", KEY_LEFT, NULL, NAV_LEFT_KEY_TEXT, NAV_LEFT_KEY_LONGTEXT, VLC_FALSE );
+ add_key( "key-nav-right", KEY_RIGHT, NULL, NAV_RIGHT_KEY_TEXT, NAV_RIGHT_KEY_LONGTEXT, VLC_FALSE );
+ add_key( "key-quit", KEY_MODIFIER_CTRL|KEY_SPACE, NULL, QUIT_KEY_TEXT, QUIT_KEY_LONGTEXT, VLC_FALSE );
+ add_key( "key-vol-up", 'a', NULL, VOL_UP_KEY_TEXT, VOL_UP_KEY_LONGTEXT, VLC_FALSE );
+ add_key( "key-vol-down", 'z', NULL, VOL_DOWN_KEY_TEXT, VOL_DOWN_KEY_LONGTEXT, VLC_FALSE );
/* Usage (mainly useful for cmd line stuff) */
add_usage_hint( PLAYLIST_USAGE );
/*****************************************************************************
* End configuration.
*****************************************************************************/
+
+/*****************************************************************************
+ * Initializer for the vlc_t structure storing the action / key associations
+ *****************************************************************************/
+static struct hotkey p_hotkeys[] =
+{
+ { "key-quit", ACTIONID_QUIT, 0 },
+ { "key-play-pause", ACTIONID_PLAY_PAUSE, 0 },
+ { "key-play", ACTIONID_PLAY, 0 },
+ { "key-pause", ACTIONID_PAUSE, 0 },
+ { "key-stop", ACTIONID_STOP, 0 },
+ { "key-prev", ACTIONID_PREV, 0 },
+ { "key-next", ACTIONID_NEXT, 0 },
+ { "key-faster", ACTIONID_FASTER, 0 },
+ { "key-slower", ACTIONID_SLOWER, 0 },
+ { "key-fullscreen", ACTIONID_FULLSCREEN, 0 },
+ { "key-vol-up", ACTIONID_VOL_UP, 0 },
+ { "key-vol-down", ACTIONID_VOL_DOWN, 0 },
+ { "key-nav-activate", ACTIONID_NAV_ACTIVATE, 0 },
+ { "key-nav-up", ACTIONID_NAV_UP, 0 },
+ { "key-nav-down", ACTIONID_NAV_DOWN, 0 },
+ { "key-nav-left", ACTIONID_NAV_LEFT, 0 },
+ { "key-nav-right", ACTIONID_NAV_RIGHT, 0 },
+ { NULL, 0, 0 }
+};
* configuration.c management of the modules configuration
*****************************************************************************
* Copyright (C) 2001 VideoLAN
- * $Id: configuration.c,v 1.65 2003/09/24 21:31:54 gbazin Exp $
+ * $Id: configuration.c,v 1.66 2003/10/29 01:33:27 gbazin Exp $
*
* Authors: Gildas Bazin <gbazin@netcourrier.com>
*
p_this->p_vlc->i_argc = *pi_argc;
p_this->p_vlc->ppsz_argv = ppsz_argv;
- p_this->p_vlc->p_channel = NULL;
-
#ifdef SYS_DARWIN
/* When vlc.app is run by double clicking in Mac OS X, the 2nd arg
* is the PSN - process serial number (a unique PID-ish thingie)
* variables.c: routines for object variables handling
*****************************************************************************
* Copyright (C) 2002 VideoLAN
- * $Id: variables.c,v 1.32 2003/10/22 17:12:31 gbazin Exp $
+ * $Id: variables.c,v 1.33 2003/10/29 01:33:27 gbazin Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
p_var->val.b_bool = VLC_FALSE;
break;
case VLC_VAR_INTEGER:
+ case VLC_VAR_HOTKEY:
p_var->pf_cmp = CmpInt;
p_var->val.i_int = 0;
break;
p_val->f_float = config_GetFloat( p_this, psz_name );
break;
case VLC_VAR_INTEGER:
+ case VLC_VAR_HOTKEY:
p_val->i_int = config_GetInt( p_this, psz_name );
break;
case VLC_VAR_BOOL: