* hotkeys.c: Hotkey handling for vlc
*****************************************************************************
* Copyright (C) 2004 VideoLAN
- * $Id: hotkeys.c,v 1.16 2004/01/25 16:17:03 anil Exp $
+ * $Id: hotkeys.c,v 1.17 2004/02/17 03:12:00 hartman Exp $
*
* Authors: Sigmund Augdal <sigmunau@idi.ntnu.no>
*
if( i_action == ACTIONID_QUIT )
{
p_intf->p_vlc->b_die = VLC_TRUE;
- vout_OSDMessage( VLC_OBJECT(p_intf), _( "Quit" ) );
+ vout_OSDMessage( p_intf, _( "Quit" ) );
continue;
}
else if( i_action == ACTIONID_VOL_UP )
{
audio_volume_t i_newvol;
- char string[9];
aout_VolumeUp( p_intf, 1, &i_newvol );
- sprintf( string, "Vol %d%%", i_newvol*100/AOUT_VOLUME_MAX );
- vout_OSDMessage( VLC_OBJECT(p_intf), string );
+ vout_OSDMessage( p_intf, "Vol %d%%", i_newvol*100/AOUT_VOLUME_MAX );
}
else if( i_action == ACTIONID_VOL_DOWN )
{
audio_volume_t i_newvol;
- char string[9];
aout_VolumeDown( p_intf, 1, &i_newvol );
- sprintf( string, "Vol %d%%", i_newvol*100/AOUT_VOLUME_MAX );
- vout_OSDMessage( VLC_OBJECT(p_intf), string );
+ vout_OSDMessage( p_intf, "Vol %d%%", i_newvol*100/AOUT_VOLUME_MAX);
}
else if( i_action == ACTIONID_VOL_MUTE )
{
aout_VolumeMute( p_intf, &i_newvol );
if( i_newvol == 0 )
{
- vout_OSDMessage( VLC_OBJECT(p_intf), _( "Mute" ) );
+ vout_OSDMessage( p_intf, _( "Mute" ) );
}
else
{
- char string[9];
- sprintf( string, "Vol %d%%", i_newvol*100/AOUT_VOLUME_MAX );
- vout_OSDMessage( VLC_OBJECT(p_intf), string );
+ vout_OSDMessage( p_intf, "Vol %d%%", i_newvol*100/AOUT_VOLUME_MAX );
}
}
else if( i_action == ACTIONID_FULLSCREEN )
}
if( p_input && val.i_int != PAUSE_S )
{
- vout_OSDMessage( VLC_OBJECT(p_intf), _( "Pause" ) );
+ vout_OSDMessage( p_intf, _( "Pause" ) );
val.i_int = PAUSE_S;
var_Set( p_input, "state", val );
}
if( p_playlist->i_size )
{
vlc_mutex_unlock( &p_playlist->object_lock );
- vout_OSDMessage( VLC_OBJECT(p_intf), _( "Play" ) );
+ vout_OSDMessage( p_intf, _( "Play" ) );
playlist_Play( p_playlist );
vlc_object_release( p_playlist );
}
{
if( i_action == ACTIONID_PAUSE )
{
- vout_OSDMessage( VLC_OBJECT(p_intf), _( "Pause" ) );
+ vout_OSDMessage( p_intf, _( "Pause" ) );
val.i_int = PAUSE_S;
var_Set( p_input, "state", val );
}
else if( i_action == ACTIONID_JUMP_BACKWARD_10SEC )
{
- vout_OSDMessage( VLC_OBJECT(p_intf), _( "Jump -10 seconds" ) );
+ vout_OSDMessage( p_intf, _( "Jump -10 seconds" ) );
val.i_time = -10000000;
var_Set( p_input, "time-offset", val );
}
else if( i_action == ACTIONID_JUMP_FORWARD_10SEC )
{
- vout_OSDMessage( VLC_OBJECT(p_intf), _( "Jump +10 seconds" ) );
+ vout_OSDMessage( p_intf, _( "Jump +10 seconds" ) );
val.i_time = 10000000;
var_Set( p_input, "time-offset", val );
}
else if( i_action == ACTIONID_JUMP_BACKWARD_1MIN )
{
- vout_OSDMessage( VLC_OBJECT(p_intf), _( "Jump -1 minute" ) );
+ vout_OSDMessage( p_intf, _( "Jump -1 minute" ) );
val.i_time = -60000000;
var_Set( p_input, "time-offset", val );
}
else if( i_action == ACTIONID_JUMP_FORWARD_1MIN )
{
- vout_OSDMessage( VLC_OBJECT(p_intf), _( "Jump +1 minute" ) );
+ vout_OSDMessage( p_intf, _( "Jump +1 minute" ) );
val.i_time = 60000000;
var_Set( p_input, "time-offset", val );
}
else if( i_action == ACTIONID_JUMP_BACKWARD_5MIN )
{
- vout_OSDMessage( VLC_OBJECT(p_intf), _( "Jump -5 minutes" ) );
+ vout_OSDMessage( p_intf, _( "Jump -5 minutes" ) );
val.i_time = -300000000;
var_Set( p_input, "time-offset", val );
}
else if( i_action == ACTIONID_JUMP_FORWARD_5MIN )
{
- vout_OSDMessage( VLC_OBJECT(p_intf), _( "Jump +5 minutes" ) );
+ vout_OSDMessage( p_intf, _( "Jump +5 minutes" ) );
val.i_time = 300000000;
var_Set( p_input, "time-offset", val );
}
if( dur != -1 )
{
- char psz_position[2*MSTRTIME_MAX_SIZE + 3];
secstotimestr( psz_duration, dur/1000000 );
- strcpy( psz_position, psz_time );
- strcat( psz_position, " / " );
- strcat( psz_position, psz_duration );
- vout_OSDMessage( VLC_OBJECT(p_playlist), psz_position );
+ vout_OSDMessage( p_playlist, "%s / %s", psz_time, psz_duration );
}
else if( i_seconds > 0 )
{
- vout_OSDMessage( VLC_OBJECT(p_playlist), psz_time );
+ vout_OSDMessage( p_playlist, psz_time );
}
vlc_object_release( p_playlist );
}
* controls.m: MacOS X interface module
*****************************************************************************
* Copyright (C) 2002-2003 VideoLAN
- * $Id: controls.m,v 1.60 2004/01/25 17:01:57 murray Exp $
+ * $Id: controls.m,v 1.61 2004/02/17 03:12:00 hartman Exp $
*
* Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
* Christophe Massiot <massiot@via.ecp.fr>
- * Derk-Jan Hartman <thedj@users.sourceforge.net>
+ * Derk-Jan Hartman <hartman at videolan dot org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
}
if( p_input && val.i_int != PAUSE_S )
{
- vout_OSDMessage( VLC_OBJECT(p_intf), _( "Pause" ) );
+ vout_OSDMessage( p_intf, _( "Pause" ) );
val.i_int = PAUSE_S;
var_Set( p_input, "state", val );
}
if( p_playlist->i_size )
{
vlc_mutex_unlock( &p_playlist->object_lock );
- vout_OSDMessage( VLC_OBJECT(p_intf), _( "Play" ) );
+ vout_OSDMessage( p_intf, _( "Play" ) );
playlist_Play( p_playlist );
vlc_object_release( p_playlist );
}
FIND_ANYWHERE );
if( p_playlist != NULL )
{
- vout_OSDMessage( (vlc_object_t *)p_intf, _( "Stop" ) );
+ vout_OSDMessage( p_intf, _( "Stop" ) );
playlist_Stop( p_playlist );
vlc_object_release( p_playlist );
}
vlc_value_t val; val.b_bool = VLC_TRUE;
var_Set( p_input, "rate-faster", val );
- vout_OSDMessage( (vlc_object_t *)p_intf, _( "Faster" ) );
+ vout_OSDMessage( p_intf, _( "Faster" ) );
vlc_object_release( p_input );
}
}
vlc_value_t val; val.b_bool = VLC_TRUE;
var_Set( p_input, "rate-slower", val );
- vout_OSDMessage( (vlc_object_t *)p_intf, _( "Slower" ) );
+ vout_OSDMessage( p_intf, _( "Slower" ) );
vlc_object_release( p_input );
}
}
{
playlist_Prev( p_playlist );
vlc_object_release( p_playlist );
- vout_OSDMessage( (vlc_object_t *)p_intf, _( "Previous" ) );
+ vout_OSDMessage( p_intf, _( "Previous" ) );
}
}
{
playlist_Next( p_playlist );
vlc_object_release( p_playlist );
- vout_OSDMessage( (vlc_object_t *)p_intf, _( "Next" ) );
+ vout_OSDMessage( p_intf, _( "Next" ) );
}
}
var_Set( p_playlist, "random", val );
if( val.b_bool )
{
- vout_OSDMessage( (vlc_object_t *)p_intf, _( "Random On" ) );
+ vout_OSDMessage( p_intf, _( "Random On" ) );
}
else
{
- vout_OSDMessage( (vlc_object_t *)p_intf, _( "Random Off" ) );
+ vout_OSDMessage( p_intf, _( "Random Off" ) );
}
p_intf->p_sys->b_playlist_update = VLC_TRUE;
var_Set( p_playlist, "repeat", val );
if( val.b_bool )
{
- vout_OSDMessage( (vlc_object_t *)p_intf, _( "Repeat All" ) );
+ vout_OSDMessage( p_intf, _( "Repeat All" ) );
}
else
{
- vout_OSDMessage( (vlc_object_t *)p_intf, _( "Repeat Off" ) );
+ vout_OSDMessage( p_intf, _( "Repeat Off" ) );
}
p_intf->p_sys->b_playlist_update = VLC_TRUE;
var_Set( p_playlist, "loop", val );
if( val.b_bool )
{
- vout_OSDMessage( (vlc_object_t *)p_intf, _( "Repeat One" ) );
+ vout_OSDMessage( p_intf, _( "Repeat One" ) );
}
else
{
- vout_OSDMessage( (vlc_object_t *)p_intf, _( "Repeat Off" ) );
+ vout_OSDMessage( p_intf, _( "Repeat Off" ) );
}
p_intf->p_sys->b_playlist_update = VLC_TRUE;
{
intf_thread_t * p_intf = [NSApp getIntf];
audio_volume_t i_volume;
- char string[9];
aout_VolumeGet( p_intf, &i_volume );
[o_volumeslider setFloatValue: (float)(i_volume / AOUT_VOLUME_STEP)];
- sprintf( string, "Vol %d%%", i_volume*100/AOUT_VOLUME_MAX );
- vout_OSDMessage( (vlc_object_t *)p_intf, string );
+ vout_OSDMessage( p_intf, "Vol %d%%", i_volume*100/AOUT_VOLUME_MAX );
}
- (IBAction)windowAction:(id)sender