p_sys->p_last_vout = NULL;
p_intf->p_sys->i_mousewheel_mode =
- config_GetInt( p_intf, "hotkeys-mousewheel-mode" );
+ var_InheritInteger( p_intf, "hotkeys-mousewheel-mode" );
var_AddCallback( p_intf->p_libvlc, "key-pressed", SpecialKeyEvent, p_intf );
var_AddCallback( p_intf->p_libvlc, "key-action", ActionEvent, p_intf );
static int PutAction( intf_thread_t *p_intf, int i_action )
{
intf_sys_t *p_sys = p_intf->p_sys;
- playlist_t *p_playlist = pl_Hold( p_intf );
+ playlist_t *p_playlist = pl_Get( p_intf );
/* Update the input */
input_thread_t *p_input = playlist_CurrentInput( p_playlist );
case ACTIONID_TOGGLE_FULLSCREEN:
{
- vlc_object_t *obj = p_vout ? VLC_OBJECT(p_vout)
- : VLC_OBJECT(p_playlist);
- var_ToggleBool( obj, "fullscreen" );
+ bool fs = var_ToggleBool( p_playlist, "fullscreen" );
+ if( p_vout )
+ var_SetBool( p_vout, "fullscreen", fs );
break;
}
case ACTIONID_LEAVE_FULLSCREEN:
- if( p_vout && var_GetBool( p_vout, "fullscreen" ) )
+ if( p_vout )
var_SetBool( p_vout, "fullscreen", false );
+ var_SetBool( p_playlist, "fullscreen", false );
break;
case ACTIONID_ZOOM_QUARTER:
}
break;
-#ifdef WIN32
case ACTIONID_WALLPAPER:
{ /* FIXME: this is invalid if not using DirectX output!!! */
vlc_object_t *obj = p_vout ? VLC_OBJECT(p_vout)
: VLC_OBJECT(p_playlist);
- var_ToggleBool( obj, "directx-wallpaper" );
+ var_ToggleBool( obj, "video-wallpaper" );
+ break;
}
-#endif
/* Playlist actions */
case ACTIONID_LOOP:
case ACTIONID_RANDOM:
{
var_ToggleBool( p_playlist, "random" );
+ break;
}
case ACTIONID_PLAY_PAUSE:
&& b_seekable )
{
#define SET_TIME( a, b ) \
- i_interval = config_GetInt( p_input, a "-jump-size" ); \
+ i_interval = var_InheritInteger( p_input, a "-jump-size" ); \
if( i_interval > 0 ) { \
mtime_t i_time = (mtime_t)(i_interval * b) * 1000000L; \
var_SetTime( p_input, "time-offset", i_time ); \
val_list.p_list->p_values[i].f_float );
vout_OSDMessage( VLC_OBJECT(p_input), DEFAULT_CHAN,
_("Zoom mode: %s"),
- text_list.p_list->p_values[i].var.psz_name );
+ text_list.p_list->p_values[i].psz_string );
var_FreeList( &val_list, &text_list );
}
else if( i_action == ACTIONID_RATE_FASTER_FINE ||
i_action == ACTIONID_RATE_SLOWER_FINE )
{
- /* The playback rate is defined by INPUT_RATE_DEFAULT / "rate"
- * and we want to increase/decrease it by 0.1 while making sure
- * that the resulting playback rate is a multiple of 0.1
- */
- int i_rate = 1. * INPUT_RATE_DEFAULT
- / var_GetFloat( p_input, "rate" );
- if( i_rate < INPUT_RATE_MIN )
- i_rate = INPUT_RATE_MIN;
- else if( i_rate > INPUT_RATE_MAX )
- i_rate = INPUT_RATE_MAX;
- int i_sign = i_rate < 0 ? -1 : 1;
- const int i_dir = i_action == ACTIONID_RATE_FASTER_FINE ? 1 : -1;
+ const double f_rate_min = (double)INPUT_RATE_DEFAULT / INPUT_RATE_MAX;
+ const double f_rate_max = (double)INPUT_RATE_DEFAULT / INPUT_RATE_MIN;
+ double f_rate = var_GetFloat( p_input, "rate" );
- const double f_speed = floor( ( (double)INPUT_RATE_DEFAULT / abs(i_rate) + 0.05 ) / 0.1 + i_dir ) * 0.1;
- if( f_speed <= (double)INPUT_RATE_DEFAULT / INPUT_RATE_MAX ) /* Needed to avoid infinity */
- i_rate = INPUT_RATE_MAX;
- else
- i_rate = INPUT_RATE_DEFAULT / f_speed + 0.5;
+ int i_sign = f_rate < 0 ? -1 : 1;
+ const int i_dir = i_action == ACTIONID_RATE_FASTER_FINE ? 1 : -1;
- i_rate = i_sign * __MIN( __MAX( i_rate, INPUT_RATE_MIN ), INPUT_RATE_MAX );
+ f_rate = floor( fabs(f_rate) / 0.1 + i_dir ) * 0.1;
+ if( f_rate < f_rate_min )
+ f_rate = f_rate_min;
+ else if( f_rate > f_rate_max )
+ f_rate = f_rate_max;
+ f_rate *= i_sign;
- var_SetFloat( p_input, "rate", i_rate );
+ var_SetFloat( p_input, "rate", f_rate );
char psz_msg[7+1];
- snprintf( psz_msg, sizeof(psz_msg), _("%.2fx"), (double)INPUT_RATE_DEFAULT / i_rate );
+ snprintf( psz_msg, sizeof(psz_msg), _("%.2fx"), f_rate );
vout_OSDMessage( VLC_OBJECT(p_input), DEFAULT_CHAN, "%s", psz_msg );
}
- else if( i_action == ACTIONID_POSITION && b_seekable )
+ else if( i_action == ACTIONID_POSITION )
{
- DisplayPosition( p_intf, p_vout, p_input );
+ if( ( !p_vout || vout_OSDEpg( p_vout, input_GetItem( p_input ) ) ) && b_seekable )
+ DisplayPosition( p_intf, p_vout, p_input );
}
else if( i_action >= ACTIONID_PLAY_BOOKMARK1 &&
i_action <= ACTIONID_PLAY_BOOKMARK10 )
{
if( var_GetBool( p_input, "can-record" ) )
{
- const bool b_record = !var_GetBool( p_input, "record" );
+ const bool b_record = var_ToggleBool( p_input, "record" );
if( b_record )
vout_OSDMessage( p_intf, DEFAULT_CHAN, "%s", _("Recording") );
else
vout_OSDMessage( p_intf, DEFAULT_CHAN, "%s", _("Recording done") );
- var_SetBool( p_input, "record", b_record );
}
}
}
vlc_object_release( p_vout );
if( p_input )
vlc_object_release( p_input );
- pl_Release( p_intf );
return VLC_SUCCESS;
}
if( asprintf( &psz_bookmark_name, "bookmark%i", i_num ) == -1 )
return;
- playlist_t *p_playlist = pl_Hold( p_intf );
+ playlist_t *p_playlist = pl_Get( p_intf );
char *psz_bookmark = var_CreateGetString( p_intf, psz_bookmark_name );
PL_LOCK;
free( psz_bookmark );
free( psz_bookmark_name );
- pl_Release( p_intf );
}
static void SetBookmark( intf_thread_t *p_intf, int i_num )
if( asprintf( &psz_bookmark_name, "bookmark%i", i_num ) == -1 )
return;
- playlist_t *p_playlist = pl_Hold( p_intf );
+ playlist_t *p_playlist = pl_Get( p_intf );
var_Create( p_intf, psz_bookmark_name,
VLC_VAR_STRING|VLC_VAR_DOINHERIT );
playlist_item_t * p_item = playlist_CurrentPlayingItem( p_playlist );
config_SaveConfigFile( p_intf, "hotkeys" );
}
- pl_Release( p_intf );
free( psz_bookmark_name );
}