#include "charset.h"
+//#undef HAVE_LIBCDIO // Disable-cruft
+
#ifdef HAVE_LIBCDIO
#include <cdio/cdio.h>
#include <cdio/cd_types.h>
MRL_Event,
FileBrowse_Event,
+ SubFileBrowse_Event,
FileName_Event,
+ SubFileName_Event,
DiscType_Event,
#ifdef HAVE_LIBCDIO
/* Events generated by the file panel */
EVT_TEXT(FileName_Event, OpenDialog::OnFilePanelChange)
EVT_BUTTON(FileBrowse_Event, OpenDialog::OnFileBrowse)
+ EVT_TEXT(SubFileName_Event, OpenDialog::OnSubFileChange)
+ EVT_BUTTON(SubFileBrowse_Event, OpenDialog::OnSubFileBrowse)
/* Events generated by the disc panel */
EVT_RADIOBOX(DiscType_Event, OpenDialog::OnDiscTypeChange)
END_EVENT_TABLE()
-#if 0
-/* Perhaps someday we'll figure out how to add media information to
- "Stream-and-Media info" when no input thread hasn't been initialized.
-*/
-extern void MediaInsertCDDA( intf_thread_t *_p_intf, CdIo_t *p_cdio,
- track_t i_last_track );
-#endif
/*****************************************************************************
* AutoBuiltPanel.
wxPanel *panel = new wxPanel( this, -1 );
panel->SetAutoLayout( TRUE );
- /* Create MRL combobox */
- wxBoxSizer *mrl_sizer_sizer = new wxBoxSizer( wxHORIZONTAL );
- wxStaticBox *mrl_box = new wxStaticBox( panel, -1,
- wxU(_("Media Resource Locator (MRL)")) );
- wxStaticBoxSizer *mrl_sizer = new wxStaticBoxSizer( mrl_box,
- wxHORIZONTAL );
- wxStaticText *mrl_label = new wxStaticText( panel, -1,
- wxU(_("Open:")) );
- mrl_combo = new wxComboBox( panel, MRL_Event, wxT(""),
- wxPoint(20,25), wxSize(120, -1) );
- mrl_combo->SetToolTip( wxU(_("You can use this field directly by typing "
- "the full MRL you want to open.\n""Alternatively, the field will be "
- "filled automatically when you use the controls below.")) );
-
- mrl_sizer->Add( mrl_label, 0, wxALL | wxALIGN_CENTER, 5 );
- mrl_sizer->Add( mrl_combo, 1, wxALL | wxALIGN_CENTER, 5 );
- mrl_sizer_sizer->Add( mrl_sizer, 1, wxEXPAND | wxALL, 5 );
+ /* Advanced options */
+ wxStaticBox *adv_box = new wxStaticBox( panel, -1,
+ wxU(_("Advanced options")) );
+ wxStaticBoxSizer *adv_sizer = new wxStaticBoxSizer( adv_box,
+ wxVERTICAL );
- /* Create Static Text */
- wxStaticText *label = new wxStaticText( panel, -1,
- wxU(_("Alternatively, you can build an MRL using one of the "
- "following predefined targets:")) );
wxFlexGridSizer *common_opt_sizer = new wxFlexGridSizer( 5, 1, 20 );
-
if( i_method == OPEN_NORMAL )
{
/* Create Stream Output checkox */
sout_checkbox = new wxCheckBox( panel, SoutEnable_Event,
- wxU(_("Stream output")) );
+ wxU(_("Stream/Save")) );
sout_checkbox->SetToolTip( wxU(_("Use VLC as a server of streams")) );
common_opt_sizer->Add( sout_checkbox, 0,
wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL );
common_opt_sizer->Add( caching_value, 0,
wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL );
+
+ wxBoxSizer *mrl_sizer = new wxBoxSizer( wxHORIZONTAL );
+ wxStaticText *mrl_label = new wxStaticText( panel, -1,
+ wxU(_("Customize:")) );
+ mrl_combo = new wxComboBox( panel, MRL_Event, wxT(""),
+ wxDefaultPosition, wxDefaultSize );
+ //Point(20,25), wxSize(120, -1) );
+ mrl_combo->SetToolTip( wxU(_("You can use this field directly by typing "
+ "the full MRL you want to open.\n""Alternatively, the field will be "
+ "filled automatically when you use the controls above.")) );
+
+ mrl_sizer->Add( mrl_label, 0, wxALL | wxALIGN_CENTER_VERTICAL, 5 );
+ mrl_sizer->Add( mrl_combo, 1, wxALL | wxEXPAND | wxALIGN_CENTER_VERTICAL,
+ 5 );
+
+ adv_sizer->Add( common_opt_sizer, 0, wxTOP | wxLEFT|wxRIGHT | wxEXPAND, 5 );
+ adv_sizer->Add( mrl_sizer, 0, wxBOTTOM | wxLEFT|wxRIGHT | wxEXPAND, 5 );
+
/* Separation */
wxStaticLine *static_line = new wxStaticLine( panel, wxID_OK );
button_sizer->Layout();
wxBoxSizer *main_sizer = new wxBoxSizer( wxVERTICAL );
wxBoxSizer *panel_sizer = new wxBoxSizer( wxVERTICAL );
- panel_sizer->Add( mrl_sizer_sizer, 0, wxEXPAND, 5 );
- panel_sizer->Add( label, 0, wxEXPAND | wxALL, 5 );
#if (!wxCHECK_VERSION(2,5,2))
panel_sizer->Add( notebook_sizer, 1, wxEXPAND | wxALL, 5 );
#else
panel_sizer->Add( notebook, 1, wxEXPAND | wxALL, 5 );
#endif
- panel_sizer->Add( common_opt_sizer, 0, wxALIGN_LEFT | wxALL, 5 );
+ panel_sizer->Add( adv_sizer, 0, wxEXPAND | wxALL, 5 );
panel_sizer->Add( static_line, 0, wxEXPAND | wxALL, 5 );
panel_sizer->Add( button_sizer, 0, wxALIGN_LEFT | wxALL, 5 );
panel_sizer->Layout();
/* Create browse file line */
wxBoxSizer *file_sizer = new wxBoxSizer( wxHORIZONTAL );
- file_combo = new wxComboBox( panel, FileName_Event, wxT(""),
- wxPoint(20,25), wxSize(200, -1) );
+ file_sizer->Add( new wxStaticText( panel, -1, wxU(_("Open:") ) ), 0,
+ wxALL | wxALIGN_CENTER_VERTICAL, 5 );
+
+ file_combo = new wxComboBox( panel, FileName_Event, wxT("") );
wxButton *browse_button = new wxButton( panel, FileBrowse_Event,
wxU(_("Browse...")) );
- file_sizer->Add( file_combo, 1, wxALL, 5 );
- file_sizer->Add( browse_button, 0, wxALL, 5 );
+ file_sizer->Add( file_combo, 1, wxALL | wxALIGN_CENTER_VERTICAL, 5 );
+ file_sizer->Add( browse_button, 0, wxALL | wxALIGN_CENTER_VERTICAL, 5 );
- /* Create Subtitles File checkox */
- wxFlexGridSizer *subsfile_sizer = new wxFlexGridSizer( 2, 1, 20 );
+ /* Create Subtitles File checkox - button */
+ wxFlexGridSizer *subtitles_sizer = new wxFlexGridSizer( 2, 1, 20 );
subsfile_checkbox = new wxCheckBox( panel, SubsFileEnable_Event,
- wxU(_("Subtitle options")) );
- subsfile_checkbox->SetToolTip( wxU(_("Force options for separate subtitle files.")) );
- subsfile_sizer->Add( subsfile_checkbox, 0,
- wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL );
+ wxU(_("Use a subtitles file")) );
+ subsfile_checkbox->SetToolTip( wxU(_("Use an external subtitles file.")) );
+ subtitles_sizer->Add( subsfile_checkbox, 0, wxALIGN_CENTER_VERTICAL |
+ wxALL, 5 );
subsfile_button = new wxButton( panel, SubsFileSettings_Event,
- wxU(_("Settings...")) );
+ wxU(_("Advanced Settings...")) );
subsfile_button->Disable();
+ subtitles_sizer->Add( subsfile_button, 1, wxALIGN_CENTER_VERTICAL |
+ wxALL, 5 );
+
+ /* Create subtitles file line */
+ wxBoxSizer *subfile_sizer = new wxBoxSizer( wxHORIZONTAL );
char *psz_subsfile = config_GetPsz( p_intf, "sub-file" );
if( psz_subsfile && *psz_subsfile )
subsfile_button->Enable();
subsfile_mrl.Add( wxString(wxT("sub-file=")) + wxL2U(psz_subsfile) );
}
+ if( !psz_subsfile ) psz_subsfile = strdup("");
+ subfile_sizer->Add( new wxStaticText( panel, -1, wxU(_("File:") ) ),
+ 0, wxALIGN_CENTER_VERTICAL | wxALL, 5 );
+ subfile_combo = new wxComboBox( panel, SubFileName_Event,
+ wxL2U( psz_subsfile ) );
if( psz_subsfile ) free( psz_subsfile );
+ subbrowse_button = new wxButton( panel, SubFileBrowse_Event,
+ wxU(_("Browse...")) );
+ subfile_sizer->Add( subfile_combo, 1, wxALL | wxALIGN_CENTER_VERTICAL, 5 );
+ subfile_sizer->Add( subbrowse_button, 0, wxALL |wxALIGN_CENTER_VERTICAL, 5 );
- subsfile_sizer->Add( subsfile_button, 1,
- wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL );
+ subfile_combo->Disable();
+ subbrowse_button->Disable();
+
+ psz_subsfile = config_GetPsz( p_intf, "sub-file" );
+ if( psz_subsfile && *psz_subsfile )
+ {
+ subfile_combo->Enable();
+ subbrowse_button->Enable();
+ }
sizer->Add( file_sizer, 0, wxEXPAND | wxALL, 5 );
- sizer->Add( subsfile_sizer, 0, wxEXPAND | wxALL, 5 );
+ sizer->Add( subtitles_sizer, 0, wxLEFT | wxRIGHT | wxTOP, 5 );
+ sizer->Add( subfile_sizer, 0, wxEXPAND | wxLEFT | wxRIGHT| wxBOTTOM, 5 );
panel->SetSizerAndFit( sizer );
return panel;
}
}
}
+void OpenDialog::OnSubFileBrowse( wxCommandEvent& WXUNUSED(event) )
+{
+ wxFileDialog dialog( this, wxU(_("Open subtitles file")),
+ wxT(""), wxT(""), wxT("*"), wxOPEN );
+
+ if( dialog.ShowModal() == wxID_OK )
+ {
+ subfile_combo->SetValue( dialog.GetPath() );
+ }
+ wxCommandEvent event; OnSubFileChange( event );
+}
+
+void OpenDialog::OnSubFileChange( wxCommandEvent& WXUNUSED(event) )
+{
+ if( subsfile_mrl.GetCount() != 0 )
+ {
+ subsfile_mrl.RemoveAt( 0 );
+ subsfile_mrl.Insert( wxString(wxT("sub-file=")) + subfile_combo->GetValue() , 0 );
+ }
+ else
+ {
+ subsfile_mrl.Add( wxString(wxT("sub-file=")) + subfile_combo->GetValue() );
+ }
+}
+
/*****************************************************************************
* Disc panel event methods.
*****************************************************************************/
void OpenDialog::OnSubsFileEnable( wxCommandEvent& event )
{
subsfile_button->Enable( event.GetInt() != 0 );
+ subbrowse_button->Enable( event.GetInt() != 0 );
+ subfile_combo->Enable( event.GetInt() != 0 );
}
void OpenDialog::OnSubsFileSettings( wxCommandEvent& WXUNUSED(event) )
if( subsfile_dialog && subsfile_dialog->ShowModal() == wxID_OK )
{
subsfile_mrl.Empty();
- subsfile_mrl.Add( wxString(wxT("sub-file=")) +
- subsfile_dialog->file_combo->GetValue() );
+ subsfile_mrl.Add( wxString(wxT("sub-file=")) + subfile_combo->GetValue() );
if( subsfile_dialog->encoding_combo )
{
subsfile_mrl.Add( wxString(wxT("subsdec-encoding=")) +