]> git.sesse.net Git - vlc/commitdiff
* modules/gui/wxwindows/*:
authorGildas Bazin <gbazin@videolan.org>
Sun, 11 Apr 2004 12:20:11 +0000 (12:20 +0000)
committerGildas Bazin <gbazin@videolan.org>
Sun, 11 Apr 2004 12:20:11 +0000 (12:20 +0000)
  + added a "Open Capture Device..." menu entry.
  + a bit of clean-up.

modules/gui/wxwindows/dialogs.cpp
modules/gui/wxwindows/interface.cpp
modules/gui/wxwindows/open.cpp
modules/gui/wxwindows/wxwindows.cpp
modules/gui/wxwindows/wxwindows.h

index 3217cd0797f2c84b532ca625edfe6d3b9d48018f..ba509bc970e9829cc8329db449d2a79f13fff8e6 100644 (file)
 /* include the icon graphic */
 #include "../../../share/vlc32x32.xpm"
 
+/* Dialogs Provider */
+class DialogsProvider: public wxFrame
+{
+public:
+    /* Constructor */
+    DialogsProvider( intf_thread_t *p_intf, wxWindow *p_parent );
+    virtual ~DialogsProvider();
+
+private:
+    void Open( int i_access_method, int i_arg );
+
+    /* Event handlers (these functions should _not_ be virtual) */
+    void OnExit( wxCommandEvent& event );
+    void OnPlaylist( wxCommandEvent& event );
+    void OnMessages( wxCommandEvent& event );
+    void OnFileInfo( wxCommandEvent& event );
+    void OnPreferences( wxCommandEvent& event );
+    void OnStreamWizardDialog( wxCommandEvent& event );
+    void OnWizardDialog( wxCommandEvent& event );
+    void OnBookmarks( wxCommandEvent& event );
+
+    void OnOpenFileGeneric( wxCommandEvent& event );
+    void OnOpenFileSimple( wxCommandEvent& event );
+    void OnOpenFile( wxCommandEvent& event );
+    void OnOpenDisc( wxCommandEvent& event );
+    void OnOpenNet( wxCommandEvent& event );
+    void OnOpenCapture( wxCommandEvent& event );
+    void OnOpenSat( wxCommandEvent& event );
+
+    void OnPopupMenu( wxCommandEvent& event );
+
+    void OnIdle( wxIdleEvent& event );
+
+    void OnExitThread( wxCommandEvent& event );
+
+    DECLARE_EVENT_TABLE();
+
+    intf_thread_t *p_intf;
+
+public:
+    /* Secondary windows */
+    OpenDialog          *p_open_dialog;
+    wxFileDialog        *p_file_dialog;
+    Playlist            *p_playlist_dialog;
+    Messages            *p_messages_dialog;
+    FileInfo            *p_fileinfo_dialog;
+    StreamDialog        *p_streamwizard_dialog;
+    WizardDialog        *p_wizard_dialog;
+    wxFrame             *p_prefs_dialog;
+    wxWindow            *p_bookmarks_dialog;
+    wxFileDialog        *p_file_generic_dialog;
+};
+
 DEFINE_LOCAL_EVENT_TYPE( wxEVT_DIALOG );
 
 BEGIN_EVENT_TABLE(DialogsProvider, wxFrame)
@@ -49,6 +102,8 @@ BEGIN_EVENT_TABLE(DialogsProvider, wxFrame)
     EVT_COMMAND(INTF_DIALOG_FILE, wxEVT_DIALOG, DialogsProvider::OnOpenFile)
     EVT_COMMAND(INTF_DIALOG_DISC, wxEVT_DIALOG, DialogsProvider::OnOpenDisc)
     EVT_COMMAND(INTF_DIALOG_NET, wxEVT_DIALOG, DialogsProvider::OnOpenNet)
+    EVT_COMMAND(INTF_DIALOG_CAPTURE, wxEVT_DIALOG,
+                DialogsProvider::OnOpenCapture)
     EVT_COMMAND(INTF_DIALOG_FILE_SIMPLE, wxEVT_DIALOG,
                 DialogsProvider::OnOpenFileSimple)
     EVT_COMMAND(INTF_DIALOG_FILE_GENERIC, wxEVT_DIALOG,
@@ -74,6 +129,11 @@ BEGIN_EVENT_TABLE(DialogsProvider, wxFrame)
                 DialogsProvider::OnExitThread)
 END_EVENT_TABLE()
 
+wxWindow *CreateDialogsProvider( intf_thread_t *p_intf, wxWindow *p_parent )
+{
+    return new DialogsProvider( p_intf, p_parent );
+}
+
 /*****************************************************************************
  * Constructor.
  *****************************************************************************/
@@ -355,6 +415,11 @@ void DialogsProvider::OnOpenNet( wxCommandEvent& event )
     Open( NET_ACCESS, event.GetInt() );
 }
 
+void DialogsProvider::OnOpenCapture( wxCommandEvent& event )
+{
+    Open( CAPTURE_ACCESS, event.GetInt() );
+}
+
 void DialogsProvider::Open( int i_access_method, int i_arg )
 {
     /* Show/hide the open dialog */
index 88ba18b82db102ddbae401f1e7a2af2e2a2cd28e..f457e206f51f76f41cbc45018faedb50e5a682a2 100644 (file)
@@ -113,6 +113,7 @@ enum
     OpenFile_Event,
     OpenDisc_Event,
     OpenNet_Event,
+    OpenCapture_Event,
     OpenSat_Event,
     OpenOther_Event,
     EjectDisc_Event,
@@ -183,6 +184,7 @@ BEGIN_EVENT_TABLE(Interface, wxFrame)
     EVT_MENU(OpenFile_Event, Interface::OnShowDialog)
     EVT_MENU(OpenDisc_Event, Interface::OnShowDialog)
     EVT_MENU(OpenNet_Event, Interface::OnShowDialog)
+    EVT_MENU(OpenCapture_Event, Interface::OnShowDialog)
     EVT_MENU(OpenSat_Event, Interface::OnShowDialog)
     EVT_MENU(StreamWizard_Event, Interface::OnShowDialog)
     EVT_MENU(Wizard_Event, Interface::OnShowDialog)
@@ -316,61 +318,32 @@ void Interface::OnControlEvent( wxCommandEvent& event )
  *****************************************************************************/
 void Interface::CreateOurMenuBar()
 {
-#define HELP_SIMPLE N_("Quick file open")
-#define HELP_ADV   N_("Advanced open")
-#define HELP_FILE  N_("Open a file")
-#define HELP_DISC  N_("Open Disc Media")
-#define HELP_NET   N_("Open a network stream")
-#define HELP_SAT   N_("Open a satellite stream")
-#define HELP_EJECT N_("Eject the DVD/CD")
-#define HELP_EXIT  N_("Exit this program")
-
-#define HELP_STREAMWIZARD N_("Open the streaming wizard")
-
-#define HELP_PLAYLIST   N_("Open the playlist")
-#define HELP_LOGS       N_("Show the program logs")
-#define HELP_FILEINFO   N_("Show information about the file being played")
-
-#define HELP_PREFS     N_("Go to the preferences menu")
-#define HELP_EXTENDED  N_("Shows the extended GUI")
-#define HELP_BOOKMARKS N_("Shows the bookmarks window")
-
-#define HELP_ABOUT N_("About this program")
-
     /* Create the "File" menu */
     wxMenu *file_menu = new wxMenu;
     file_menu->Append( OpenFileSimple_Event,
-                       wxU(_("Quick &Open File...\tCtrl-O")),
-                       wxU(_(HELP_SIMPLE)) );
+                       wxU(_("Quick &Open File...\tCtrl-O")) );
 
     file_menu->AppendSeparator();
-    file_menu->Append( OpenFile_Event, wxU(_("Open &File...\tCtrl-F")),
-                       wxU(_(HELP_FILE)));
-    file_menu->Append( OpenDisc_Event, wxU(_("Open &Disc...\tCtrl-D")),
-                       wxU(_(HELP_DISC)));
+    file_menu->Append( OpenFile_Event, wxU(_("Open &File...\tCtrl-F")) );
+    file_menu->Append( OpenDisc_Event, wxU(_("Open &Disc...\tCtrl-D")) );
     file_menu->Append( OpenNet_Event,
-                       wxU(_("Open &Network Stream...\tCtrl-N")),
-                       wxU(_(HELP_NET)));
+                       wxU(_("Open &Network Stream...\tCtrl-N")) );
+    file_menu->Append( OpenCapture_Event,
+                       wxU(_("Open &Capture Device...\tCtrl-C")) );
 
     file_menu->AppendSeparator();
     file_menu->Append( StreamWizard_Event,
-                       wxU(_("Streaming &Wizard...\tCtrl-W")),
-                       wxU(_(HELP_STREAMWIZARD)) );
-    file_menu->Append( Wizard_Event, wxU(_("New Wizard...")),
-                       wxU(_(HELP_STREAMWIZARD)) );
+                       wxU(_("Streaming &Wizard...\tCtrl-W")) );
+    file_menu->Append( Wizard_Event, wxU(_("New Wizard...")) );
     file_menu->AppendSeparator();
-    file_menu->Append( Exit_Event, wxU(_("E&xit\tCtrl-X")),
-                       wxU(_(HELP_EXIT)) );
+    file_menu->Append( Exit_Event, wxU(_("E&xit\tCtrl-X")) );
 
     /* Create the "View" menu */
     wxMenu *view_menu = new wxMenu;
-    view_menu->Append( Playlist_Event, wxU(_("&Playlist...\tCtrl-P")),
-                       wxU(_(HELP_PLAYLIST)) );
-    view_menu->Append( Logs_Event, wxU(_("&Messages...\tCtrl-M")),
-                       wxU(_(HELP_LOGS)) );
+    view_menu->Append( Playlist_Event, wxU(_("&Playlist...\tCtrl-P")) );
+    view_menu->Append( Logs_Event, wxU(_("&Messages...\tCtrl-M")) );
     view_menu->Append( FileInfo_Event,
-                       wxU(_("Stream and Media &info...\tCtrl-I")),
-                       wxU(_(HELP_FILEINFO)) );
+                       wxU(_("Stream and Media &info...\tCtrl-I")) );
 
     /* Create the "Auto-generated" menus */
     p_settings_menu = SettingsMenu( p_intf, this );
@@ -380,8 +353,7 @@ void Interface::CreateOurMenuBar()
 
     /* Create the "Help" menu */
     wxMenu *help_menu = new wxMenu;
-    help_menu->Append( About_Event, wxU(_("About VLC media player")),
-                       wxU(_(HELP_ABOUT)) );
+    help_menu->Append( About_Event, wxU(_("About VLC media player")) );
 
     /* Append the freshly created menus to the menu bar... */
     wxMenuBar *menubar = new wxMenuBar( wxMB_DOCKABLE );
@@ -439,7 +411,6 @@ void VLCVolCtrl::OnPaint( wxPaintEvent &evt )
 void Interface::CreateOurToolBar()
 {
 #define HELP_STOP N_("Stop")
-
 #define HELP_PLAY N_("Play")
 #define HELP_PAUSE N_("Pause")
 #define HELP_PLO N_("Playlist")
@@ -771,11 +742,10 @@ void Interface::OnMenuOpen(wxMenuEvent& event)
 
         /* Add static items */
         p_settings_menu->AppendCheckItem( Extended_Event,
-            wxU(_("&Extended GUI") ), wxU(_(HELP_EXTENDED)) );
+            wxU(_("&Extended GUI") ) );
         p_settings_menu->AppendCheckItem( Bookmarks_Event,
-            wxU(_("&Bookmarks...") ), wxU(_(HELP_BOOKMARKS)) );
-        p_settings_menu->Append( Prefs_Event, wxU(_("&Preferences...")),
-            wxU(_(HELP_PREFS)) );
+            wxU(_("&Bookmarks...") ) );
+        p_settings_menu->Append( Prefs_Event, wxU(_("&Preferences...")) );
     }
 
     else if( event.GetEventObject() == p_audio_menu )
@@ -860,6 +830,9 @@ void Interface::OnShowDialog( wxCommandEvent& event )
         case OpenNet_Event:
             i_id = INTF_DIALOG_NET;
             break;
+        case OpenCapture_Event:
+            i_id = INTF_DIALOG_CAPTURE;
+            break;
         case OpenSat_Event:
             i_id = INTF_DIALOG_SAT;
             break;
index 5189bbcd913592d9a204f44af8ad2ee12d952843..f9f34be738b85d31ad7950ba13afb70f866e699b 100644 (file)
@@ -313,7 +313,7 @@ OpenDialog::OpenDialog( intf_thread_t *_p_intf, wxWindow *_p_parent,
                        i_access_method == NET_ACCESS );
 #ifndef WIN32
     notebook->AddPage( V4LPanel( notebook ), wxU(_("Video for Linux")),
-                       i_access_method == V4L_ACCESS );
+                       i_access_method == CAPTURE_ACCESS );
 #endif
 
     module_t *p_module = config_FindModule( VLC_OBJECT(p_intf), "dshow" );
@@ -322,7 +322,8 @@ OpenDialog::OpenDialog( intf_thread_t *_p_intf, wxWindow *_p_parent,
         AutoBuiltPanel *autopanel =
             new AutoBuiltPanel( notebook, this, p_intf, p_module );
         input_tab_array.Add( autopanel );
-        notebook->AddPage( autopanel, wxU( p_module->psz_longname ) );
+        notebook->AddPage( autopanel, wxU( p_module->psz_longname ),
+                           i_access_method == CAPTURE_ACCESS );
     }
 
     /* Update Disc panel */
@@ -812,7 +813,7 @@ void OpenDialog::UpdateMRL( int i_access_method )
         break;
 
 #ifndef WIN32
-    case V4L_ACCESS:
+    case CAPTURE_ACCESS:
         mrltemp = ( video_type->GetSelection() == 0 ? wxT("v4l") :
                     video_type->GetSelection() == 1 ? wxT("v4l") :
                     video_type->GetSelection() == 2 ? wxT("pvr") :
@@ -1164,7 +1165,7 @@ void OpenDialog::OnNetTypeChange( wxCommandEvent& event )
  *****************************************************************************/
 void OpenDialog::OnV4LPanelChange( wxCommandEvent& WXUNUSED(event) )
 {
-    UpdateMRL( V4L_ACCESS );
+    UpdateMRL( CAPTURE_ACCESS );
 }
 
 void OpenDialog::OnV4LTypeChange( wxCommandEvent& WXUNUSED(event) )
@@ -1187,7 +1188,7 @@ void OpenDialog::OnV4LTypeChange( wxCommandEvent& WXUNUSED(event) )
             break;
     }
 
-    UpdateMRL( V4L_ACCESS );
+    UpdateMRL( CAPTURE_ACCESS );
 }
 
 void OpenDialog::OnV4LSettingsChange( wxCommandEvent& WXUNUSED(event) )
@@ -1201,7 +1202,7 @@ void OpenDialog::OnV4LSettingsChange( wxCommandEvent& WXUNUSED(event) )
         v4l_mrl = v4l_dialog->GetOptions();
     }
 
-    UpdateMRL( V4L_ACCESS );
+    UpdateMRL( CAPTURE_ACCESS );
 }
 #endif
 
index 467a4e8d544b59ddc2f3b298eb4b1f21dc93e25b..fc52d1c2c994ad523878dd03d1fddeb3703c47e5 100644 (file)
@@ -298,8 +298,8 @@ 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;
 
index a97d341421b98539b41650c12d91cb01866fa504..b0e9ea86e246b56c8f918854b0ac7d3f9e08d1e1 100644 (file)
@@ -92,6 +92,7 @@ DECLARE_LOCAL_EVENT_TYPE( wxEVT_INTF, 1 );
 #define MODE_AUTHOR 2
 #define MODE_TITLE 3
 
+class DialogsProvider;
 class PrefsTreeCtrl;
 class AutoBuiltPanel;
 class VideoWindow;
@@ -139,6 +140,7 @@ struct intf_sys_t
 wxArrayString SeparateEntries( wxString );
 wxWindow *VideoWindow( intf_thread_t *p_intf, wxWindow *p_parent );
 wxWindow *BookmarksDialog( intf_thread_t *p_intf, wxWindow *p_parent );
+wxWindow *CreateDialogsProvider( intf_thread_t *p_intf, wxWindow *p_parent );
 
 namespace wxvlc
 {
@@ -269,60 +271,6 @@ private:
     wxMenu *p_navig_menu;
 };
 
-/*class BookmarksDialog;
-*/
-/* Dialogs Provider */
-class DialogsProvider: public wxFrame
-{
-public:
-    /* Constructor */
-    DialogsProvider( intf_thread_t *p_intf, wxWindow *p_parent );
-    virtual ~DialogsProvider();
-
-private:
-    void Open( int i_access_method, int i_arg );
-
-    /* Event handlers (these functions should _not_ be virtual) */
-    void OnExit( wxCommandEvent& event );
-    void OnPlaylist( wxCommandEvent& event );
-    void OnMessages( wxCommandEvent& event );
-    void OnFileInfo( wxCommandEvent& event );
-    void OnPreferences( wxCommandEvent& event );
-    void OnStreamWizardDialog( wxCommandEvent& event );
-    void OnWizardDialog( wxCommandEvent& event );
-    void OnBookmarks( wxCommandEvent& event );
-
-    void OnOpenFileGeneric( wxCommandEvent& event );
-    void OnOpenFileSimple( wxCommandEvent& event );
-    void OnOpenFile( wxCommandEvent& event );
-    void OnOpenDisc( wxCommandEvent& event );
-    void OnOpenNet( wxCommandEvent& event );
-    void OnOpenSat( wxCommandEvent& event );
-
-    void OnPopupMenu( wxCommandEvent& event );
-
-    void OnIdle( wxIdleEvent& event );
-
-    void OnExitThread( wxCommandEvent& event );
-
-    DECLARE_EVENT_TABLE();
-
-    intf_thread_t *p_intf;
-
-public:
-    /* Secondary windows */
-    OpenDialog          *p_open_dialog;
-    wxFileDialog        *p_file_dialog;
-    Playlist            *p_playlist_dialog;
-    Messages            *p_messages_dialog;
-    FileInfo            *p_fileinfo_dialog;
-    StreamDialog        *p_streamwizard_dialog;
-    WizardDialog        *p_wizard_dialog;
-    wxFrame             *p_prefs_dialog;
-    wxWindow            *p_bookmarks_dialog;
-    wxFileDialog        *p_file_generic_dialog;
-};
-
 /* Open Dialog */
 WX_DEFINE_ARRAY(AutoBuiltPanel *, ArrayOfAutoBuiltPanel);
 class OpenDialog: public wxFrame
@@ -453,12 +401,11 @@ enum
     FILE_ACCESS = 0,
     DISC_ACCESS,
     NET_ACCESS,
-#ifndef WIN32
-    V4L_ACCESS,
-#endif
-    MAX_ACCESS,
-    FILE_SIMPLE_ACCESS
+
+    /* Auto-built panels */
+    CAPTURE_ACCESS
 };
+#define MAX_ACCESS CAPTURE_ACCESS
 
 /* V4L Dialog */
 class V4LDialog: public wxDialog