* wxwindows.cpp : wxWindows plugin for vlc
*****************************************************************************
* Copyright (C) 2000-2004 VideoLAN
- * $Id: wxwindows.cpp,v 1.38 2004/01/25 03:29:02 hartman Exp $
+ * $Id$
*
* Authors: Gildas Bazin <gbazin@netcourrier.com>
*
#include <string.h> /* strerror() */
#include <stdio.h>
+#include <vlc/vlc.h>
+#include <vlc/intf.h>
+
#ifdef HAVE_LOCALE_H
# include <locale.h>
#endif
-#include <vlc/vlc.h>
-#include <vlc/intf.h>
-
#include "wxwindows.h"
/* Temporary hack */
-#if defined(WIN32) && defined(_WX_INIT_H_)
+#if defined(WIN32) && defined(_WX_INIT_H_)
+#if (wxMAJOR_VERSION <= 2) && (wxMINOR_VERSION <= 5) && (wxRELEASE_NUMBER < 3)
/* Hack to detect wxWindows 2.5 which has a different wxEntry() prototype */
extern int wxEntry( HINSTANCE hInstance, HINSTANCE hPrevInstance = NULL,
char *pCmdLine = NULL, int nCmdShow = SW_NORMAL );
#endif
+#endif
+
#ifdef SYS_DARWIN
int wxEntry( int argc, char *argv[] , bool enterLoop = TRUE );
#endif
/*****************************************************************************
* Module descriptor
*****************************************************************************/
+#define EMBED_TEXT N_("Embed video in interface")
+#define EMBED_LONGTEXT N_("Embed the video inside the interface instead " \
+ "of having it in a separate window.")
+#define BOOKMARKS_TEXT N_("Show bookmarks dialog")
+#define BOOKMARKS_LONGTEXT N_("Show bookmarks dialog when the interface " \
+ "starts.")
+
vlc_module_begin();
#ifdef WIN32
int i_score = 150;
#else
int i_score = getenv( "DISPLAY" ) == NULL ? 15 : 150;
#endif
+ set_shortname( (char*) _("wxWindows"));
set_description( (char *) _("wxWindows interface module") );
+ set_category( CAT_INTERFACE );
+ set_subcategory( SUBCAT_INTERFACE_GENERAL );
set_capability( "interface", i_score );
set_callbacks( Open, Close );
add_shortcut( "wxwindows" );
add_shortcut( "wx" );
set_program( "wxvlc" );
+ add_bool( "wxwin-embed", 1, NULL,
+ EMBED_TEXT, EMBED_LONGTEXT, VLC_FALSE );
+ add_bool( "wxwin-bookmarks", 0, NULL,
+ BOOKMARKS_TEXT, BOOKMARKS_LONGTEXT, VLC_FALSE );
+
add_submodule();
set_description( _("wxWindows dialogs provider") );
set_capability( "dialogs provider", 50 );
msg_Err( p_intf, "out of memory" );
return VLC_ENOMEM;
}
+ memset( p_intf->p_sys, 0, sizeof( intf_sys_t ) );
p_intf->pf_run = Run;
p_intf->p_sys->i_slider_pos = p_intf->p_sys->i_slider_oldpos = 0;
p_intf->p_sys->p_popup_menu = NULL;
+ p_intf->p_sys->p_video_window = NULL;
p_intf->pf_show_dialog = NULL;
+ /* We support play on start */
+ p_intf->b_play = VLC_TRUE;
+
return VLC_SUCCESS;
}
{
intf_thread_t *p_intf = (intf_thread_t *)p_this;
- if( p_intf->p_sys->p_input )
- {
- vlc_object_release( p_intf->p_sys->p_input );
- }
+ vlc_mutex_lock( &p_intf->object_lock );
+ p_intf->b_dead = VLC_TRUE;
+ vlc_mutex_unlock( &p_intf->object_lock );
if( p_intf->pf_show_dialog )
{
/* Creates the dialogs provider */
p_intf->p_sys->p_wxwindow =
- new DialogsProvider( p_intf, p_intf->pf_show_dialog ?
- NULL : p_intf->p_sys->p_wxwindow );
+ CreateDialogsProvider( p_intf, p_intf->pf_show_dialog ?
+ NULL : p_intf->p_sys->p_wxwindow );
p_intf->p_sys->pf_show_dialog = ShowDialog;
/* OK, initialization is over */
vlc_thread_ready( p_intf );
+ /* Check if we need to start playing */
+ if( !p_intf->pf_show_dialog && p_intf->b_play )
+ {
+ playlist_t *p_playlist =
+ (playlist_t *)vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
+ FIND_ANYWHERE );
+ if( p_playlist )
+ {
+ playlist_Play( p_playlist );
+ vlc_object_release( p_playlist );
+ }
+ }
+
/* Return TRUE to tell program to continue (FALSE would terminate) */
return TRUE;
}