]> git.sesse.net Git - vlc/commitdiff
* modules/gui/wxwindows/*: new subtitles file dialog box.
authorGildas Bazin <gbazin@videolan.org>
Tue, 13 May 2003 22:33:33 +0000 (22:33 +0000)
committerGildas Bazin <gbazin@videolan.org>
Tue, 13 May 2003 22:33:33 +0000 (22:33 +0000)
* modules/demux/util/sub.c: fixed a few description strings.
* Makefile.am: small cosmetic change to package-win32 target.

Makefile.am
modules/demux/util/sub.c
modules/gui/wxwindows/Modules.am
modules/gui/wxwindows/open.cpp
modules/gui/wxwindows/wxwindows.h

index 810bde604f7a8df34d287585ea8ada100121200e..6b668d9d6f19dee89726b2b92e643fa0b3d2648f 100644 (file)
@@ -516,8 +516,8 @@ package-win32:
 # Create installation script
        cp install-win32 tmp/nsi
 # Copy relevant files
-       cp vlc.exe tmp/ 
-       $(STRIP) tmp/vlc.exe
+       cp vlc$(EXEEXT) tmp/ 
+       $(STRIP) tmp/vlc$(EXEEXT)
        cp INSTALL.win32 tmp/INSTALL.txt ; unix2dos tmp/INSTALL.txt
        for file in AUTHORS MAINTAINERS THANKS NEWS COPYING README ; \
                        do cp $$file tmp/$${file}.txt ; \
index 1731c2b0efc06f0e16cf5f23e2deacb2520edb9a..6897e68acb63b95c4e225966950a81fe174df31e 100644 (file)
@@ -2,7 +2,7 @@
  * sub.c
  *****************************************************************************
  * Copyright (C) 1999-2001 VideoLAN
- * $Id: sub.c,v 1.14 2003/05/11 14:33:32 sigmunau Exp $
+ * $Id: sub.c,v 1.15 2003/05/13 22:33:33 gbazin Exp $
  *
  * Authors: Laurent Aimar <fenrir@via.ecp.fr>
  *
@@ -59,28 +59,29 @@ static char *ppsz_sub_type[] = { "microdvd", "subrip", "ssa1", "ssa2-4", "vplaye
 /*****************************************************************************
  * Module descriptor
  *****************************************************************************/
-
+#define SUB_DELAY_LONGTEXT \
+    "Delay subtitles (in 1/10s)"
 #define SUB_FPS_LONGTEXT \
     "Override frames per second. " \
-    "It will work only with MicroDVD"
+    "It will only work with MicroDVD subtitles."
 #define SUB_TYPE_LONGTEXT \
-    "One from \"microdvd\", \"subrip\", \"ssa1\", \"ssa2-4\", \"vplayer\" \"sami\"" \
-    "(nothing for autodetection, it should always work)"
+    "One from \"microdvd\", \"subrip\", \"ssa1\", \"ssa2-4\", \"vplayer\" " \
+    "\"sami\" (nothing for autodetection, it should always work)."
 
 vlc_module_begin();
-    set_description( _("text subtitle demux") );
+    set_description( _("Text subtitles demux") );
     set_capability( "subtitle demux", 12 );
-    add_category_hint( "subtitle", NULL, VLC_TRUE );
+    add_category_hint( "Subtitles", NULL, VLC_TRUE );
         add_file( "sub-file", NULL, NULL,
-                  "subtitle file name", "subtitle file name", VLC_TRUE );
+                  "Subtitles file name", "Subtitles file name", VLC_TRUE );
         add_float( "sub-fps", 0.0, NULL,
-                   "override frames per second",
+                   "Frames per second",
                    SUB_FPS_LONGTEXT, VLC_TRUE );
         add_integer( "sub-delay", 0, NULL,
-                     "delay subtitles (in 1/10s)",
-                     "delay subtitles (in 1/10s)", VLC_TRUE );
+                     "Delay subtitles (in 1/10s)",
+                     SUB_DELAY_LONGTEXT, VLC_TRUE );
         add_string_from_list( "sub-type", NULL, ppsz_sub_type, NULL,
-                              "subtitle type",
+                              "subtitles type",
                               SUB_TYPE_LONGTEXT, VLC_TRUE );
     set_callbacks( Open, NULL );
 vlc_module_end();
index 2a4b17b51a0592fda58cbd455c15f193fd7b6c6a..726581ea312a3dc49738ff4d10bb132982578bb2 100644 (file)
@@ -10,6 +10,7 @@ SOURCES_wxwindows = \
        modules/gui/wxwindows/preferences.cpp \
        modules/gui/wxwindows/timer.cpp \
        modules/gui/wxwindows/fileinfo.cpp \
+       modules/gui/wxwindows/subtitles.cpp \
        $(NULL)
 
 EXTRA_DIST += \
index a1a7bfdf6bf19b617dc7bdc5248b45c4b4198322..48a8188102c707489603561915046f801e7fb544 100644 (file)
@@ -2,7 +2,7 @@
  * open.cpp : wxWindows plugin for vlc
  *****************************************************************************
  * Copyright (C) 2000-2001 VideoLAN
- * $Id: open.cpp,v 1.20 2003/05/12 21:55:01 gbazin Exp $
+ * $Id: open.cpp,v 1.21 2003/05/13 22:33:33 gbazin Exp $
  *
  * Authors: Gildas Bazin <gbazin@netcourrier.com>
  *
@@ -82,6 +82,9 @@ enum
     NetPort1_Event, NetPort2_Event, NetPort3_Event,
     NetAddr1_Event, NetAddr2_Event, NetAddr3_Event,
 
+    SubsFileEnable_Event,
+    SubsFileSettings_Event,
+
     SoutEnable_Event,
     SoutSettings_Event,
 
@@ -124,6 +127,10 @@ BEGIN_EVENT_TABLE(OpenDialog, wxDialog)
     EVT_TEXT(NetAddr2_Event, OpenDialog::OnNetPanelChange)
     EVT_TEXT(NetAddr3_Event, OpenDialog::OnNetPanelChange)
 
+    /* Events generated by the subtitle file buttons */
+    EVT_CHECKBOX(SubsFileEnable_Event, OpenDialog::OnSubsFileEnable)
+    EVT_BUTTON(SubsFileSettings_Event, OpenDialog::OnSubsFileSettings)
+
     /* Events generated by the stream output buttons */
     EVT_CHECKBOX(SoutEnable_Event, OpenDialog::OnSoutEnable)
     EVT_BUTTON(SoutSettings_Event, OpenDialog::OnSoutSettings)
@@ -177,6 +184,29 @@ OpenDialog::OpenDialog( intf_thread_t *_p_intf, wxWindow *_p_parent,
         wxU(_("Alternatively, you can build an MRL using one of the "
               "following predefined targets:")) );
 
+    /* Create Subtitles File checkox */
+    wxFlexGridSizer *subsfile_sizer = new wxFlexGridSizer( 2, 1, 20 );
+    subsfile_checkbox = new wxCheckBox( panel, SubsFileEnable_Event,
+                                        wxU(_("Subtitles file")) );
+    subsfile_checkbox->SetToolTip( wxU(_("Load an additional subtitles file. "
+                                   "Currently only works with AVI files.")) );
+    subsfile_sizer->Add( subsfile_checkbox, 0,
+                         wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL );
+    subsfile_button = new wxButton( panel, SubsFileSettings_Event,
+                                    wxU(_("Settings...")) );
+    subsfile_button->Disable();
+
+    char *psz_subsfile = config_GetPsz( p_intf, "sub-file" );
+    if( psz_subsfile && *psz_subsfile )
+    {
+        subsfile_checkbox->SetValue(TRUE);
+        subsfile_button->Enable();
+    }
+    if( psz_subsfile ) free( psz_subsfile );
+
+    subsfile_sizer->Add( subsfile_button, 1,
+                         wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL );
+
     /* Create Stream Output checkox */
     wxFlexGridSizer *sout_sizer = new wxFlexGridSizer( 2, 1, 20 );
     sout_checkbox = new wxCheckBox( panel, SoutEnable_Event,
@@ -220,10 +250,10 @@ OpenDialog::OpenDialog( intf_thread_t *_p_intf, wxWindow *_p_parent,
     demuxdump_textctrl->Disable();
     demuxdump_button->Disable();
     demuxdump_sizer->Add( demuxdump_checkbox, 0,
-                          wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL, 10 );
+                          wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL );
     demuxdump_sizer->Add( demuxdump_button, 0,
-                          wxALL | wxALIGN_CENTER_VERTICAL, 10 );
-    demuxdump_sizer->Add( demuxdump_textctrl, 1, wxALL, 10 );
+                          wxLEFT | wxRIGHT | wxALIGN_CENTER_VERTICAL, 10 );
+    demuxdump_sizer->Add( demuxdump_textctrl, 1, wxRIGHT, 10 );
 
     /* Separation */
     wxStaticLine *static_line = new wxStaticLine( panel, wxID_OK );
@@ -271,6 +301,7 @@ OpenDialog::OpenDialog( intf_thread_t *_p_intf, wxWindow *_p_parent,
     panel_sizer->Add( mrl_sizer_sizer, 0, wxEXPAND, 5 );
     panel_sizer->Add( label, 0, wxEXPAND | wxALL, 5 );
     panel_sizer->Add( notebook_sizer, 1, wxEXPAND | wxALL, 5 );
+    panel_sizer->Add( subsfile_sizer, 0, wxALIGN_LEFT | wxALL, 5 );
     panel_sizer->Add( sout_sizer, 0, wxALIGN_LEFT | wxALL, 5 );
     panel_sizer->Add( demuxdump_sizer, 0, wxEXPAND | wxALIGN_LEFT | wxALL, 5 );
     panel_sizer->Add( static_line, 0, wxEXPAND | wxALL, 5 );
@@ -635,6 +666,41 @@ void OpenDialog::OnNetTypeChange( wxCommandEvent& event )
     UpdateMRL( NET_ACCESS );
 }
 
+/*****************************************************************************
+ * Subtitles file event methods.
+ *****************************************************************************/
+void OpenDialog::OnSubsFileEnable( wxCommandEvent& event )
+{
+    subsfile_button->Enable( event.GetInt() != 0 );
+    if( !event.GetInt() )
+    {
+        config_PutPsz( p_intf, "sub-file", "" );
+    }
+    else
+    {
+        demuxdump_checkbox->SetValue( 0 );
+        wxCommandEvent event = wxCommandEvent( wxEVT_NULL );
+        event.SetInt( 0 );
+        OnDemuxDumpEnable( event );
+    }
+}
+
+void OpenDialog::OnSubsFileSettings( wxCommandEvent& WXUNUSED(event) )
+{
+    /* Show/hide the open dialog */
+    SubsFileDialog dialog( p_intf, p_parent );
+
+    if( dialog.ShowModal() == wxID_OK )
+    {
+        config_PutPsz( p_intf, "sub-file",
+                       (const char *)dialog.file_combo->GetValue().mb_str() );
+        config_PutInt( p_intf, "sub-delay",
+                       dialog.delay_spinctrl->GetValue() );
+        config_PutFloat( p_intf, "sub-fps",
+                         dialog.fps_spinctrl->GetValue() );
+    }
+}
+
 /*****************************************************************************
  * Stream output event methods.
  *****************************************************************************/
@@ -676,9 +742,11 @@ void OpenDialog::OnDemuxDumpEnable( wxCommandEvent& event )
     if( event.GetInt() )
     {
         sout_checkbox->SetValue( 0 );
+        subsfile_checkbox->SetValue( 0 );
         wxCommandEvent event = wxCommandEvent( wxEVT_NULL );
         event.SetInt( 0 );
         OnSoutEnable( event );
+        OnSubsFileEnable( event );
     }
 
     UpdateMRL( i_current_access_method );
index 857dfa0dc33dd05a3ede05e8b623d4b43ba763b6..7b6f791ffe4df4a829d637ef0252e0e179330db6 100644 (file)
@@ -2,7 +2,7 @@
  * wxwindows.h: private wxWindows interface description
  *****************************************************************************
  * Copyright (C) 1999, 2000 VideoLAN
- * $Id: wxwindows.h,v 1.23 2003/05/12 17:33:19 gbazin Exp $
+ * $Id: wxwindows.h,v 1.24 2003/05/13 22:33:33 gbazin Exp $
  *
  * Authors: Gildas Bazin <gbazin@netcourrier.com>
  *
@@ -225,6 +225,10 @@ private:
     void OnNetPanelChange( wxCommandEvent& event );
     void OnNetTypeChange( wxCommandEvent& event );
 
+    /* Event handlers for the stream output */
+    void OnSubsFileEnable( wxCommandEvent& event );
+    void OnSubsFileSettings( wxCommandEvent& WXUNUSED(event) );
+
     /* Event handlers for the stream output */
     void OnSoutEnable( wxCommandEvent& event );
     void OnSoutSettings( wxCommandEvent& WXUNUSED(event) );
@@ -259,6 +263,10 @@ private:
     wxSpinCtrl *net_ports[4];
     wxTextCtrl *net_addrs[4];
 
+    /* Controls for the subtitles file */
+    wxButton *subsfile_button;
+    wxCheckBox *subsfile_checkbox;
+
     /* Controls for the stream output */
     wxButton *sout_button;
     wxCheckBox *sout_checkbox;
@@ -334,6 +342,30 @@ private:
 
 };
 
+/* Subtitles File Dialog */
+class SubsFileDialog: public wxDialog
+{
+public:
+    /* Constructor */
+    SubsFileDialog( intf_thread_t *p_intf, wxWindow *p_parent );
+    virtual ~SubsFileDialog();
+
+    wxComboBox *file_combo;
+    wxSpinCtrl *delay_spinctrl;
+    wxSpinCtrl *fps_spinctrl;
+
+private:
+    /* Event handlers (these functions should _not_ be virtual) */
+    void OnOk( wxCommandEvent& event );
+    void OnCancel( wxCommandEvent& event );
+    void OnFileBrowse( wxCommandEvent& event );
+
+    DECLARE_EVENT_TABLE();
+
+    intf_thread_t *p_intf;
+    wxWindow *p_parent;
+};
+
 /* Preferences Dialog */
 class PrefsTreeCtrl;
 class PrefsDialog: public wxFrame