* 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>
*
/*****************************************************************************
* 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();
* 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>
*
NetPort1_Event, NetPort2_Event, NetPort3_Event,
NetAddr1_Event, NetAddr2_Event, NetAddr3_Event,
+ SubsFileEnable_Event,
+ SubsFileSettings_Event,
+
SoutEnable_Event,
SoutSettings_Event,
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)
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,
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 );
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 );
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.
*****************************************************************************/
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 );
* 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>
*
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) );
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;
};
+/* 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