]> git.sesse.net Git - vlc/blobdiff - modules/gui/wxwindows/wxwindows.cpp
* include/vlc/vlc.h: added a b_play parameter to the libvlc VLC_AddIntf() prototype.
[vlc] / modules / gui / wxwindows / wxwindows.cpp
index 2b8808c5ef7995da461f51823a50e73e3fcd07ad..0454ef54810eff4e30a9e2462d22e0a1b7c9a538 100644 (file)
@@ -2,7 +2,7 @@
  * 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 */
@@ -80,6 +80,13 @@ private:
 /*****************************************************************************
  * Module descriptor
  *****************************************************************************/
+#define EMBED_TEXT N_("Embed video in interface")
+#define EMBED_LONGTEXT N_("Embed the video window inside the interface. The "\
+    "default behaviour is to have video windows separate from the interface.")
+#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;
@@ -94,6 +101,11 @@ vlc_module_begin();
     add_shortcut( "wx" );
     set_program( "wxvlc" );
 
+    add_bool( "wxwin-embed", 0, 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 );
@@ -132,9 +144,13 @@ static int Open( vlc_object_t *p_this )
     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;
 }
 
@@ -285,14 +301,27 @@ bool Instance::OnInit()
 
     /* 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->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;
 }