Commit 030c921f authored by Gildas Bazin's avatar Gildas Bazin

* modules/gui/wxwindows/*: added subtitles options to the stream output dialog...

* modules/gui/wxwindows/*: added subtitles options to the stream output dialog + add open directory menu to interface.
parent bad6c28c
...@@ -120,6 +120,7 @@ enum ...@@ -120,6 +120,7 @@ enum
OpenFileSimple_Event, OpenFileSimple_Event,
OpenAdv_Event, OpenAdv_Event,
OpenFile_Event, OpenFile_Event,
OpenDir_Event,
OpenDisc_Event, OpenDisc_Event,
OpenNet_Event, OpenNet_Event,
OpenCapture_Event, OpenCapture_Event,
...@@ -185,6 +186,7 @@ BEGIN_EVENT_TABLE(Interface, wxFrame) ...@@ -185,6 +186,7 @@ BEGIN_EVENT_TABLE(Interface, wxFrame)
EVT_MENU(OpenFileSimple_Event, Interface::OnShowDialog) EVT_MENU(OpenFileSimple_Event, Interface::OnShowDialog)
EVT_MENU(OpenAdv_Event, Interface::OnShowDialog) EVT_MENU(OpenAdv_Event, Interface::OnShowDialog)
EVT_MENU(OpenFile_Event, Interface::OnShowDialog) EVT_MENU(OpenFile_Event, Interface::OnShowDialog)
EVT_MENU(OpenDir_Event, Interface::OnShowDialog)
EVT_MENU(OpenDisc_Event, Interface::OnShowDialog) EVT_MENU(OpenDisc_Event, Interface::OnShowDialog)
EVT_MENU(OpenNet_Event, Interface::OnShowDialog) EVT_MENU(OpenNet_Event, Interface::OnShowDialog)
EVT_MENU(OpenCapture_Event, Interface::OnShowDialog) EVT_MENU(OpenCapture_Event, Interface::OnShowDialog)
...@@ -379,6 +381,7 @@ void Interface::CreateOurMenuBar() ...@@ -379,6 +381,7 @@ void Interface::CreateOurMenuBar()
file_menu->AppendSeparator(); file_menu->AppendSeparator();
file_menu->Append( OpenFile_Event, wxU(_("Open &File...\tCtrl-F")) ); file_menu->Append( OpenFile_Event, wxU(_("Open &File...\tCtrl-F")) );
file_menu->Append( OpenDir_Event, wxU(_("Open D&irectory...\tCtrl-I")) );
file_menu->Append( OpenDisc_Event, wxU(_("Open &Disc...\tCtrl-D")) ); file_menu->Append( OpenDisc_Event, wxU(_("Open &Disc...\tCtrl-D")) );
file_menu->Append( OpenNet_Event, file_menu->Append( OpenNet_Event,
wxU(_("Open &Network Stream...\tCtrl-N")) ); wxU(_("Open &Network Stream...\tCtrl-N")) );
...@@ -748,6 +751,9 @@ void Interface::OnShowDialog( wxCommandEvent& event ) ...@@ -748,6 +751,9 @@ void Interface::OnShowDialog( wxCommandEvent& event )
case OpenFile_Event: case OpenFile_Event:
i_id = INTF_DIALOG_FILE; i_id = INTF_DIALOG_FILE;
break; break;
case OpenDir_Event:
i_id = INTF_DIALOG_DIRECTORY;
break;
case OpenDisc_Event: case OpenDisc_Event:
i_id = INTF_DIALOG_DISC; i_id = INTF_DIALOG_DISC;
break; break;
......
...@@ -447,11 +447,7 @@ OpenDialog::OpenDialog( intf_thread_t *_p_intf, wxWindow *_p_parent, ...@@ -447,11 +447,7 @@ OpenDialog::OpenDialog( intf_thread_t *_p_intf, wxWindow *_p_parent,
common_opt_sizer->Add( caching_checkbox, 0, common_opt_sizer->Add( caching_checkbox, 0,
wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL ); wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL );
caching_value = new wxSpinCtrl( panel, CachingChange_Event ); caching_value = new wxSpinCtrl( panel, CachingChange_Event );
#ifdef WIN32 /* WIN32 uses 16 bit integer */
caching_value->SetRange( 0, 32767 );
#else
caching_value->SetRange( 0, 1000000 ); caching_value->SetRange( 0, 1000000 );
#endif
caching_value->Disable(); caching_value->Disable();
common_opt_sizer->Add( caching_value, 0, common_opt_sizer->Add( caching_value, 0,
wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL ); wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL );
......
...@@ -71,6 +71,8 @@ enum ...@@ -71,6 +71,8 @@ enum
VideoTranscScale_Event, VideoTranscScale_Event,
AudioTranscEnable_Event, AudioTranscCodec_Event, AudioTranscBitrate_Event, AudioTranscEnable_Event, AudioTranscCodec_Event, AudioTranscBitrate_Event,
AudioTranscChans_Event, AudioTranscChans_Event,
SubtitlesTranscEnable_Event, SubtitlesTranscCodec_Event,
SubtitlesOverlayEnable_Event,
SAPMisc_Event, SLPMisc_Event, AnnounceGroup_Event, AnnounceAddr_Event, SAPMisc_Event, SLPMisc_Event, AnnounceGroup_Event, AnnounceAddr_Event,
SoutAll_Event SoutAll_Event
...@@ -124,6 +126,8 @@ BEGIN_EVENT_TABLE(SoutDialog, wxDialog) ...@@ -124,6 +126,8 @@ BEGIN_EVENT_TABLE(SoutDialog, wxDialog)
/* Events generated by the transcoding panel */ /* Events generated by the transcoding panel */
EVT_CHECKBOX(VideoTranscEnable_Event, SoutDialog::OnTranscodingEnable) EVT_CHECKBOX(VideoTranscEnable_Event, SoutDialog::OnTranscodingEnable)
EVT_CHECKBOX(AudioTranscEnable_Event, SoutDialog::OnTranscodingEnable) EVT_CHECKBOX(AudioTranscEnable_Event, SoutDialog::OnTranscodingEnable)
EVT_CHECKBOX(SubtitlesTranscEnable_Event, SoutDialog::OnTranscodingEnable)
EVT_CHECKBOX(SubtitlesOverlayEnable_Event, SoutDialog::OnTranscodingEnable)
EVT_COMBOBOX(VideoTranscCodec_Event, SoutDialog::OnTranscodingChange) EVT_COMBOBOX(VideoTranscCodec_Event, SoutDialog::OnTranscodingChange)
EVT_TEXT(VideoTranscCodec_Event, SoutDialog::OnTranscodingChange) EVT_TEXT(VideoTranscCodec_Event, SoutDialog::OnTranscodingChange)
EVT_COMBOBOX(AudioTranscCodec_Event, SoutDialog::OnTranscodingChange) EVT_COMBOBOX(AudioTranscCodec_Event, SoutDialog::OnTranscodingChange)
...@@ -136,6 +140,8 @@ BEGIN_EVENT_TABLE(SoutDialog, wxDialog) ...@@ -136,6 +140,8 @@ BEGIN_EVENT_TABLE(SoutDialog, wxDialog)
EVT_TEXT(VideoTranscScale_Event, SoutDialog::OnTranscodingChange) EVT_TEXT(VideoTranscScale_Event, SoutDialog::OnTranscodingChange)
EVT_COMBOBOX(AudioTranscChans_Event, SoutDialog::OnTranscodingChange) EVT_COMBOBOX(AudioTranscChans_Event, SoutDialog::OnTranscodingChange)
EVT_TEXT(AudioTranscChans_Event, SoutDialog::OnTranscodingChange) EVT_TEXT(AudioTranscChans_Event, SoutDialog::OnTranscodingChange)
EVT_COMBOBOX(SubtitlesTranscCodec_Event, SoutDialog::OnTranscodingChange)
EVT_TEXT(SubtitlesTranscCodec_Event, SoutDialog::OnTranscodingChange)
/* Events generated by the misc panel */ /* Events generated by the misc panel */
EVT_CHECKBOX(SAPMisc_Event, SoutDialog::OnSAPMiscChange) EVT_CHECKBOX(SAPMisc_Event, SoutDialog::OnSAPMiscChange)
...@@ -253,7 +259,9 @@ void SoutDialog::UpdateMRL() ...@@ -253,7 +259,9 @@ void SoutDialog::UpdateMRL()
/* Let's start with the transcode options */ /* Let's start with the transcode options */
wxString transcode; wxString transcode;
if( video_transc_checkbox->IsChecked() || if( video_transc_checkbox->IsChecked() ||
audio_transc_checkbox->IsChecked() ) audio_transc_checkbox->IsChecked() ||
subtitles_transc_checkbox->IsChecked() ||
subtitles_overlay_checkbox->IsChecked() )
{ {
transcode = wxT("transcode{"); transcode = wxT("transcode{");
if( video_transc_checkbox->IsChecked() ) if( video_transc_checkbox->IsChecked() )
...@@ -261,13 +269,27 @@ void SoutDialog::UpdateMRL() ...@@ -261,13 +269,27 @@ void SoutDialog::UpdateMRL()
transcode += wxT("vcodec=") + video_codec_combo->GetValue(); transcode += wxT("vcodec=") + video_codec_combo->GetValue();
transcode += wxT(",vb=") + video_bitrate_combo->GetValue(); transcode += wxT(",vb=") + video_bitrate_combo->GetValue();
transcode += wxT(",scale=") + video_scale_combo->GetValue(); transcode += wxT(",scale=") + video_scale_combo->GetValue();
if( audio_transc_checkbox->IsChecked() ) transcode += wxT(","); if( audio_transc_checkbox->IsChecked() ||
subtitles_transc_checkbox->IsChecked() ||
subtitles_overlay_checkbox->IsChecked() )
transcode += wxT(",");
} }
if( audio_transc_checkbox->IsChecked() ) if( audio_transc_checkbox->IsChecked() )
{ {
transcode += wxT("acodec=") + audio_codec_combo->GetValue(); transcode += wxT("acodec=") + audio_codec_combo->GetValue();
transcode += wxT(",ab=") + audio_bitrate_combo->GetValue(); transcode += wxT(",ab=") + audio_bitrate_combo->GetValue();
transcode += wxT(",channels=") + audio_channels_combo->GetValue(); transcode += wxT(",channels=") + audio_channels_combo->GetValue();
if( subtitles_transc_checkbox->IsChecked() ||
subtitles_overlay_checkbox->IsChecked() )
transcode += wxT(",");
}
if( subtitles_transc_checkbox->IsChecked() )
{
transcode += wxT("scodec=") + subtitles_codec_combo->GetValue();
}
if( subtitles_overlay_checkbox->IsChecked() )
{
transcode += wxT("soverlay");
} }
transcode += wxT("}"); transcode += wxT("}");
} }
...@@ -709,7 +731,11 @@ wxPanel *SoutDialog::TranscodingPanel( wxWindow* parent ) ...@@ -709,7 +731,11 @@ wxPanel *SoutDialog::TranscodingPanel( wxWindow* parent )
}; };
wxFlexGridSizer *video_sizer = new wxFlexGridSizer( 6, 1, 20 ); wxFlexGridSizer *video_sizer = new wxFlexGridSizer( 6, 1, 20 );
#if defined( __WXMSW__ )
wxFlexGridSizer *video_sub_sizer = new wxFlexGridSizer( 4, 5, 20 );
#else
wxFlexGridSizer *video_sub_sizer = new wxFlexGridSizer( 2, 5, 20 ); wxFlexGridSizer *video_sub_sizer = new wxFlexGridSizer( 2, 5, 20 );
#endif
video_transc_checkbox = video_transc_checkbox =
new wxCheckBox( panel, VideoTranscEnable_Event, wxU(_("Video codec"))); new wxCheckBox( panel, VideoTranscEnable_Event, wxU(_("Video codec")));
video_codec_combo = video_codec_combo =
...@@ -822,11 +848,40 @@ wxPanel *SoutDialog::TranscodingPanel( wxWindow* parent ) ...@@ -822,11 +848,40 @@ wxPanel *SoutDialog::TranscodingPanel( wxWindow* parent )
audio_sizer->Add( audio_sub_sizer, 1, audio_sizer->Add( audio_sub_sizer, 1,
wxEXPAND | wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL ); wxEXPAND | wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL );
/* Create subtitles transcoding checkox */
static const wxString wxscodecs_array[] =
{
wxT("dvbs")
};
wxFlexGridSizer *subtitles_sizer = new wxFlexGridSizer( 3, 1, 20 );
subtitles_transc_checkbox =
new wxCheckBox( panel, SubtitlesTranscEnable_Event,
wxU(_("Subtitles codec")));
subtitles_codec_combo =
new wxComboBox( panel, SubtitlesTranscCodec_Event, wxscodecs_array[0],
wxPoint(10,25), wxDefaultSize,
WXSIZEOF(wxscodecs_array),
wxscodecs_array, wxCB_READONLY );
subtitles_codec_combo->SetSelection(0);
subtitles_overlay_checkbox =
new wxCheckBox( panel, SubtitlesOverlayEnable_Event,
wxU(_("Subtitles overlay")));
subtitles_sizer->Add( subtitles_transc_checkbox, 0,
wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL );
subtitles_sizer->Add( subtitles_codec_combo, 1,
wxEXPAND | wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL );
subtitles_sizer->Add( subtitles_overlay_checkbox, 0,
wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL );
/* Stuff everything into the main panel */ /* Stuff everything into the main panel */
panel_sizer->Add( video_sizer, 0, panel_sizer->Add( video_sizer, 0,
wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL | wxALL, 5 ); wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL | wxALL, 5 );
panel_sizer->Add( audio_sizer, 0, panel_sizer->Add( audio_sizer, 0,
wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL | wxALL, 5 ); wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL | wxALL, 5 );
panel_sizer->Add( subtitles_sizer, 0,
wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL | wxALL, 5 );
panel->SetSizerAndFit( panel_sizer ); panel->SetSizerAndFit( panel_sizer );
...@@ -836,6 +891,8 @@ wxPanel *SoutDialog::TranscodingPanel( wxWindow* parent ) ...@@ -836,6 +891,8 @@ wxPanel *SoutDialog::TranscodingPanel( wxWindow* parent )
OnTranscodingEnable( event ); OnTranscodingEnable( event );
event.SetId( AudioTranscEnable_Event ); event.SetId( AudioTranscEnable_Event );
OnTranscodingEnable( event ); OnTranscodingEnable( event );
event.SetId( SubtitlesTranscEnable_Event );
OnTranscodingEnable( event );
return panel; return panel;
} }
...@@ -996,6 +1053,13 @@ void SoutDialog::OnTranscodingEnable( wxCommandEvent& event ) ...@@ -996,6 +1053,13 @@ void SoutDialog::OnTranscodingEnable( wxCommandEvent& event )
audio_bitrate_combo->Enable( event.GetInt() ); audio_bitrate_combo->Enable( event.GetInt() );
audio_channels_combo->Enable( event.GetInt() ); audio_channels_combo->Enable( event.GetInt() );
break; break;
case SubtitlesTranscEnable_Event:
subtitles_overlay_checkbox->Enable( !event.GetInt() );
subtitles_codec_combo->Enable( event.GetInt() );
break;
case SubtitlesOverlayEnable_Event:
subtitles_transc_checkbox->Enable( !event.GetInt() );
break;
} }
UpdateMRL(); UpdateMRL();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment