ac_help="$ac_help
--disable-optimizations Disable compiler optimizations (default enabled)"
ac_help="$ac_help
- --enable-dummy dummy audio and video support (default disabled)"
+ --disable-dummy dummy module (default enabled)"
ac_help="$ac_help
--disable-null Null module (default enabled)"
ac_help="$ac_help
# Check whether --enable-dummy or --disable-dummy was given.
if test "${enable_dummy+set}" = set; then
enableval="$enable_dummy"
- if test x$enable_dummy = xyes; then PLUGINS=${PLUGINS}"dummy "; fi
+ :
fi
+if test x$enable_dummy != xno; then PLUGINS=${PLUGINS}"dummy "; fi
# Check whether --enable-null or --disable-null was given.
if test "${enable_null+set}" = set; then
enableval="$enable_null"
enableval="$enable_alsa"
if test x$enable_alsa = xyes; then ac_safe=`echo "sys/asoundlib.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for sys/asoundlib.h""... $ac_c" 1>&6
-echo "configure:3512: checking for sys/asoundlib.h" >&5
+echo "configure:3513: checking for sys/asoundlib.h" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3517 "configure"
+#line 3518 "configure"
#include "confdefs.h"
#include <sys/asoundlib.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3522: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3523: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
echo "$ac_t""yes" 1>&6
echo $ac_n "checking for main in -lasound""... $ac_c" 1>&6
-echo "configure:3539: checking for main in -lasound" >&5
+echo "configure:3540: checking for main in -lasound" >&5
ac_lib_var=`echo asound'_'main | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
ac_save_LIBS="$LIBS"
LIBS="-lasound $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 3547 "configure"
+#line 3548 "configure"
#include "confdefs.h"
int main() {
main()
; return 0; }
EOF
-if { (eval echo configure:3554: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3555: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
else
AC_ARG_ENABLE(dummy,
- [ --enable-dummy dummy audio and video support (default disabled)],
- [if test x$enable_dummy = xyes; then PLUGINS=${PLUGINS}"dummy "; fi])
+ [ --disable-dummy dummy module (default enabled)])
+if test x$enable_dummy != xno; then PLUGINS=${PLUGINS}"dummy "; fi
AC_ARG_ENABLE(null,
[ --disable-null Null module (default enabled)])
if test x$enable_null != xno; then PLUGINS=${PLUGINS}"null "; fi
options starting with two dashes (`-').
A summary of options is included below.
.TP
+.B \-\-intf <module>
+Specify an interface module: "gnome", "curses", "shell", for instance.
+.TP
.B \-\-noaudio
Disable audio output.
.TP
Disable video output.
.TP
.B \-\-vout <module>
-Specify a video output module: "gnome", "fb", "glide", for instance.
+Specify a video output module: "x11", "sdl", "fb", for instance.
.TP
.B \-\-motion <module>
Specify a module for motion compensation: "motion", "motionmmx", for instance.
Note that the vlc is certainly going to crash if you ask it to
display more images than your CPU can cope with.
.TP
-.B \-\-dvd
-Activate DVD mode, by directly accessing the DVD drive (no need to mount
-it). By default,
.B vlc
opens /dev/dvd, but this behaviour may be overridden by the vlc_dvd_device
environment variable (see below).
also accepts a lot of parameters to customize its behaviour.
.TP
.B Interface parameters:
+ vlc_intf=<method name> interface method
vlc_init=<filename> initialization script
vlc_channels=<filename> channels list
warning_level=<level> warning level
void ( * pf_frame_field_##yuv ) ( struct macroblock_s * ); \
void ( * pf_frame_frame_##yuv ) ( struct macroblock_s * ); \
void ( * pf_frame_dmv_##yuv ) ( struct macroblock_s * );
- motion_functions( 420 )
- motion_functions( 422 )
- motion_functions( 444 )
+ motion_functions( 420 )
+ motion_functions( 422 )
+ motion_functions( 444 )
#undef motion_functions
} motion;
/*****************************************************************************
* aout_dummy.c : dummy audio output plugin
*****************************************************************************
- * Copyright (C) 2000 VideoLAN
+ * Copyright (C) 2000, 2001 VideoLAN
*
- * Authors:
+ * Authors: Samuel Hocevar <sam@zoy.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
{
/* Initialize some variables */
p_aout->i_format = AOUT_FORMAT_DEFAULT;
- p_aout->i_channels = 1 + main_GetIntVariable( AOUT_STEREO_VAR, AOUT_STEREO_DEFAULT );
- p_aout->l_rate = main_GetIntVariable( AOUT_RATE_VAR, AOUT_RATE_DEFAULT );
+ p_aout->i_channels = 1 + main_GetIntVariable( AOUT_STEREO_VAR,
+ AOUT_STEREO_DEFAULT );
+ p_aout->l_rate = main_GetIntVariable( AOUT_RATE_VAR,
+ AOUT_RATE_DEFAULT );
return( 0 );
}
/*****************************************************************************
* dummy.c : dummy plugin for vlc
*****************************************************************************
- * Copyright (C) 2000 VideoLAN
+ * Copyright (C) 2000, 2001 VideoLAN
*
- * Authors:
+ * Authors: Samuel Hocevar <sam@zoy.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
#include "threads.h"
#include "mtime.h"
#include "tests.h"
-#include "plugins.h"
#include "interface.h"
+
#include "audio_output.h"
+
#include "video.h"
#include "video_output.h"
* Capabilities defined in the other files.
*****************************************************************************/
extern void aout_getfunctions( function_list_t * p_function_list );
+extern void vout_getfunctions( function_list_t * p_function_list );
+extern void intf_getfunctions( function_list_t * p_function_list );
/*****************************************************************************
* InitModule: get the module structure and configuration.
p_module->psz_version = VERSION;
p_module->i_capabilities = MODULE_CAPABILITY_NULL
- | MODULE_CAPABILITY_AOUT;
+ | MODULE_CAPABILITY_AOUT
+ | MODULE_CAPABILITY_VOUT
+ | MODULE_CAPABILITY_INTF;
return( 0 );
}
}
aout_getfunctions( &p_module->p_functions->aout );
+ vout_getfunctions( &p_module->p_functions->vout );
+ intf_getfunctions( &p_module->p_functions->intf );
p_module->p_config = p_config;
return( 0 );
}
-/* OLD MODULE STRUCTURE -- soon to be removed */
-
-/*****************************************************************************
- * Exported prototypes
- *****************************************************************************/
-static void vout_GetPlugin( p_vout_thread_t p_vout );
-static void intf_GetPlugin( p_intf_thread_t p_intf );
-
-/* Video output */
-int vout_DummyCreate ( vout_thread_t *p_vout, char *psz_display,
- int i_root_window, void *p_data );
-int vout_DummyInit ( p_vout_thread_t p_vout );
-void vout_DummyEnd ( p_vout_thread_t p_vout );
-void vout_DummyDestroy ( p_vout_thread_t p_vout );
-int vout_DummyManage ( p_vout_thread_t p_vout );
-void vout_DummyDisplay ( p_vout_thread_t p_vout );
-void vout_DummySetPalette ( p_vout_thread_t p_vout,
- u16 *red, u16 *green, u16 *blue, u16 *transp );
-
-/* Interface */
-int intf_DummyCreate ( p_intf_thread_t p_intf );
-void intf_DummyDestroy ( p_intf_thread_t p_intf );
-void intf_DummyManage ( p_intf_thread_t p_intf );
-
-/*****************************************************************************
- * GetConfig: get the plugin structure and configuration
- *****************************************************************************/
-plugin_info_t * GetConfig( void )
-{
- plugin_info_t * p_info = (plugin_info_t *) malloc( sizeof(plugin_info_t) );
-
- p_info->psz_name = "Dummy";
- p_info->psz_version = VERSION;
- p_info->psz_author = "the VideoLAN team <vlc@videolan.org>";
-
- p_info->aout_GetPlugin = NULL;
- p_info->vout_GetPlugin = vout_GetPlugin;
- p_info->intf_GetPlugin = intf_GetPlugin;
- p_info->yuv_GetPlugin = NULL;
-
- /* The dummy plugin always works, but should have low priority */
- p_info->i_score = 0x1;
-
- /* If this plugin was requested, score it higher */
- if( TestMethod( VOUT_METHOD_VAR, "dummy" ) )
- {
- p_info->i_score += 0x200;
- }
-
- return( p_info );
-}
-
-/*****************************************************************************
- * Following functions are only called through the p_info structure
- *****************************************************************************/
-
-static void vout_GetPlugin( p_vout_thread_t p_vout )
-{
- p_vout->p_sys_create = vout_DummyCreate;
- p_vout->p_sys_init = vout_DummyInit;
- p_vout->p_sys_end = vout_DummyEnd;
- p_vout->p_sys_destroy = vout_DummyDestroy;
- p_vout->p_sys_manage = vout_DummyManage;
- p_vout->p_sys_display = vout_DummyDisplay;
-}
-
-static void intf_GetPlugin( p_intf_thread_t p_intf )
-{
- p_intf->p_sys_create = intf_DummyCreate;
- p_intf->p_sys_destroy = intf_DummyDestroy;
- p_intf->p_sys_manage = intf_DummyManage;
-}
-
/*****************************************************************************
* intf_dummy.c: dummy interface plugin
*****************************************************************************
- * Copyright (C) 2000 VideoLAN
+ * Copyright (C) 2000, 2001 VideoLAN
*
- * Authors:
+ * Authors: Samuel Hocevar <sam@zoy.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
#include "common.h"
#include "threads.h"
#include "mtime.h"
-#include "plugins.h"
-
-#include "stream_control.h"
-#include "input_ext-intf.h"
-
-#include "video.h"
-#include "video_output.h"
+#include "tests.h"
+#include "modules.h"
#include "intf_msg.h"
#include "interface.h"
} intf_sys_t;
/*****************************************************************************
- * intf_DummyCreate: initialize dummy interface
+ * Local prototypes.
+ *****************************************************************************/
+static int intf_Probe ( probedata_t *p_data );
+static int intf_Open ( intf_thread_t *p_intf );
+static void intf_Close ( intf_thread_t *p_intf );
+static void intf_Run ( intf_thread_t *p_intf );
+
+/*****************************************************************************
+ * Functions exported as capabilities. They are declared as static so that
+ * we don't pollute the namespace too much.
+ *****************************************************************************/
+void intf_getfunctions( function_list_t * p_function_list )
+{
+ p_function_list->pf_probe = intf_Probe;
+ p_function_list->functions.intf.pf_open = intf_Open;
+ p_function_list->functions.intf.pf_close = intf_Close;
+ p_function_list->functions.intf.pf_run = intf_Run;
+}
+
+/*****************************************************************************
+ * intf_Probe: probe the interface and return a score
+ *****************************************************************************
+ * This function tries to initialize Gnome and returns a score to the
+ * plugin manager so that it can select the best plugin.
+ *****************************************************************************/
+static int intf_Probe( probedata_t *p_data )
+{
+ if( TestMethod( INTF_METHOD_VAR, "dummy" ) )
+ {
+ return( 999 );
+ }
+
+ return( 1 );
+}
+
+/*****************************************************************************
+ * intf_Open: initialize dummy interface
*****************************************************************************/
-int intf_DummyCreate( intf_thread_t *p_intf )
+static int intf_Open( intf_thread_t *p_intf )
{
/* Allocate instance and initialize some members */
p_intf->p_sys = malloc( sizeof( intf_sys_t ) );
return( 1 );
};
- /* Spawn video output thread */
- if( p_main->b_video )
- {
- p_intf->p_vout = vout_CreateThread( NULL, 0, 0, 0, NULL, 0, NULL );
- if( p_intf->p_vout == NULL ) /* error */
- {
- intf_ErrMsg("intf error: can't create output thread" );
- return( 1 );
- }
- }
return( 0 );
}
/*****************************************************************************
- * intf_DummyDestroy: destroy dummy interface
+ * intf_Close: destroy dummy interface
*****************************************************************************/
-void intf_DummyDestroy( intf_thread_t *p_intf )
+static void intf_Close( intf_thread_t *p_intf )
{
- /* Close input thread, if any (blocking) */
- if( p_intf->p_input )
- {
- input_DestroyThread( p_intf->p_input, NULL );
- }
-
- /* Close video output thread, if any (blocking) */
- if( p_intf->p_vout )
- {
- vout_DestroyThread( p_intf->p_vout, NULL );
- }
-
/* Destroy structure */
free( p_intf->p_sys );
}
/*****************************************************************************
- * intf_DummyManage: event loop
+ * intf_Run: main loop
*****************************************************************************/
-void intf_DummyManage( intf_thread_t *p_intf )
+static void intf_Run( intf_thread_t *p_intf )
{
- ;
+ while( !p_intf->b_die )
+ {
+ /* Manage core vlc functions through the callback */
+ p_intf->pf_manage( p_intf );
+
+ /* Wait a bit */
+ msleep( INTF_IDLE_SLEEP );
+ }
}
/*****************************************************************************
* vout_dummy.c: Dummy video output display method for testing purposes
*****************************************************************************
- * Copyright (C) 2000 VideoLAN
+ * Copyright (C) 2000, 2001 VideoLAN
*
- * Authors:
+ * Authors: Samuel Hocevar <sam@zoy.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
#include "common.h"
#include "threads.h"
#include "mtime.h"
-#include "plugins.h"
+#include "tests.h"
+#include "modules.h"
#include "video.h"
#include "video_output.h"
#include "intf_msg.h"
-#define WIDTH 16
-#define HEIGHT 16
-#define BITS_PER_PLANE 16
-#define BYTES_PER_PIXEL 2
+#define DUMMY_WIDTH 16
+#define DUMMY_HEIGHT 16
+#define DUMMY_BITS_PER_PLANE 16
+#define DUMMY_BYTES_PER_PIXEL 2
/*****************************************************************************
* vout_sys_t: dummy video output method descriptor
/*****************************************************************************
* Local prototypes
*****************************************************************************/
-static int DummyOpenDisplay ( vout_thread_t *p_vout );
-static void DummyCloseDisplay ( vout_thread_t *p_vout );
+static int vout_Probe ( probedata_t *p_data );
+static int vout_Create ( struct vout_thread_s * );
+static int vout_Init ( struct vout_thread_s * );
+static void vout_End ( struct vout_thread_s * );
+static void vout_Destroy ( struct vout_thread_s * );
+static int vout_Manage ( struct vout_thread_s * );
+static void vout_Display ( struct vout_thread_s * );
/*****************************************************************************
- * vout_DummyCreate: allocates dummy video thread output method
+ * Functions exported as capabilities. They are declared as static so that
+ * we don't pollute the namespace too much.
+ *****************************************************************************/
+void vout_getfunctions( function_list_t * p_function_list )
+{
+ p_function_list->pf_probe = vout_Probe;
+ p_function_list->functions.vout.pf_create = vout_Create;
+ p_function_list->functions.vout.pf_init = vout_Init;
+ p_function_list->functions.vout.pf_end = vout_End;
+ p_function_list->functions.vout.pf_destroy = vout_Destroy;
+ p_function_list->functions.vout.pf_manage = vout_Manage;
+ p_function_list->functions.vout.pf_display = vout_Display;
+ p_function_list->functions.vout.pf_setpalette = NULL;
+}
+
+/*****************************************************************************
+ * intf_Probe: return a score
+ *****************************************************************************/
+static int vout_Probe( probedata_t *p_data )
+{
+ if( TestMethod( VOUT_METHOD_VAR, "dummy" ) )
+ {
+ return( 999 );
+ }
+
+ return( 1 );
+}
+
+/*****************************************************************************
+ * vout_Create: allocates dummy video thread output method
*****************************************************************************
* This function allocates and initializes a dummy vout method.
*****************************************************************************/
-int vout_DummyCreate( vout_thread_t *p_vout, char *psz_display,
- int i_root_window, void *p_data )
+static int vout_Create( vout_thread_t *p_vout )
{
/* Allocate structure */
p_vout->p_sys = malloc( sizeof( vout_sys_t ) );
return( 1 );
}
- /* Open and initialize device */
- if( DummyOpenDisplay( p_vout ) )
+ p_vout->i_width = DUMMY_WIDTH;
+ p_vout->i_height = DUMMY_HEIGHT;
+ p_vout->i_screen_depth = DUMMY_BITS_PER_PLANE;
+ p_vout->i_bytes_per_pixel = DUMMY_BYTES_PER_PIXEL;
+ p_vout->i_bytes_per_line = DUMMY_WIDTH * DUMMY_BYTES_PER_PIXEL;
+
+ p_vout->p_sys->i_page_size = DUMMY_WIDTH * DUMMY_HEIGHT
+ * DUMMY_BYTES_PER_PIXEL;
+
+ /* Map two framebuffers a the very beginning of the fb */
+ p_vout->p_sys->p_video = malloc( 2 * p_vout->p_sys->i_page_size );
+ if( p_vout->p_sys->p_video == NULL )
{
- intf_ErrMsg("vout error: can't open display");
+ intf_ErrMsg( "vout error: can't map video memory (%s)",
+ strerror(errno) );
free( p_vout->p_sys );
return( 1 );
}
+ /* Set and initialize buffers */
+ vout_SetBuffers( p_vout, p_vout->p_sys->p_video,
+ p_vout->p_sys->p_video + p_vout->p_sys->i_page_size );
+
return( 0 );
}
/*****************************************************************************
- * vout_DummyInit: initialize dummy video thread output method
+ * vout_Init: initialize dummy video thread output method
*****************************************************************************/
-int vout_DummyInit( vout_thread_t *p_vout )
+static int vout_Init( vout_thread_t *p_vout )
{
return( 0 );
}
/*****************************************************************************
- * vout_DummyEnd: terminate dummy video thread output method
+ * vout_End: terminate dummy video thread output method
*****************************************************************************/
-void vout_DummyEnd( vout_thread_t *p_vout )
+static void vout_End( vout_thread_t *p_vout )
{
;
}
/*****************************************************************************
- * vout_DummyDestroy: destroy dummy video thread output method
+ * vout_Destroy: destroy dummy video thread output method
*****************************************************************************
* Terminate an output method created by DummyCreateOutputMethod
*****************************************************************************/
-void vout_DummyDestroy( vout_thread_t *p_vout )
+static void vout_Destroy( vout_thread_t *p_vout )
{
- DummyCloseDisplay( p_vout );
+ free( p_vout->p_sys->p_video );
free( p_vout->p_sys );
}
/*****************************************************************************
- * vout_DummyManage: handle dummy events
+ * vout_Manage: handle dummy events
*****************************************************************************
* This function should be called regularly by video output thread. It manages
* console events. It returns a non null value on error.
*****************************************************************************/
-int vout_DummyManage( vout_thread_t *p_vout )
+static int vout_Manage( vout_thread_t *p_vout )
{
return( 0 );
}
/*****************************************************************************
- * vout_DummyDisplay: displays previously rendered output
+ * vout_Display: displays previously rendered output
*****************************************************************************
* This function send the currently rendered image to dummy image, waits until
* it is displayed and switch the two rendering buffers, preparing next frame.
*****************************************************************************/
-void vout_DummyDisplay( vout_thread_t *p_vout )
+static void vout_Display( vout_thread_t *p_vout )
{
;
}
-/* following functions are local */
-
-/*****************************************************************************
- * DummyOpenDisplay: open and initialize dummy device
- *****************************************************************************
- * XXX?? The framebuffer mode is only provided as a fast and efficient way to
- * display video, providing the card is configured and the mode ok. It is
- * not portable, and is not supposed to work with many cards. Use at your
- * own risk !
- *****************************************************************************/
-
-static int DummyOpenDisplay( vout_thread_t *p_vout )
-{
- p_vout->i_width = WIDTH;
- p_vout->i_height = HEIGHT;
- p_vout->i_screen_depth = BITS_PER_PLANE;
- p_vout->i_bytes_per_pixel = BYTES_PER_PIXEL;
- p_vout->i_bytes_per_line = WIDTH * BYTES_PER_PIXEL;
-
- p_vout->p_sys->i_page_size = WIDTH * HEIGHT * BYTES_PER_PIXEL;
-
- /* Map two framebuffers a the very beginning of the fb */
- p_vout->p_sys->p_video = malloc( p_vout->p_sys->i_page_size * 2 );
- if( (int)p_vout->p_sys->p_video == -1 )
- {
- intf_ErrMsg("vout error: can't map video memory (%s)", strerror(errno) );
- return( 1 );
- }
-
- /* Set and initialize buffers */
- vout_SetBuffers( p_vout, p_vout->p_sys->p_video,
- p_vout->p_sys->p_video + p_vout->p_sys->i_page_size );
- return( 0 );
-}
-
-/*****************************************************************************
- * DummyCloseDisplay: close and reset dummy device
- *****************************************************************************
- * Returns all resources allocated by DummyOpenDisplay and restore the original
- * state of the device.
- *****************************************************************************/
-static void DummyCloseDisplay( vout_thread_t *p_vout )
-{
- free( p_vout->p_sys->p_video );
-}
-
}
}
+
+gboolean
+on_hscale_button_release_event (GtkWidget *widget,
+ GdkEventButton *event,
+ gpointer user_data)
+{
+ intf_thread_t *p_intf = GetIntf( GTK_WIDGET(widget), "intf_window" );
+
+ GtkAdjustment *p_adj = gtk_range_get_adjustment( GTK_RANGE(widget) );
+ off_t i_seek = (p_adj->value * p_intf->p_input->stream.i_size) / 100;
+
+ vlc_mutex_lock( &p_intf->p_sys->change_lock );
+
+ p_intf->p_sys->b_scale_isfree = 1;
+ if( p_intf->p_input != NULL )
+ {
+ input_Seek( p_intf->p_input, i_seek );
+ }
+
+ vlc_mutex_unlock( &p_intf->p_sys->change_lock );
+
+ return FALSE;
+}
+
+
+gboolean
+on_hscale_button_press_event (GtkWidget *widget,
+ GdkEventButton *event,
+ gpointer user_data)
+{
+ intf_thread_t *p_intf = GetIntf( GTK_WIDGET(widget), "intf_window" );
+
+ vlc_mutex_lock( &p_intf->p_sys->change_lock );
+ p_intf->p_sys->b_scale_isfree = 0;
+ vlc_mutex_unlock( &p_intf->p_sys->change_lock );
+
+ return FALSE;
+}
+
+
void
on_toolbar_fast_clicked (GtkButton *button,
gpointer user_data);
+
+gboolean
+on_hscale_button_release_event (GtkWidget *widget,
+ GdkEventButton *event,
+ gpointer user_data);
+
+gboolean
+on_hscale_button_release_event (GtkWidget *widget,
+ GdkEventButton *event,
+ gpointer user_data);
+
+gboolean
+on_hscale_button_press_event (GtkWidget *widget,
+ GdkEventButton *event,
+ gpointer user_data);
{
{
GNOME_APP_UI_ITEM, N_("P_laylist"),
- NULL,
+ N_("Open the playlist window"),
(gpointer) on_menubar_playlist_activate, NULL, NULL,
GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_MENU_INDEX,
0, (GdkModifierType) 0, NULL
},
{
GNOME_APP_UI_ITEM, N_("_Plugins"),
- NULL,
+ N_("Open the plugin manager"),
(gpointer) on_menubar_plugins_activate, NULL, NULL,
GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_MENU_ATTACH,
0, (GdkModifierType) 0, NULL
create_intf_window (void)
{
GtkWidget *intf_window;
- GtkWidget *dock1;
+ GtkWidget *dockitem;
GtkWidget *toolbar;
GtkWidget *tmp_toolbar_icon;
GtkWidget *toolbar_open;
GtkWidget *toolbar_playlist;
GtkWidget *toolbar_prev;
GtkWidget *toolbar_next;
- GtkWidget *scrolledwindow1;
- GtkWidget *text1;
+ GtkWidget *vbox2;
+ GtkWidget *label6;
+ GtkWidget *label7;
+ GtkWidget *hscale;
GtkWidget *appbar;
intf_window = gnome_app_new ("VideoLAN Client", _("VideoLAN Client"));
gtk_object_set_data (GTK_OBJECT (intf_window), "intf_window", intf_window);
- dock1 = GNOME_APP (intf_window)->dock;
- gtk_widget_ref (dock1);
- gtk_object_set_data_full (GTK_OBJECT (intf_window), "dock1", dock1,
+ dockitem = GNOME_APP (intf_window)->dock;
+ gtk_widget_ref (dockitem);
+ gtk_object_set_data_full (GTK_OBJECT (intf_window), "dockitem", dockitem,
(GtkDestroyNotify) gtk_widget_unref);
- gtk_widget_show (dock1);
+ gtk_widget_show (dockitem);
gnome_app_create_menus (GNOME_APP (intf_window), menubar_uiinfo);
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (toolbar_next);
- scrolledwindow1 = gtk_scrolled_window_new (NULL, NULL);
- gtk_widget_ref (scrolledwindow1);
- gtk_object_set_data_full (GTK_OBJECT (intf_window), "scrolledwindow1", scrolledwindow1,
+ vbox2 = gtk_vbox_new (FALSE, 0);
+ gtk_widget_ref (vbox2);
+ gtk_object_set_data_full (GTK_OBJECT (intf_window), "vbox2", vbox2,
+ (GtkDestroyNotify) gtk_widget_unref);
+ gtk_widget_show (vbox2);
+ gnome_app_set_contents (GNOME_APP (intf_window), vbox2);
+
+ label6 = gtk_label_new (_("File name: wazaa.mpeg"));
+ gtk_widget_ref (label6);
+ gtk_object_set_data_full (GTK_OBJECT (intf_window), "label6", label6,
(GtkDestroyNotify) gtk_widget_unref);
- gtk_widget_show (scrolledwindow1);
- gnome_app_set_contents (GNOME_APP (intf_window), scrolledwindow1);
- gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolledwindow1), GTK_POLICY_NEVER, GTK_POLICY_ALWAYS);
+ gtk_widget_show (label6);
+ gtk_box_pack_start (GTK_BOX (vbox2), label6, FALSE, FALSE, 0);
+ gtk_label_set_justify (GTK_LABEL (label6), GTK_JUSTIFY_LEFT);
+ gtk_misc_set_alignment (GTK_MISC (label6), 0, 0.5);
+ gtk_misc_set_padding (GTK_MISC (label6), 5, 0);
- text1 = gtk_text_new (NULL, NULL);
- gtk_widget_ref (text1);
- gtk_object_set_data_full (GTK_OBJECT (intf_window), "text1", text1,
+ label7 = gtk_label_new (_("File type: awesome movie"));
+ gtk_widget_ref (label7);
+ gtk_object_set_data_full (GTK_OBJECT (intf_window), "label7", label7,
(GtkDestroyNotify) gtk_widget_unref);
- gtk_widget_show (text1);
- gtk_container_add (GTK_CONTAINER (scrolledwindow1), text1);
- gtk_text_insert (GTK_TEXT (text1), NULL, NULL, NULL,
- _("This is some random text. Nah. Eat at Sam's. Rent this place. Wazaaa."), 69);
+ gtk_widget_show (label7);
+ gtk_box_pack_start (GTK_BOX (vbox2), label7, FALSE, FALSE, 0);
+ gtk_label_set_justify (GTK_LABEL (label7), GTK_JUSTIFY_LEFT);
+ gtk_label_set_line_wrap (GTK_LABEL (label7), TRUE);
+ gtk_misc_set_alignment (GTK_MISC (label7), 0, 0.5);
+ gtk_misc_set_padding (GTK_MISC (label7), 5, 0);
+
+ hscale = gtk_hscale_new (GTK_ADJUSTMENT (gtk_adjustment_new (0, 0, 100, 1, 0, 0)));
+ gtk_widget_ref (hscale);
+ gtk_object_set_data_full (GTK_OBJECT (intf_window), "hscale", hscale,
+ (GtkDestroyNotify) gtk_widget_unref);
+ gtk_widget_show (hscale);
+ gtk_box_pack_start (GTK_BOX (vbox2), hscale, FALSE, FALSE, 0);
+ gtk_scale_set_value_pos (GTK_SCALE (hscale), GTK_POS_BOTTOM);
+ gtk_range_set_update_policy (GTK_RANGE (hscale), GTK_UPDATE_DELAYED);
appbar = gnome_appbar_new (TRUE, TRUE, GNOME_PREFERENCES_NEVER);
gtk_widget_ref (appbar);
gtk_signal_connect (GTK_OBJECT (toolbar_next), "clicked",
GTK_SIGNAL_FUNC (on_toolbar_next_clicked),
NULL);
+ gtk_signal_connect (GTK_OBJECT (hscale), "button_release_event",
+ GTK_SIGNAL_FUNC (on_hscale_button_release_event),
+ NULL);
+ gtk_signal_connect (GTK_OBJECT (hscale), "button_press_event",
+ GTK_SIGNAL_FUNC (on_hscale_button_press_event),
+ NULL);
return intf_window;
}
* gnome_sys.h: private Gnome interface description
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
- * $Id: gnome_sys.h,v 1.2 2001/02/12 00:20:37 sam Exp $
+ * $Id: gnome_sys.h,v 1.3 2001/02/13 04:29:46 sam Exp $
*
* Authors:
*
/* special actions */
vlc_mutex_t change_lock; /* the change lock */
- boolean_t b_activity_changed; /* vout activity toggled ? */
- boolean_t b_activity; /* vout activity */
-
boolean_t b_popup_changed; /* display menu ? */
-
boolean_t b_window_changed; /* window display toggled ? */
- boolean_t b_window; /* display window ? */
-
boolean_t b_playlist_changed; /* playlist display toggled ? */
- boolean_t b_playlist; /* display playlist ? */
+ boolean_t b_scale_isfree; /* user isn't dragging scale ? */
/* intf_Manage callback timeout */
int i_timeout;
* intf_gnome.c: Gnome interface
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
- * $Id: intf_gnome.c,v 1.9 2001/02/12 00:20:37 sam Exp $
+ * $Id: intf_gnome.c,v 1.10 2001/02/13 04:29:46 sam Exp $
*
* Authors:
*
}
/* Initialize Gnome thread */
- p_intf->p_sys->b_window = 1;
- p_intf->p_sys->b_playlist = 0;
-
p_intf->p_sys->b_popup_changed = 0;
p_intf->p_sys->b_window_changed = 0;
p_intf->p_sys->b_playlist_changed = 0;
+ p_intf->p_sys->b_scale_isfree = 1;
+
p_intf->p_sys->pf_gtk_callback = NULL;
p_intf->p_sys->pf_gdk_callback = NULL;
{
intf_thread_t *p_intf = (void *)p_data;
- /* if the "display popup" flag has changed */
+ vlc_mutex_lock( &p_intf->p_sys->change_lock );
+
+ /* If the "display popup" flag has changed */
if( p_intf->b_menu_change )
{
gnome_popup_menu_do_popup( p_intf->p_sys->p_popup,
p_intf->b_menu_change = 0;
}
+ /* Manage the slider */
+ if( p_intf->p_input != NULL && p_intf->p_sys->p_window != NULL
+ && p_intf->p_sys->b_scale_isfree )
+ {
+ GtkWidget *p_scale;
+ GtkAdjustment *p_adj;
+
+ p_scale = GTK_WIDGET( gtk_object_get_data( GTK_OBJECT(
+ p_intf->p_sys->p_window ), "hscale" ) );
+ p_adj = gtk_range_get_adjustment ( GTK_RANGE( p_scale ) );
+
+ /* Update the value */
+ p_adj->value = ( 100. * p_intf->p_input->stream.i_tell )
+ / p_intf->p_input->stream.i_size;
+
+ /* Gtv does it this way. Why not. */
+ gtk_range_set_adjustment ( GTK_RANGE( p_scale ), p_adj );
+ gtk_range_slider_update ( GTK_RANGE( p_scale ) );
+ gtk_range_clear_background ( GTK_RANGE( p_scale ) );
+ gtk_range_draw_background ( GTK_RANGE( p_scale ) );
+ }
+
/* Manage core vlc functions through the callback */
p_intf->pf_manage( p_intf );
if( p_intf->b_die )
{
+ /* Make sure we won't be called again */
+ gtk_timeout_remove( p_intf->p_sys->i_timeout );
+
+ vlc_mutex_unlock( &p_intf->p_sys->change_lock );
+
/* prepare to die, young man */
gtk_main_quit();
return( FALSE );
}
+ vlc_mutex_unlock( &p_intf->p_sys->change_lock );
+
return( TRUE );
}
<widget>
<class>GnomeDock</class>
<child_name>GnomeApp:dock</child_name>
- <name>dock1</name>
+ <name>dockitem</name>
<allow_floating>True</allow_floating>
<child>
<padding>0</padding>
<widget>
<class>GtkPixmapMenuItem</class>
<name>menubar_playlist</name>
+ <tooltip>Open the playlist window</tooltip>
<signal>
<name>activate</name>
<handler>on_menubar_playlist_activate</handler>
<widget>
<class>GtkPixmapMenuItem</class>
<name>menubar_plugins</name>
+ <tooltip>Open the plugin manager</tooltip>
<signal>
<name>activate</name>
<handler>on_menubar_plugins_activate</handler>
</widget>
<widget>
- <class>GtkScrolledWindow</class>
+ <class>GtkVBox</class>
<child_name>GnomeDock:contents</child_name>
- <name>scrolledwindow1</name>
- <hscrollbar_policy>GTK_POLICY_NEVER</hscrollbar_policy>
- <vscrollbar_policy>GTK_POLICY_ALWAYS</vscrollbar_policy>
- <hupdate_policy>GTK_UPDATE_CONTINUOUS</hupdate_policy>
- <vupdate_policy>GTK_UPDATE_CONTINUOUS</vupdate_policy>
+ <name>vbox2</name>
+ <homogeneous>False</homogeneous>
+ <spacing>0</spacing>
+
+ <widget>
+ <class>GtkLabel</class>
+ <name>label6</name>
+ <label>File name: wazaa.mpeg</label>
+ <justify>GTK_JUSTIFY_LEFT</justify>
+ <wrap>False</wrap>
+ <xalign>0</xalign>
+ <yalign>0.5</yalign>
+ <xpad>5</xpad>
+ <ypad>0</ypad>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ </child>
+ </widget>
+
+ <widget>
+ <class>GtkLabel</class>
+ <name>label7</name>
+ <label>File type: awesome movie</label>
+ <justify>GTK_JUSTIFY_LEFT</justify>
+ <wrap>True</wrap>
+ <xalign>0</xalign>
+ <yalign>0.5</yalign>
+ <xpad>5</xpad>
+ <ypad>0</ypad>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ </child>
+ </widget>
<widget>
- <class>GtkText</class>
- <name>text1</name>
+ <class>GtkHScale</class>
+ <name>hscale</name>
<can_focus>True</can_focus>
- <editable>False</editable>
- <text>This is some random text. Nah. Eat at Sam's. Rent this place. Wazaaa.</text>
+ <signal>
+ <name>button_release_event</name>
+ <handler>on_hscale_button_release_event</handler>
+ <last_modification_time>Tue, 13 Feb 2001 01:15:41 GMT</last_modification_time>
+ </signal>
+ <signal>
+ <name>button_press_event</name>
+ <handler>on_hscale_button_press_event</handler>
+ <last_modification_time>Tue, 13 Feb 2001 02:55:04 GMT</last_modification_time>
+ </signal>
+ <draw_value>True</draw_value>
+ <value_pos>GTK_POS_BOTTOM</value_pos>
+ <digits>1</digits>
+ <policy>GTK_UPDATE_DELAYED</policy>
+ <value>0</value>
+ <lower>0</lower>
+ <upper>100</upper>
+ <step>1</step>
+ <page>0</page>
+ <page_size>0</page_size>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ </child>
</widget>
</widget>
</widget>
{
SDL_AudioSpec desired, obtained;
+ return 0;
/* Start AudioSDL */
if( SDL_Init(SDL_INIT_AUDIO | SDL_INIT_NOPARACHUTE) != 0 )
{
desired.freq = 11025; /* frequency */
desired.format = AUDIO_U8; /* unsigned 8 bits */
desired.channels = 2; /* mono */
- desired.callback = aout_SDLCallback; /* no callback function yet */
+ desired.callback = NULL; /* no callback function yet */
desired.userdata = NULL; /* null parm for callback */
desired.samples = 4096;
/*****************************************************************************
* sdl.c : SDL plugin for vlc
*****************************************************************************
- * Copyright (C) 2000 VideoLAN
+ * Copyright (C) 2000, 2001 VideoLAN
*
- * Authors:
- * . Initial plugin code by Samuel Hocevar <sam@via.ecp.fr>
- * . Modified to use the SDL by Pierre Baillet <octplane@via.ecp.fr>
+ * Authors: Samuel Hocevar <sam@zoy.org>
+ * Pierre Baillet <oct@zoy.org>
+ * Arnaud de Bossoreille de Ribou <bozo@via.ecp.fr>
*
* 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
*****************************************************************************
* Copyright (C) 1998, 1999, 2000 VideoLAN
*
- * Authors:
+ * Authors: Samuel Hocevar <sam@zoy.org>
+ * Pierre Baillet <oct@zoy.org>
+ * Arnaud de Bossoreille de Ribou <bozo@via.ecp.fr>
*
* 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
#include "tests.h"
#include "modules.h"
-/* FIXME: it's up to the _interface_ to do this, not the video output */
-#include "stream_control.h"
-#include "input_ext-intf.h"
-
#include "video.h"
#include "video_output.h"
boolean_t b_overlay;
boolean_t b_cursor;
boolean_t b_reopen_display;
- Uint8 * p_sdl_buf[2]; /* Buffer information */
-} vout_sys_t;
+ Uint8 * p_sdl_buf[2]; /* Buffer information */
+} vout_sys_t;
/*****************************************************************************
* Local prototypes.
}
/*****************************************************************************
- * intf_Probe: probe the video driver and return a score
+ * vout_Probe: probe the video driver and return a score
*****************************************************************************
* This function tries to initialize SDL and returns a score to the
* plugin manager so that it can select the best plugin.
/* FIXME: get rid of this ASAP, it's FUCKING UGLY */
{ intf_thread_t * p_intf = p_main->p_intf;
- /* p_intf->p_intf_getKey = intf_getKey; */
intf_AssignKey(p_intf, SDLK_q, INTF_KEY_QUIT, 0);
intf_AssignKey(p_intf, SDLK_ESCAPE, INTF_KEY_QUIT, 0);
/* intf_AssignKey(p_intf,3,'Q'); */
SDL_Event event; /* SDL event */
Uint8 i_key;
- /* FIXME: do this nicely */
- input_thread_t * p_input = p_main->p_intf->p_input;
-
/* Process events */
while( SDL_PollEvent(&event) )
{
case SDLK_c: /* toggle grayscale */
p_vout->b_grayscale = ! p_vout->b_grayscale;
- p_vout->i_changes |= VOUT_GRAYSCALE_CHANGE;
+ p_vout->i_changes |= VOUT_GRAYSCALE_CHANGE;
break;
case SDLK_i: /* toggle info */
p_vout->b_info = ! p_vout->b_info;
- p_vout->i_changes |= VOUT_INFO_CHANGE;
+ p_vout->i_changes |= VOUT_INFO_CHANGE;
break;
- case SDLK_s: /* toggle scaling */
+ case SDLK_s: /* toggle scaling */
p_vout->b_scale = ! p_vout->b_scale;
- p_vout->i_changes |= VOUT_SCALE_CHANGE;
+ p_vout->i_changes |= VOUT_SCALE_CHANGE;
break;
- case SDLK_SPACE: /* toggle interface */
+ case SDLK_SPACE: /* toggle interface */
p_vout->b_interface = ! p_vout->b_interface;
- p_vout->i_changes |= VOUT_INTF_CHANGE;
- break;
-
- /* FIXME : this is temporary */
- case SDLK_p:
- if( p_input != NULL )
- {
- input_SetRate( p_input, INPUT_RATE_PAUSE );
- }
- break;
-
- case SDLK_a:
- if( p_input != NULL )
- {
- input_SetRate( p_input, INPUT_RATE_FASTER );
- }
- break;
-
- case SDLK_z:
- if( p_input != NULL )
- {
- input_SetRate( p_input, INPUT_RATE_SLOWER );
- }
- break;
-
- case SDLK_j:
- if( p_input != NULL )
- {
- /* Jump forwards */
- input_Seek( p_input, p_input->stream.i_tell
- + p_input->stream.i_size / 20 );
- /* gabuzomeu */
- }
- break;
-
- case SDLK_b:
- if( p_input != NULL )
- {
- /* Jump backwards */
- input_Seek( p_input, p_input->stream.i_tell
- - p_input->stream.i_size / 20 );
- }
+ p_vout->i_changes |= VOUT_INTF_CHANGE;
break;
default:
*****************************************************************************/
void input_Seek( input_thread_t * p_input, off_t i_position )
{
- intf_Msg( "input: seeking position %lld/%lld", i_position,
- p_input->stream.i_size );
vlc_mutex_lock( &p_input->stream.stream_lock );
p_input->stream.i_seek = i_position;
+
+ intf_Msg( "input: seeking position %lld/%lld", i_position,
+ p_input->stream.i_size );
+
vlc_cond_signal( &p_input->stream.stream_wait );
vlc_mutex_unlock( &p_input->stream.stream_lock );
}
#define OPT_AOUT 180
#define OPT_VOUT 181
-#define OPT_MOTION 182
-#define OPT_IDCT 183
-#define OPT_YUV 184
-#define OPT_INPUT 185
+#define OPT_INTF 182
+#define OPT_MOTION 183
+#define OPT_IDCT 184
+#define OPT_YUV 185
+#define OPT_INPUT 186
#define OPT_SYNCHRO 190
#define OPT_WARNING 191
{ "longhelp", 0, 0, 'H' },
{ "version", 0, 0, 'v' },
+ /* Interface options */
+ { "intf", 1, 0, OPT_INTF },
+ { "warning", 1, 0, OPT_WARNING },
+
/* Audio options */
{ "noaudio", 0, 0, OPT_NOAUDIO },
{ "aout", 1, 0, OPT_AOUT },
/* Synchro options */
{ "synchro", 1, 0, OPT_SYNCHRO },
-
- /* Interface messages */
- { "warning", 1, 0, OPT_WARNING },
{ 0, 0, 0, 0 }
};
return( -1 );
break;
+ /* Interface warning messages level */
+ case OPT_INTF: /* --intf */
+ main_PutPszVariable( INTF_METHOD_VAR, optarg );
+ break;
+ case OPT_WARNING: /* --warning */
+ main_PutIntVariable( INTF_WARNING_VAR, atoi(optarg) );
+ break;
+
/* Audio options */
case OPT_NOAUDIO: /* --noaudio */
p_main->b_audio = 0;
case OPT_COLOR: /* --color */
main_PutIntVariable( VOUT_GRAYSCALE_VAR, 0 );
break;
- case OPT_FULLSCREEN: /* --fullscreen */
+ case OPT_FULLSCREEN: /* --fullscreen */
main_PutIntVariable( VOUT_FULLSCREEN_VAR, 1 );
break;
- case OPT_OVERLAY: /* --overlay */
+ case OPT_OVERLAY: /* --overlay */
main_PutIntVariable( VOUT_OVERLAY_VAR, 1 );
break;
- case OPT_MOTION: /* --motion */
+ case OPT_MOTION: /* --motion */
main_PutPszVariable( MOTION_METHOD_VAR, optarg );
break;
- case OPT_IDCT: /* --idct */
+ case OPT_IDCT: /* --idct */
main_PutPszVariable( IDCT_METHOD_VAR, optarg );
break;
case OPT_YUV: /* --yuv */
break;
/* Input options */
- case OPT_INPUT: /* --input */
+ case OPT_INPUT: /* --input */
main_PutPszVariable( INPUT_METHOD_VAR, optarg );
break;
case OPT_VLANS: /* --vlans */
case OPT_SYNCHRO:
main_PutPszVariable( VPAR_SYNCHRO_VAR, optarg );
break;
-
- /* Interface warning messages level */
- case OPT_WARNING: /* --warning */
- main_PutIntVariable( INTF_WARNING_VAR, atoi(optarg) );
- break;
/* Internal error: unknown option */
case '?':
/* Options */
intf_MsgImm( "\nOptions:"
+ "\n --intf <module> \tinterface method"
+ "\n --warning <level> \tdisplay warning messages"
+ "\n"
"\n --noaudio \tdisable audio"
"\n --aout <module> \taudio output method"
"\n --stereo, --mono \tstereo/mono audio"
"\n --port <port> \tvideo server port"
"\n --broadcast \tlisten to a broadcast"
"\n"
- "\n --warning <level> \tdisplay warning messages"
- "\n"
"\n -h, --help \tprint help and exit"
"\n -H, --longhelp \tprint long help and exit"
"\n -v, --version \toutput version information and exit" );
/* Interface parameters */
intf_MsgImm( "\nInterface parameters:\n"
- "\n " INTF_INIT_SCRIPT_VAR "=<filename> \tinitialization script"
+ "\n " INTF_METHOD_VAR "=<method name> \tinterface method"
+ "\n " INTF_INIT_SCRIPT_VAR "=<filename> \tinitialization script"
"\n " INTF_CHANNELS_VAR "=<filename> \tchannels list"
"\n " INTF_WARNING_VAR "=<level> \twarning level" );
if(i & 0xffff0000)
{
- i_log += 16;
+ i_log += 16;
}
if(i & 0xff00ff00)
{
- i_log += 8;
+ i_log += 8;
}
if(i & 0xf0f0f0f0)
{
- i_log += 4;
+ i_log += 4;
}
if(i & 0xcccccccc)
{
- i_log += 2;
+ i_log += 2;
}
if(i & 0xaaaaaaaa)
{
- i_log += 1;
+ i_log += 1;
}
if (i != ((u32)1 << i_log))
if( p_vout->yuv.p_module == NULL )
{
intf_ErrMsg( "vout error: no suitable yuv module" );
- return( -1 );
+ return( -1 );
}
#define yuv_functions p_vout->yuv.p_module->p_functions->yuv.functions.yuv