/*****************************************************************************
* hotkeys.c: Hotkey handling for vlc
*****************************************************************************
- * Copyright (C) 2004 VideoLAN
+ * Copyright (C) 2005 the VideoLAN team
* $Id$
*
* Authors: Sigmund Augdal <sigmunau@idi.ntnu.no>
/* Find action triggered by hotkey */
i_action = 0;
i_key = GetKey( p_intf );
- for( i = 0; p_hotkeys[i].psz_action != NULL; i++ )
+ for( i = 0; i_key != -1 && p_hotkeys[i].psz_action != NULL; i++ )
{
if( p_hotkeys[i].i_key == i_key )
{
if( i_action == ACTIONID_QUIT )
{
+ p_playlist = vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
+ FIND_ANYWHERE );
+ if( p_playlist )
+ {
+ playlist_Stop( p_playlist );
+ vlc_object_release( p_playlist );
+ }
+ /* Playlist is stopped now kill vlc. */
p_intf->p_vlc->b_die = VLC_TRUE;
ClearChannels( p_intf, p_vout );
vout_OSDMessage( p_intf, DEFAULT_CHAN, _( "Quit" ) );
vlc_object_release( p_playlist );
}
}
+ else if( i_action == ACTIONID_SNAPSHOT )
+ {
+ if( p_vout ) vout_Control( p_vout, VOUT_SNAPSHOT );
+ }
else if( i_action == ACTIONID_SUBDELAY_DOWN )
{
int64_t i_delay = var_GetTime( p_input, "spu-delay" );
static void SetBookmark( intf_thread_t *p_intf, int i_num )
{
- vlc_value_t val;
playlist_t *p_playlist =
vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST, FIND_ANYWHERE );
if( p_playlist )
VLC_VAR_STRING|VLC_VAR_DOINHERIT );
if( p_playlist->status.p_item )
{
- val.psz_string = strdup( p_playlist->status.p_item->input.psz_uri );
- var_Set( p_intf, psz_bookmark_name, val );
+ config_PutPsz( p_intf, psz_bookmark_name,
+ p_playlist->status.p_item->input.psz_uri);
msg_Info( p_intf, "setting playlist bookmark %i to %s", i_num,
- val.psz_string );
+ p_playlist->status.p_item->input.psz_uri);
+ config_SaveConfigFile( p_intf, "hotkeys" );
}
vlc_object_release( p_playlist );
}
}
else
{
- vout_OSDMessage( p_vout, VOLUME_TEXT_CHAN, "Vol %d%%",
- 2*i_vol*100/AOUT_VOLUME_MAX );
+ vout_OSDMessage( p_vout, VOLUME_TEXT_CHAN, "Volume %d%%",
+ i_vol*400/AOUT_VOLUME_MAX );
}
}