location by any module.
* added a OSD config option to the Video options. this will allow you to disable
the messages printed by OSDMessage. Subtitles will still be shown however.
* src/audio_output/intf.c: volumeSet sets the intf-change variable.
* modules/gui/macosx/vout.m: fix the modifier detection.
* osd.h : Constants for use with osd modules
*****************************************************************************
* Copyright (C) 2003 VideoLAN
- * $Id: osd.h,v 1.4 2003/10/04 15:51:22 sigmunau Exp $
+ * $Id: osd.h,v 1.5 2003/10/30 22:34:48 hartman Exp $
*
* Authors: Sigmund Augdal <sigmunau@idi.ntnu.no>
*
VLC_EXPORT( void, vout_ShowTextRelative, ( vout_thread_t *, char *, text_style_t *, int, int, int, mtime_t ) );
VLC_EXPORT( void, vout_ShowTextAbsolute, ( vout_thread_t *, char *, text_style_t *, int, int, int, mtime_t, mtime_t ) );
+VLC_EXPORT( void, vout_OSDMessage, ( vlc_object_t *, char * ) );
* hotkeys.c: Hotkey handling for vlc
*****************************************************************************
* Copyright (C) 2003 VideoLAN
- * $Id: hotkeys.c,v 1.4 2003/10/30 17:58:07 gbazin Exp $
+ * $Id: hotkeys.c,v 1.5 2003/10/30 22:34:48 hartman Exp $
*
* Authors: Sigmund Augdal <sigmunau@idi.ntnu.no>
*
static int Open ( vlc_object_t * );
static void Close ( vlc_object_t * );
static void Run ( intf_thread_t * );
-static void Feedback( intf_thread_t *, char * );
static int GetKey ( intf_thread_t *);
static int KeyEvent( vlc_object_t *, char const *,
vlc_value_t, vlc_value_t, void * );
if( i_action == ACTIONID_QUIT )
{
p_intf->p_vlc->b_die = VLC_TRUE;
- Feedback( p_intf, _("Quit" ) );
+ vout_OSDMessage( p_intf, _("Quit" ) );
continue;
}
else if( i_action == ACTIONID_VOL_UP )
char string[9];
aout_VolumeUp( p_intf, 1, &i_newvol );
sprintf( string, "Vol %d%%", i_newvol*100/AOUT_VOLUME_MAX );
- Feedback( p_intf, string );
+ vout_OSDMessage( p_intf, string );
}
else if( i_action == ACTIONID_VOL_DOWN )
{
char string[9];
aout_VolumeDown( p_intf, 1, &i_newvol );
sprintf( string, "Vol %d%%", i_newvol*100/AOUT_VOLUME_MAX );
- Feedback( p_intf, string );
+ vout_OSDMessage( p_intf, string );
}
else if( i_action == ACTIONID_FULLSCREEN )
{
if( p_input &&
p_input->stream.control.i_status != PAUSE_S )
{
- Feedback( p_intf, _( "Pause" ) );
+ vout_OSDMessage( p_intf, _( "Pause" ) );
input_SetStatus( p_input, INPUT_STATUS_PAUSE );
}
else
if( p_playlist->i_size )
{
vlc_mutex_unlock( &p_playlist->object_lock );
- Feedback( p_intf, _( "Play" ) );
+ vout_OSDMessage( p_intf, _( "Play" ) );
playlist_Play( p_playlist );
vlc_object_release( p_playlist );
}
{
if( i_action == ACTIONID_PAUSE )
{
- Feedback( p_intf, _( "Pause" ) );
+ vout_OSDMessage( p_intf, _( "Pause" ) );
input_SetStatus( p_input, INPUT_STATUS_PAUSE );
}
else if( i_action == ACTIONID_JUMP_BACKWARD_10SEC )
}
}
-static void Feedback( intf_thread_t *p_intf, char *psz_string )
-{
- 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, 1500000 );
- }
-}
-
static int GetKey( intf_thread_t *p_intf)
{
vlc_mutex_lock( &p_intf->p_sys->change_lock );
* vout.m: MacOS X video output plugin
*****************************************************************************
* Copyright (C) 2001-2003 VideoLAN
- * $Id: vout.m,v 1.59 2003/10/29 11:54:48 hartman Exp $
+ * $Id: vout.m,v 1.60 2003/10/30 22:34:48 hartman Exp $
*
* Authors: Colin Delacroix <colin@zoy.org>
* Florian G. Pflug <fgp@phlo.org>
unichar key = 0;
vlc_value_t val;
unsigned int i_pressed_modifiers = 0;
-
+ val.i_int = 0;
+
i_pressed_modifiers = [o_event modifierFlags];
if( i_pressed_modifiers & NSShiftKeyMask )
if( i_pressed_modifiers & NSCommandKeyMask )
val.i_int |= KEY_MODIFIER_COMMAND;
- NSLog( @"detected the modifiers: %x", val.i_int );
+ NSLog( @"detected the modifiers: %x", i_pressed_modifiers );
key = [[o_event charactersIgnoringModifiers] characterAtIndex: 0];
* intf.c : audio output API towards the interface modules
*****************************************************************************
* Copyright (C) 2002 VideoLAN
- * $Id: intf.c,v 1.18 2003/08/03 23:11:21 gbazin Exp $
+ * $Id: intf.c,v 1.19 2003/10/30 22:34:48 hartman Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
*****************************************************************************/
int __aout_VolumeSet( vlc_object_t * p_object, audio_volume_t i_volume )
{
+ vlc_value_t val;
aout_instance_t * p_aout = vlc_object_find( p_object, VLC_OBJECT_AOUT,
FIND_ANYWHERE );
int i_result = 0;
vlc_mutex_unlock( &p_aout->mixer_lock );
vlc_object_release( p_aout );
+
+ val.b_bool = VLC_TRUE;
+ var_Set( p_aout, "intf-change", val );
return i_result;
}
* libvlc.h: main libvlc header
*****************************************************************************
* Copyright (C) 1998-2002 VideoLAN
- * $Id: libvlc.h,v 1.99 2003/10/30 17:58:07 gbazin Exp $
+ * $Id: libvlc.h,v 1.100 2003/10/30 22:34:48 hartman Exp $
*
* Authors: Vincent Seguin <seguin@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org>
"You can use this option to place the subtitles under the movie, " \
"instead of over the movie. Try several positions.")
+#define OSD_TEXT N_("On Screen Display")
+#define OSD_LONGTEXT N_( \
+ "You can disable the messages VLC creates in the video.")
+
#define FILTER_TEXT N_("Video filter module")
#define FILTER_LONGTEXT N_( \
"This will allow you to add a post-processing filter to enhance the " \
#endif
add_integer( "spumargin", -1, NULL, SPUMARGIN_TEXT,
SPUMARGIN_LONGTEXT, VLC_TRUE );
+ add_bool( "osd", 1, NULL, OSD_TEXT, OSD_LONGTEXT, VLC_FALSE );
add_module( "filter", "video filter", NULL, NULL,
FILTER_TEXT, FILTER_LONGTEXT, VLC_FALSE );
add_string( "aspect-ratio", "", NULL,
* video_text.c : text manipulation functions
*****************************************************************************
* Copyright (C) 1999-2001 VideoLAN
- * $Id: video_text.c,v 1.45 2003/08/04 23:35:25 gbazin Exp $
+ * $Id: video_text.c,v 1.46 2003/10/30 22:34:48 hartman Exp $
*
* Authors: Sigmund Augdal <sigmunau@idi.ntnu.no>
*
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/
#include <vlc/vout.h>
+#include <osd.h>
/**
* \brief Show text on the video for some time
msg_Warn( p_vout, "No text renderer found" );
}
}
+
+
+/**
+ * \brief Write an informative message at the default location,
+ * for the default duration and only if the OSD option is enabled.
+ * \param p_caller The object that called the function.
+ * \param psz_string The text to be shown
+ **/
+void vout_OSDMessage( vlc_object_t *p_caller, char *psz_string )
+{
+ vout_thread_t *p_vout;
+
+ if( !config_GetInt( p_caller, "osd" ) ) return;
+
+ p_vout = vlc_object_find( p_caller, VLC_OBJECT_VOUT, FIND_ANYWHERE );
+
+ if( p_vout )
+ {
+ vout_ShowTextRelative( p_vout, psz_string, NULL,
+ OSD_ALIGN_TOP|OSD_ALIGN_RIGHT,
+ 30,20,1000000 );
+ vlc_object_release( p_vout );
+ }
+}
+