]> git.sesse.net Git - vlc/blob - modules/gui/wxwidgets/dialogs/streamout.cpp
contrib/makefile: add libmpcdec (Musepack) to win contribs
[vlc] / modules / gui / wxwidgets / dialogs / streamout.cpp
1 /*****************************************************************************
2  * streamout.cpp : wxWindows plugin for vlc
3  *****************************************************************************
4  * Copyright (C) 2000-2004 the VideoLAN team
5  * $Id$
6  *
7  * Authors: Gildas Bazin <gbazin@netcourrier.com>
8  *
9  * This program is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation; either version 2 of the License, or
12  * (at your option) any later version.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with this program; if not, write to the Free Software
21  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
22  *****************************************************************************/
23
24 /*****************************************************************************
25  * Preamble
26  *****************************************************************************/
27 #include "dialogs/streamout.hpp"
28
29 #include <wx/spinctrl.h>
30 #include <wx/combobox.h>
31 #include <wx/statline.h>
32
33 #include "streamdata.h"
34
35 #ifndef wxRB_SINGLE
36 #   define wxRB_SINGLE 0
37 #endif
38
39 /*****************************************************************************
40  * Event Table.
41  *****************************************************************************/
42
43 /* IDs for the controls and the menu commands */
44 enum
45 {
46     Notebook_Event = wxID_HIGHEST,
47     MRL_Event,
48
49     FileBrowse_Event,
50     FileName_Event,
51     FileDump_Event,
52
53     AccessType1_Event, AccessType2_Event, AccessType3_Event,
54     AccessType4_Event, AccessType5_Event, AccessType6_Event,
55     NetPort1_Event, NetPort2_Event, NetPort3_Event, NetPort4_Event,
56     NetAddr1_Event, NetAddr2_Event, NetAddr3_Event, NetAddr4_Event,
57
58     EncapsulationRadio1_Event, EncapsulationRadio2_Event,
59     EncapsulationRadio3_Event, EncapsulationRadio4_Event,
60     EncapsulationRadio5_Event, EncapsulationRadio6_Event,
61     EncapsulationRadio7_Event, EncapsulationRadio8_Event,
62     EncapsulationRadio9_Event, EncapsulationRadio10_Event,
63
64     VideoTranscEnable_Event, VideoTranscCodec_Event, VideoTranscBitrate_Event,
65     VideoTranscScale_Event,
66     AudioTranscEnable_Event, AudioTranscCodec_Event, AudioTranscBitrate_Event,
67     AudioTranscChans_Event,
68     SubtitlesTranscEnable_Event, SubtitlesTranscCodec_Event,
69     SubtitlesOverlayEnable_Event,
70
71     SAPMisc_Event, AnnounceGroup_Event, AnnounceAddr_Event,
72     SoutAll_Event
73 };
74
75 BEGIN_EVENT_TABLE(SoutDialog, wxDialog)
76     /* Button events */
77     EVT_BUTTON(wxID_OK, SoutDialog::OnOk)
78     EVT_BUTTON(wxID_CANCEL, SoutDialog::OnCancel)
79
80     /* Events generated by the access output panel */
81     EVT_CHECKBOX(AccessType1_Event, SoutDialog::OnAccessTypeChange)
82     EVT_CHECKBOX(AccessType2_Event, SoutDialog::OnAccessTypeChange)
83     EVT_CHECKBOX(AccessType3_Event, SoutDialog::OnAccessTypeChange)
84     EVT_CHECKBOX(AccessType4_Event, SoutDialog::OnAccessTypeChange)
85     EVT_CHECKBOX(AccessType5_Event, SoutDialog::OnAccessTypeChange)
86     EVT_CHECKBOX(AccessType6_Event, SoutDialog::OnAccessTypeChange)
87     EVT_TEXT(FileName_Event, SoutDialog::OnFileChange)
88     EVT_BUTTON(FileBrowse_Event, SoutDialog::OnFileBrowse)
89     EVT_CHECKBOX(FileDump_Event, SoutDialog::OnFileDump)
90
91     EVT_TEXT(NetPort1_Event, SoutDialog::OnNetChange)
92     EVT_TEXT(NetAddr1_Event, SoutDialog::OnNetChange)
93     EVT_TEXT(NetPort2_Event, SoutDialog::OnNetChange)
94     EVT_TEXT(NetAddr2_Event, SoutDialog::OnNetChange)
95     EVT_TEXT(NetPort3_Event, SoutDialog::OnNetChange)
96     EVT_TEXT(NetAddr3_Event, SoutDialog::OnNetChange)
97     EVT_TEXT(NetPort4_Event, SoutDialog::OnNetChange)
98     EVT_TEXT(NetAddr4_Event, SoutDialog::OnNetChange)
99
100     /* Events generated by the encapsulation panel */
101     EVT_RADIOBUTTON(EncapsulationRadio1_Event,
102                     SoutDialog::OnEncapsulationChange)
103     EVT_RADIOBUTTON(EncapsulationRadio2_Event,
104                     SoutDialog::OnEncapsulationChange)
105     EVT_RADIOBUTTON(EncapsulationRadio3_Event,
106                     SoutDialog::OnEncapsulationChange)
107     EVT_RADIOBUTTON(EncapsulationRadio4_Event,
108                     SoutDialog::OnEncapsulationChange)
109     EVT_RADIOBUTTON(EncapsulationRadio5_Event,
110                     SoutDialog::OnEncapsulationChange)
111     EVT_RADIOBUTTON(EncapsulationRadio6_Event,
112                     SoutDialog::OnEncapsulationChange)
113     EVT_RADIOBUTTON(EncapsulationRadio7_Event,
114                     SoutDialog::OnEncapsulationChange)
115     EVT_RADIOBUTTON(EncapsulationRadio8_Event,
116                     SoutDialog::OnEncapsulationChange)
117     EVT_RADIOBUTTON(EncapsulationRadio9_Event,
118                     SoutDialog::OnEncapsulationChange)
119
120     /* Events generated by the transcoding panel */
121     EVT_CHECKBOX(VideoTranscEnable_Event, SoutDialog::OnTranscodingEnable)
122     EVT_CHECKBOX(AudioTranscEnable_Event, SoutDialog::OnTranscodingEnable)
123     EVT_CHECKBOX(SubtitlesTranscEnable_Event, SoutDialog::OnTranscodingEnable)
124     EVT_CHECKBOX(SubtitlesOverlayEnable_Event, SoutDialog::OnTranscodingEnable)
125     EVT_COMBOBOX(VideoTranscCodec_Event, SoutDialog::OnTranscodingChange)
126     EVT_TEXT(VideoTranscCodec_Event, SoutDialog::OnTranscodingChange)
127     EVT_COMBOBOX(AudioTranscCodec_Event, SoutDialog::OnTranscodingChange)
128     EVT_TEXT(AudioTranscCodec_Event, SoutDialog::OnTranscodingChange)
129     EVT_COMBOBOX(VideoTranscBitrate_Event, SoutDialog::OnTranscodingChange)
130     EVT_TEXT(VideoTranscBitrate_Event, SoutDialog::OnTranscodingChange)
131     EVT_COMBOBOX(AudioTranscBitrate_Event, SoutDialog::OnTranscodingChange)
132     EVT_TEXT(AudioTranscBitrate_Event, SoutDialog::OnTranscodingChange)
133     EVT_COMBOBOX(VideoTranscScale_Event, SoutDialog::OnTranscodingChange)
134     EVT_TEXT(VideoTranscScale_Event, SoutDialog::OnTranscodingChange)
135     EVT_COMBOBOX(AudioTranscChans_Event, SoutDialog::OnTranscodingChange)
136     EVT_TEXT(AudioTranscChans_Event, SoutDialog::OnTranscodingChange)
137     EVT_COMBOBOX(SubtitlesTranscCodec_Event, SoutDialog::OnTranscodingChange)
138     EVT_TEXT(SubtitlesTranscCodec_Event, SoutDialog::OnTranscodingChange)
139
140     /* Events generated by the misc panel */
141     EVT_CHECKBOX(SAPMisc_Event, SoutDialog::OnSAPMiscChange)
142     EVT_TEXT(AnnounceGroup_Event, SoutDialog::OnAnnounceGroupChange)
143     EVT_TEXT(AnnounceAddr_Event, SoutDialog::OnAnnounceAddrChange)
144     EVT_CHECKBOX(SoutAll_Event, SoutDialog::OnAnnounceGroupChange)
145
146 END_EVENT_TABLE()
147
148 /*****************************************************************************
149  * Constructor.
150  *****************************************************************************/
151 SoutDialog::SoutDialog( intf_thread_t *_p_intf, wxWindow* _p_parent ):
152     wxDialog( _p_parent, -1, wxU(_("Stream output")),
153              wxDefaultPosition, wxDefaultSize, wxDEFAULT_FRAME_STYLE )
154 {
155     /* Initializations */
156     p_intf = _p_intf;
157     p_parent = _p_parent;
158     SetIcon( *p_intf->p_sys->p_icon );
159
160     /* Create a panel to put everything in */
161     wxPanel *panel = new wxPanel( this, -1 );
162     panel->SetAutoLayout( TRUE );
163
164     /* Create MRL combobox */
165     wxBoxSizer *mrl_sizer_sizer = new wxBoxSizer( wxHORIZONTAL );
166     wxStaticBox *mrl_box = new wxStaticBox( panel, -1,
167                                wxU(_("Stream output MRL")) );
168     wxStaticBoxSizer *mrl_sizer = new wxStaticBoxSizer( mrl_box,
169                                                         wxHORIZONTAL );
170     wxStaticText *mrl_label = new wxStaticText( panel, -1,
171                                                 wxU(_("Destination Target:")));
172     mrl_combo = new wxComboBox( panel, MRL_Event, wxT(""),
173                                 wxPoint(20,25), wxSize(120, -1) );
174     mrl_combo->SetToolTip( wxU(_("You can use this field directly by typing "
175         "the full MRL you want to open.\n""Alternatively, the field will be "
176         "filled automatically when you use the controls below")) );
177
178     mrl_sizer->Add( mrl_label, 0, wxALL | wxALIGN_CENTER, 5 );
179     mrl_sizer->Add( mrl_combo, 1, wxALL | wxALIGN_CENTER, 5 );
180     mrl_sizer_sizer->Add( mrl_sizer, 1, wxEXPAND | wxALL, 5 );
181
182     /* Create the output encapsulation panel */
183     encapsulation_panel = EncapsulationPanel( panel );
184
185     /* Create the access output panel */
186     access_panel = AccessPanel( panel );
187
188     /* Create the transcoding panel */
189     transcoding_panel = TranscodingPanel( panel );
190
191     /* Create the Misc panel */
192     misc_panel = MiscPanel( panel );
193
194     /* Create the buttons */
195     wxButton *ok_button = new wxButton( panel, wxID_OK, wxU(_("OK")) );
196     ok_button->SetDefault();
197     wxButton *cancel_button = new wxButton( panel, wxID_CANCEL,
198                                             wxU(_("Cancel")) );
199
200     /* Place everything in sizers */
201     wxBoxSizer *button_sizer = new wxBoxSizer( wxHORIZONTAL );
202     button_sizer->Add( ok_button, 0, wxALL, 5 );
203     button_sizer->Add( cancel_button, 0, wxALL, 5 );
204     button_sizer->Layout();
205     wxBoxSizer *main_sizer = new wxBoxSizer( wxVERTICAL );
206     wxBoxSizer *panel_sizer = new wxBoxSizer( wxVERTICAL );
207     panel_sizer->Add( mrl_sizer_sizer, 0, wxEXPAND, 5 );
208     panel_sizer->Add( access_panel, 1, wxEXPAND | wxALL, 5 );
209     panel_sizer->Add( encapsulation_panel, 0, wxEXPAND | wxALL, 5 );
210     panel_sizer->Add( transcoding_panel, 0, wxEXPAND | wxALL, 5 );
211     panel_sizer->Add( misc_panel, 0, wxEXPAND | wxALL, 5 );
212     panel_sizer->Add( button_sizer, 0, wxALIGN_LEFT | wxALIGN_BOTTOM |
213                       wxALL, 5 );
214     panel_sizer->Layout();
215     panel->SetSizerAndFit( panel_sizer );
216     main_sizer->Add( panel, 1, wxGROW, 0 );
217     main_sizer->Layout();
218     SetSizerAndFit( main_sizer );
219 }
220
221 SoutDialog::~SoutDialog()
222 {
223 }
224
225 wxArrayString SoutDialog::GetOptions()
226 {
227    return SeparateEntries( mrl_combo->GetValue() );
228 }
229
230 /*****************************************************************************
231  * Private methods.
232  *****************************************************************************/
233 void SoutDialog::UpdateMRL()
234 {
235     /* Check the demux dump option */
236     if( dump_checkbox->IsChecked() )
237     {
238         wxString dumpfile;
239
240         if( file_combo->GetValue().size() )
241             dumpfile = wxT(" :demuxdump-file=\"") +
242                        file_combo->GetValue() + wxT("\"");
243         mrl_combo->SetValue( wxT(":demux=dump") + dumpfile );
244
245         return;
246     }
247
248     /* Let's start with the transcode options */
249     wxString transcode;
250     if( video_transc_checkbox->IsChecked() ||
251         audio_transc_checkbox->IsChecked() ||
252         subtitles_transc_checkbox->IsChecked() ||
253         subtitles_overlay_checkbox->IsChecked() )
254     {
255         transcode = wxT("transcode{");
256         if( video_transc_checkbox->IsChecked() )
257         {
258             transcode += wxT("vcodec=") + video_codec_combo->GetValue();
259             transcode += wxT(",vb=") + video_bitrate_combo->GetValue();
260             transcode += wxT(",scale=") + video_scale_combo->GetValue();
261             if( audio_transc_checkbox->IsChecked() ||
262                 subtitles_transc_checkbox->IsChecked() ||
263                 subtitles_overlay_checkbox->IsChecked() )
264                 transcode += wxT(",");
265         }
266         if( audio_transc_checkbox->IsChecked() )
267         {
268             transcode += wxT("acodec=") + audio_codec_combo->GetValue();
269             transcode += wxT(",ab=") + audio_bitrate_combo->GetValue();
270             transcode += wxT(",channels=") + audio_channels_combo->GetValue();
271             if( subtitles_transc_checkbox->IsChecked() ||
272                 subtitles_overlay_checkbox->IsChecked() )
273                 transcode += wxT(",");
274         }
275         if( subtitles_transc_checkbox->IsChecked() )
276         {
277             transcode += wxT("scodec=") + subtitles_codec_combo->GetValue();
278         }
279         if( subtitles_overlay_checkbox->IsChecked() )
280         {
281             transcode += wxT("soverlay");
282         }
283         transcode += wxT("}");
284     }
285
286     /* Encapsulation */
287     wxString encapsulation;
288     switch( i_encapsulation_type )
289     {
290     case PS_ENCAPSULATION:
291         encapsulation = wxT("ps");
292         break;
293     case MPEG1_ENCAPSULATION:
294         encapsulation = wxT("mpeg1");
295         break;
296     case AVI_ENCAPSULATION:
297         encapsulation = wxT("avi");
298         break;
299     case OGG_ENCAPSULATION:
300         encapsulation = wxT("ogg");
301         break;
302     case RAW_ENCAPSULATION:
303         encapsulation = wxT("raw");
304         break;
305     case MP4_ENCAPSULATION:
306         encapsulation = wxT("mp4");
307         break;
308     case MOV_ENCAPSULATION:
309         encapsulation = wxT("mov");
310         break;
311     case ASF_ENCAPSULATION:
312         encapsulation = wxT("asf");
313         break;
314     case WAV_ENCAPSULATION:
315         encapsulation = wxT("wav");
316         break;
317     case TS_ENCAPSULATION:
318     default:
319         encapsulation = wxT("ts");
320         break;
321     }
322
323     /* Now continue with the duplicate option */
324     wxString dup_opts;
325     if( access_checkboxes[PLAY_ACCESS_OUT]->IsChecked() )
326     {
327         dup_opts += wxT("dst=display");
328     }
329     if( access_checkboxes[FILE_ACCESS_OUT]->IsChecked() )
330     {
331         if( !dup_opts.IsEmpty() ) dup_opts += wxT(",");
332         dup_opts += wxT("dst=std{access=file,mux=");
333         dup_opts += encapsulation + wxT(",url=\"");
334         dup_opts += file_combo->GetValue() + wxT("\"}");
335     }
336     if( access_checkboxes[HTTP_ACCESS_OUT]->IsChecked() )
337     {
338         if( !dup_opts.IsEmpty() ) dup_opts += wxT(",");
339         dup_opts += wxT("dst=std{access=http,mux=");
340         dup_opts += encapsulation + wxT(",url=");
341         dup_opts += net_addrs[HTTP_ACCESS_OUT]->GetLineText(0);
342         dup_opts += wxString::Format( wxT(":%d"),
343                                       net_ports[HTTP_ACCESS_OUT]->GetValue() );
344         dup_opts += wxT("}");
345     }
346     if( access_checkboxes[MMSH_ACCESS_OUT]->IsChecked() )
347     {
348         if( !dup_opts.IsEmpty() ) dup_opts += wxT(",");
349         dup_opts += wxT("dst=std{access=mmsh,mux=");
350         dup_opts += encapsulation;
351         if( i_encapsulation_type == ASF_ENCAPSULATION ) dup_opts += wxT("h");
352         dup_opts += wxT(",url=");
353         dup_opts += net_addrs[MMSH_ACCESS_OUT]->GetLineText(0);
354         dup_opts += wxString::Format( wxT(":%d"),
355                                       net_ports[MMSH_ACCESS_OUT]->GetValue() );
356         dup_opts += wxT("}");
357     }
358     if( access_checkboxes[RTP_ACCESS_OUT]->IsChecked() )
359     {
360         if( !dup_opts.IsEmpty() ) dup_opts += wxT(",");
361         dup_opts += wxT("dst=std{access=rtp,mux=");
362         dup_opts += encapsulation + wxT(",url=");
363
364         wxString rtp_addr = net_addrs[RTP_ACCESS_OUT]->GetLineText(0);
365         if ((rtp_addr[0u] != '[') && (rtp_addr.Find(':') != -1))
366         {
367             dup_opts += wxT ("[") + rtp_addr + wxT ("]");
368         }
369         else
370         {
371             dup_opts += rtp_addr;
372         }
373         dup_opts += wxString::Format( wxT(":%d"),
374                                       net_ports[RTP_ACCESS_OUT]->GetValue() );
375
376         /* SAP if RTP */
377         if( sap_checkbox->IsChecked() )
378         {
379             dup_opts += wxT(",sap");
380             if( ! announce_group->GetLineText(0).IsEmpty() )
381             {
382                 dup_opts += wxT(",group=\"");
383                 dup_opts += announce_group->GetLineText(0);
384                 dup_opts += wxT("\"");
385             }
386             if( ! announce_addr->GetLineText(0).IsEmpty() )
387             {
388                 dup_opts += wxT(",name=\"");
389                 dup_opts += announce_addr->GetLineText(0);
390                 dup_opts += wxT("\"");
391             }
392         }
393
394         dup_opts += wxT("}");
395     }
396
397     if( access_checkboxes[UDP_ACCESS_OUT]->IsChecked() )
398     {
399         if( !dup_opts.IsEmpty() ) dup_opts += wxT(",");
400         dup_opts += wxT("dst=std{access=udp,mux=");
401         dup_opts += encapsulation + wxT(",url=");
402
403         wxString udp_addr = net_addrs[UDP_ACCESS_OUT]->GetLineText(0);
404         if ((udp_addr[0u] != '[') && (udp_addr.Find(':') != -1))
405         {
406             dup_opts += wxT ("[") + udp_addr + wxT ("]");
407         }
408         else
409         {
410             dup_opts += udp_addr;
411         }
412         dup_opts += wxString::Format( wxT(":%d"),
413                                       net_ports[UDP_ACCESS_OUT]->GetValue() );
414
415         /* SAP if UDP */
416         if( sap_checkbox->IsChecked() )
417         {
418             dup_opts += wxT(",sap");
419             if( ! announce_group->GetLineText(0).IsEmpty() )
420             {
421                 dup_opts += wxT(",group=\"");
422                 dup_opts += announce_group->GetLineText(0);
423                 dup_opts += wxT("\"");
424             }
425             if( ! announce_addr->GetLineText(0).IsEmpty() )
426             {
427                 dup_opts += wxT(",name=\"");
428                 dup_opts += announce_addr->GetLineText(0);
429                 dup_opts += wxT("\"");
430             }
431         }
432
433         dup_opts += wxT("}");
434     }
435
436     wxString duplicate;
437     if( !dup_opts.IsEmpty() )
438     {
439         if( !transcode.IsEmpty() ) duplicate = wxT(":");
440         duplicate += wxT("duplicate{") + dup_opts + wxT("}");
441     }
442
443     wxString misc;
444     if( (!transcode.IsEmpty() || !duplicate.IsEmpty()) &&
445         sout_all_checkbox->IsChecked() )
446     {
447         misc = wxT(" :sout-all");
448     }
449
450     if( !transcode.IsEmpty() || !duplicate.IsEmpty() )
451         mrl_combo->SetValue( wxT(":sout=#") + transcode + duplicate + misc );
452     else
453         mrl_combo->SetValue( wxT("") );
454 }
455
456 wxPanel *SoutDialog::AccessPanel( wxWindow* parent )
457 {
458     int i;
459     wxPanel *panel = new wxPanel( parent, -1, wxDefaultPosition,
460                                   wxSize(200, 200) );
461
462     wxStaticBox *panel_box = new wxStaticBox( panel, -1,
463                                               wxU(_("Output methods")) );
464     wxStaticBoxSizer *panel_sizer = new wxStaticBoxSizer( panel_box,
465                                                           wxVERTICAL );
466
467     /*wxFlexGridSizer *sizer = new wxFlexGridSizer( 2, 4, 20 );*/
468     wxFlexGridSizer *sizer = new wxFlexGridSizer( 2, 0, 20 );
469     static const wxString access_output_array[] =
470     {
471         wxU(_("Play locally")),
472         wxU(_("File")),
473         wxU(_("HTTP")),
474         wxU(_("MMSH")),
475         wxU(_("RTP")),
476         wxU(_("UDP")),
477     };
478
479     for( i=0; i < ACCESS_OUT_NUM; i++ )
480     {
481         access_checkboxes[i] = new wxCheckBox( panel, AccessType1_Event + i,
482                                                access_output_array[i] );
483         access_subpanels[i] = new wxPanel( panel, -1 );
484     }
485
486     /* Play locally row */
487     wxFlexGridSizer *subpanel_sizer;
488     wxStaticText *label;
489     label = new wxStaticText( access_subpanels[0], -1, wxT("") );
490     subpanel_sizer = new wxFlexGridSizer( 1, 1, 20 );
491     subpanel_sizer->Add( label, 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL );
492     access_subpanels[0]->SetSizerAndFit( subpanel_sizer );
493     access_subpanels[0]->Hide();
494
495     /* File row */
496     /*subpanel_sizer = new wxFlexGridSizer( 3, 2, 20 );*/
497     subpanel_sizer = new wxFlexGridSizer( 4, 1, 10);
498     label = new wxStaticText( access_subpanels[1], -1, wxU(_("Filename")) );
499     file_combo = new wxComboBox( access_subpanels[1], FileName_Event, wxT(""),
500                                  wxPoint(20,25), wxSize(200, -1) );
501     wxButton *browse_button = new wxButton( access_subpanels[1],
502                                   FileBrowse_Event, wxU(_("Browse...")) );
503     subpanel_sizer->Add( label, 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL );
504     subpanel_sizer->Add( file_combo, 1,
505                          wxEXPAND | wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL );
506     subpanel_sizer->Add( browse_button, 0,
507                          wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL );
508     /*subpanel_sizer->Add( new wxPanel(access_subpanels[1], -1), 0,*/
509     /*                     wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL );*/
510     dump_checkbox = new wxCheckBox( access_subpanels[1], FileDump_Event,
511                                     wxU(_("Dump raw input")) );
512     subpanel_sizer->Add( dump_checkbox, 0,
513                          wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL | wxTOP, 5 );
514
515     access_subpanels[1]->SetSizerAndFit( subpanel_sizer );
516
517     /* Net rows */
518     for( i = HTTP_ACCESS_OUT; i < ACCESS_OUT_NUM; i++ )
519     {
520         subpanel_sizer = new wxFlexGridSizer( 4, 1, 20 );
521         label = new wxStaticText( access_subpanels[i], -1, wxU(_("Address")) );
522         net_addrs[i] = new wxTextCtrl( access_subpanels[i],
523                                    NetAddr1_Event + i - HTTP_ACCESS_OUT,
524                                    wxT(""), wxDefaultPosition,
525                                    wxSize( 200, -1 ), wxTE_PROCESS_ENTER);
526         subpanel_sizer->Add( label, 0,
527                              wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL );
528         subpanel_sizer->Add( net_addrs[i], 1, wxEXPAND |
529                              wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL );
530
531         int val = config_GetInt( p_intf, "server-port" );
532         label = new wxStaticText( access_subpanels[i], -1, wxU(_("Port")) );
533         net_ports[i] = new wxSpinCtrl( access_subpanels[i],
534                                    NetPort1_Event + i - HTTP_ACCESS_OUT,
535                                    wxString::Format(wxT("%d"), val),
536                                    wxDefaultPosition, wxDefaultSize,
537                                    wxSP_ARROW_KEYS,
538                                    0, 65535, val );
539
540         subpanel_sizer->Add( label, 0,
541                              wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL );
542         subpanel_sizer->Add( net_ports[i], 0,
543                              wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL );
544
545         access_subpanels[i]->SetSizerAndFit( subpanel_sizer );
546     }
547
548
549     /* Stuff everything into the main panel */
550     for( i=1; i < ACCESS_OUT_NUM; i++ )
551     {
552         sizer->Add( access_checkboxes[i], 0,
553                     wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL  | wxALL, 5 );
554         sizer->Add( access_subpanels[i], 1, wxEXPAND | wxALIGN_CENTER_VERTICAL
555                     | wxALIGN_LEFT  | wxALL, 5 );
556     }
557
558     panel_sizer->Add( access_checkboxes[0], 0,
559                       wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL  | wxALL, 5 );
560     panel_sizer->Add( sizer, 1, wxEXPAND | wxTOP, 3 );
561
562     panel->SetSizerAndFit( panel_sizer );
563
564     /* Update access type panel */
565     for( i=1; i < ACCESS_OUT_NUM; i++ )
566     {
567         access_subpanels[i]->Disable();
568     }
569
570     return panel;
571 }
572
573 wxPanel *SoutDialog::MiscPanel( wxWindow* parent )
574 {
575     wxPanel *panel = new wxPanel( parent, -1, wxDefaultPosition,
576                                   wxSize(200, 200) );
577
578     wxStaticBox *panel_box = new wxStaticBox( panel, -1,
579                                    wxU(_("Miscellaneous options")) );
580     wxStaticBoxSizer *panel_sizer = new wxStaticBoxSizer( panel_box,
581                                                           wxVERTICAL );
582
583     /* Announce Row */
584     misc_subpanels[ANN_MISC_SOUT] = new wxPanel( panel, -1 );
585     misc_subpanels[TTL_MISC_SOUT] = new wxPanel( panel, -1 );
586     wxFlexGridSizer *subpanel_sizer = new wxFlexGridSizer( 3, 4, 20 );
587     wxFlexGridSizer *subpanel_sub_sizer = new wxFlexGridSizer( 5, 4, 20 );
588     wxFlexGridSizer *subpanel2_sizer = new wxFlexGridSizer( 3, 4, 20 );
589
590     sap_checkbox = new wxCheckBox( misc_subpanels[ANN_MISC_SOUT],SAPMisc_Event,
591                                    wxU(_("SAP announce")) );
592     wxStaticText *label_g = new wxStaticText( misc_subpanels[ANN_MISC_SOUT], -1,
593                                             wxU(_("Group name")) );
594     announce_group = new wxTextCtrl( misc_subpanels[ANN_MISC_SOUT],
595                                     AnnounceGroup_Event,
596                                     wxT(""), wxDefaultPosition,
597                                     wxSize( 100, -1 ), wxTE_PROCESS_ENTER);
598
599     wxStaticText *label = new wxStaticText( misc_subpanels[ANN_MISC_SOUT], -1,
600                                             wxU(_("Channel name")) );
601     announce_addr = new wxTextCtrl( misc_subpanels[ANN_MISC_SOUT],
602                                     AnnounceAddr_Event,
603                                     wxT(""), wxDefaultPosition,
604                                     wxSize( 100, -1 ), wxTE_PROCESS_ENTER);
605
606     wxStaticText *ttl_label = new wxStaticText( misc_subpanels[TTL_MISC_SOUT], -1,
607                         wxU(_("Time-To-Live (TTL)")) );
608     ttl_spin = new wxSpinCtrl( misc_subpanels[TTL_MISC_SOUT], -1, wxEmptyString, wxDefaultPosition, wxDefaultSize,
609                    0, 1, 255, config_GetInt( p_intf, "ttl" ) );
610
611     subpanel_sizer->Add( sap_checkbox, 0,
612                          wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL );
613     subpanel_sub_sizer->Add( label_g, 0, wxALIGN_RIGHT |
614                              wxALIGN_CENTER_VERTICAL );
615     subpanel_sub_sizer->Add( announce_group, 1, wxEXPAND |
616                              wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL );
617     subpanel_sub_sizer->Add( label, 0, wxALIGN_RIGHT |
618                              wxALIGN_CENTER_VERTICAL );
619     subpanel_sub_sizer->Add( announce_addr, 1, wxEXPAND |
620                              wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL );
621     subpanel_sizer->Add( subpanel_sub_sizer, 1, wxEXPAND |
622                          wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL );
623
624     sout_all_checkbox = new wxCheckBox( misc_subpanels[TTL_MISC_SOUT],
625                     SoutAll_Event, wxU(_("Select all elementary streams")) );
626     subpanel2_sizer->Add( sout_all_checkbox, 1,
627                       wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL | wxLEFT, 5 );
628     subpanel2_sizer->Add( ttl_label, 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL );
629     subpanel2_sizer->Add( ttl_spin, 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL );
630
631     misc_subpanels[ANN_MISC_SOUT]->SetSizerAndFit( subpanel_sizer );
632     misc_subpanels[TTL_MISC_SOUT]->SetSizerAndFit( subpanel2_sizer );
633
634     /* Stuff everything into the main panel */
635     panel_sizer->Add( misc_subpanels[ANN_MISC_SOUT], 1,
636                       wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL | wxLEFT, 5 );
637
638     panel_sizer->Add( misc_subpanels[TTL_MISC_SOUT], 1,
639                       wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL | wxALL, 5 );
640
641
642     panel->SetSizerAndFit( panel_sizer );
643
644     /* Update misc panel */
645     misc_subpanels[ANN_MISC_SOUT]->Disable();
646     announce_group->Disable();
647     announce_addr->Disable();
648
649     return panel;
650 }
651
652 wxPanel *SoutDialog::EncapsulationPanel( wxWindow* parent )
653 {
654     unsigned int i;
655     wxPanel *panel = new wxPanel( parent, -1, wxDefaultPosition,
656                                   wxSize(200, 200) );
657
658     wxStaticBox *panel_box = new wxStaticBox( panel, -1,
659                                               wxU(_("Encapsulation Method")) );
660     wxStaticBoxSizer *panel_sizer = new wxStaticBoxSizer( panel_box,
661                                                           wxHORIZONTAL );
662
663     static const wxString encapsulation_array[] =
664     {
665         wxT("MPEG TS"),
666         wxT("MPEG PS"),
667         wxT("MPEG 1"),
668         wxT("Ogg"),
669         wxT("ASF"),
670         wxT("MP4"),
671         wxT("MOV"),
672         wxT("WAV"),
673         wxT("Raw")
674     };
675
676     /* Stuff everything into the main panel */
677     for( i = 0; i < WXSIZEOF(encapsulation_array); i++ )
678     {
679         encapsulation_radios[i] =
680             new wxRadioButton( panel, EncapsulationRadio1_Event + i,
681                                encapsulation_array[i] );
682         panel_sizer->Add( encapsulation_radios[i], 0,
683                           wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL |
684                           wxALL, 4 );
685     }
686     /* Hide avi one */
687     for( i = WXSIZEOF(encapsulation_array); i < ENCAPS_NUM; i++ )
688     {
689         encapsulation_radios[i] =
690             new wxRadioButton( panel, EncapsulationRadio1_Event + i, wxT("") );
691         encapsulation_radios[i]->Hide();
692     }
693
694     panel->SetSizerAndFit( panel_sizer );
695
696     /* Update encapsulation panel */
697     encapsulation_radios[TS_ENCAPSULATION]->SetValue(true);
698     i_encapsulation_type = TS_ENCAPSULATION;
699
700     return panel;
701 }
702
703 wxPanel *SoutDialog::TranscodingPanel( wxWindow* parent )
704 {
705     wxPanel *panel = new wxPanel( parent, -1, wxDefaultPosition,
706                                   wxSize(200, 200) );
707
708     wxStaticBox *panel_box = new wxStaticBox( panel, -1,
709                                               wxU(_("Transcoding options")) );
710     wxStaticBoxSizer *panel_sizer = new wxStaticBoxSizer( panel_box,
711                                                           wxVERTICAL );
712
713     /* Create video transcoding checkox */
714     static const wxString wxvcodecs_array[] =
715     {
716         wxT("mp1v"),
717         wxT("mp2v"),
718         wxT("mp4v"),
719         wxT("DIV1"),
720         wxT("DIV2"),
721         wxT("DIV3"),
722         wxT("H263"),
723         wxT("h264"),
724         wxT("WMV1"),
725         wxT("WMV2"),
726         wxT("MJPG"),
727         wxT("theo")
728     };
729     /*
730     static const wxString vbitrates_array[] =
731     {
732             wxT("3072"),
733             wxT("2048"),
734             wxT("1024"),
735             wxT("768"),
736             wxT("512"),
737             wxT("384"),
738             wxT("256"),
739             wxT("192"),
740             wxT("128"),
741             wxT("96"),
742             wxT("64"),
743             wxT("32"),
744             wxT("16")
745     };
746 */
747     static const wxString vscales_array[] =
748     {
749             wxT("0.25"),
750             wxT("0.5"),
751             wxT("0.75"),
752             wxT("1"),
753             wxT("1.25"),
754             wxT("1.5"),
755             wxT("1.75"),
756             wxT("2")
757     };
758
759     wxFlexGridSizer *video_sizer = new wxFlexGridSizer( 6, 1, 20 );
760 #if defined( __WXMSW__ )
761     wxFlexGridSizer *video_sub_sizer = new wxFlexGridSizer( 4, 5, 20 );
762 #else
763     wxFlexGridSizer *video_sub_sizer = new wxFlexGridSizer( 2, 5, 20 );
764 #endif
765     video_transc_checkbox =
766         new wxCheckBox( panel, VideoTranscEnable_Event, wxU(_("Video codec")));
767     video_codec_combo =
768         new wxComboBox( panel, VideoTranscCodec_Event, wxvcodecs_array[2],
769                         wxPoint(20,25), wxDefaultSize,
770                         WXSIZEOF(wxvcodecs_array),
771                         wxvcodecs_array, wxCB_READONLY );
772     video_codec_combo->SetSelection(2);
773     wxStaticText *bitrate_label =
774         new wxStaticText( panel, -1, wxU(_("Bitrate (kb/s)")));
775     video_bitrate_combo =
776         new wxComboBox( panel, VideoTranscBitrate_Event, wxT("1024"),
777                         wxPoint(20,25), wxDefaultSize,
778                         WXSIZEOF(vbitrates_array), vbitrates_array );
779     wxStaticText *scale_label =
780         new wxStaticText( panel, -1, wxU(_("Scale")));
781     video_scale_combo =
782         new wxComboBox( panel, VideoTranscScale_Event, wxT("1"),
783                         wxPoint(20,25), wxDefaultSize,
784                         WXSIZEOF(vscales_array), vscales_array );
785     video_sizer->Add( video_transc_checkbox, 0,
786                       wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL );
787     video_sizer->Add( video_codec_combo, 1,
788                       wxEXPAND | wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL );
789     video_sub_sizer->Add( bitrate_label, 0,
790                       wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL );
791     video_sub_sizer->Add( video_bitrate_combo, 1,
792                       wxEXPAND | wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL );
793     video_sub_sizer->Add( scale_label, 0,
794                       wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL );
795     video_sub_sizer->Add( video_scale_combo, 1,
796                       wxEXPAND | wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL );
797     video_sizer->Add( video_sub_sizer, 1, wxEXPAND |
798                          wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL );
799
800     /* Create audio transcoding checkox */
801     static const wxString wxacodecs_array[] =
802     {
803         wxT("mpga"),
804         wxT("mp2a"),
805         wxT("mp3"),
806         wxT("mp4a"),
807         wxT("a52"),
808         wxT("vorb"),
809         wxT("flac"),
810         wxT("spx"),
811         wxT("s16l"),
812         wxT("fl32")
813     };
814     static const wxString achannels_array[] =
815     {
816         wxT("1"),
817         wxT("2"),
818         wxT("4"),
819         wxT("6")
820     };
821 /*
822     static const wxString abitrates_array[] =
823     {
824             wxT("512"),
825             wxT("256"),
826             wxT("192"),
827             wxT("128"),
828             wxT("96"),
829             wxT("64"),
830             wxT("32"),
831             wxT("16")
832     };
833 */
834     wxFlexGridSizer *audio_sizer = new wxFlexGridSizer( 3, 1, 20 );
835     audio_transc_checkbox =
836         new wxCheckBox( panel, AudioTranscEnable_Event, wxU(_("Audio codec")));
837     audio_codec_combo =
838         new wxComboBox( panel, AudioTranscCodec_Event, wxacodecs_array[0],
839                         wxPoint(10,25), wxDefaultSize,
840                         WXSIZEOF(wxacodecs_array),
841                         wxacodecs_array, wxCB_READONLY );
842     audio_codec_combo->SetSelection(0);
843 #if defined( __WXMSW__ )
844     wxFlexGridSizer *audio_sub_sizer = new wxFlexGridSizer( 4, 5, 20 );
845 #else
846     wxFlexGridSizer *audio_sub_sizer = new wxFlexGridSizer( 2, 5, 20 );
847 #endif
848     bitrate_label =
849         new wxStaticText( panel, -1, wxU(_("Bitrate (kb/s)")));
850     audio_bitrate_combo =
851         new wxComboBox( panel, AudioTranscBitrate_Event, wxT("192"),
852                         wxPoint(10,25), wxDefaultSize,
853                         WXSIZEOF(abitrates_array), abitrates_array );
854     wxStaticText *channels_label =
855         new wxStaticText( panel, -1, wxU(_("Channels")));
856     audio_channels_combo =
857         new wxComboBox( panel, AudioTranscChans_Event, achannels_array[1],
858                         wxPoint(10,25), wxDefaultSize,
859                         WXSIZEOF(achannels_array), achannels_array );
860     audio_channels_combo->SetSelection(1);
861     audio_sub_sizer->Add( bitrate_label, 0,
862                       wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL );
863     audio_sub_sizer->Add( audio_bitrate_combo, 1,
864                       wxEXPAND | wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL );
865     audio_sub_sizer->Add( channels_label, 0,
866                       wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL );
867     audio_sub_sizer->Add( audio_channels_combo, 1,
868                       wxEXPAND | wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL );
869
870     audio_sizer->Add( audio_transc_checkbox, 0,
871                       wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL );
872     audio_sizer->Add( audio_codec_combo, 1,
873                       wxEXPAND | wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL );
874     audio_sizer->Add( audio_sub_sizer, 1,
875                       wxEXPAND | wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL );
876
877     /* Create subtitles transcoding checkox */
878     static const wxString wxscodecs_array[] =
879     {
880         wxT("dvbs")
881     };
882
883     wxFlexGridSizer *subtitles_sizer = new wxFlexGridSizer( 3, 1, 20 );
884     subtitles_transc_checkbox =
885         new wxCheckBox( panel, SubtitlesTranscEnable_Event,
886                         wxU(_("Subtitles codec")));
887     subtitles_codec_combo =
888         new wxComboBox( panel, SubtitlesTranscCodec_Event, wxscodecs_array[0],
889                         wxPoint(10,25), wxDefaultSize,
890                         WXSIZEOF(wxscodecs_array),
891                         wxscodecs_array, wxCB_READONLY );
892     subtitles_codec_combo->SetSelection(0);
893     subtitles_overlay_checkbox =
894         new wxCheckBox( panel, SubtitlesOverlayEnable_Event,
895                         wxU(_("Subtitles overlay")));
896
897     subtitles_sizer->Add( subtitles_transc_checkbox, 0,
898                           wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL );
899     subtitles_sizer->Add( subtitles_codec_combo, 1,
900                           wxEXPAND | wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL );
901     subtitles_sizer->Add( subtitles_overlay_checkbox, 0,
902                           wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL );
903
904     /* Stuff everything into the main panel */
905     panel_sizer->Add( video_sizer, 0,
906                       wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL | wxALL, 5 );
907     panel_sizer->Add( audio_sizer, 0,
908                       wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL | wxALL, 5 );
909     panel_sizer->Add( subtitles_sizer, 0,
910                       wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL | wxALL, 5 );
911
912     panel->SetSizerAndFit( panel_sizer );
913
914     /* Update transcoding panel */
915     wxCommandEvent event( 0, VideoTranscEnable_Event );
916     event.SetInt( 0 );
917     OnTranscodingEnable( event );
918     event.SetId( AudioTranscEnable_Event );
919     OnTranscodingEnable( event );
920     event.SetId( SubtitlesTranscEnable_Event );
921     OnTranscodingEnable( event );
922
923     return panel;
924 }
925
926 /*****************************************************************************
927  * Events methods.
928  *****************************************************************************/
929 void SoutDialog::OnOk( wxCommandEvent& WXUNUSED(event) )
930 {
931     mrl_combo->Append( mrl_combo->GetValue() );
932     config_PutInt( p_intf, "ttl", ttl_spin->GetValue());
933     EndModal( wxID_OK );
934 }
935
936 void SoutDialog::OnCancel( wxCommandEvent& WXUNUSED(event) )
937 {
938     EndModal( wxID_CANCEL );
939 }
940
941 void SoutDialog::OnMRLChange( wxCommandEvent& event )
942 {
943     //mrl = event.GetString();
944 }
945
946 /*****************************************************************************
947  * Access output panel event methods.
948  *****************************************************************************/
949 void SoutDialog::OnAccessTypeChange( wxCommandEvent& event )
950 {
951     int i;
952     i_access_type = event.GetId() - AccessType1_Event;
953
954     access_subpanels[i_access_type]->Enable( event.GetInt() );
955
956     switch( i_access_type )
957     {
958     case UDP_ACCESS_OUT:
959     case RTP_ACCESS_OUT:
960         misc_subpanels[ANN_MISC_SOUT]->Enable( event.GetInt() );
961
962         for( i = 1; i < ENCAPS_NUM; i++ )
963         {
964             encapsulation_radios[i]->Enable( !event.GetInt() );
965         }
966         if( event.GetInt() )
967         {
968             encapsulation_radios[TS_ENCAPSULATION]->SetValue(true);
969             i_encapsulation_type = TS_ENCAPSULATION;
970         }
971         break;
972     }
973     UpdateMRL();
974 }
975
976 /*****************************************************************************
977  * AnnounceMisc panel event methods.
978  *****************************************************************************/
979 void SoutDialog::OnSAPMiscChange( wxCommandEvent& event )
980 {
981     announce_addr->Enable( event.GetInt() );
982     announce_group->Enable( event.GetInt() );
983     UpdateMRL();
984 }
985
986 /*****************************************************************************
987  * SAPAddr panel event methods.
988  *****************************************************************************/
989 void SoutDialog::OnAnnounceAddrChange( wxCommandEvent& WXUNUSED(event) )
990 {
991     UpdateMRL();
992 }
993
994 void SoutDialog::OnAnnounceGroupChange( wxCommandEvent& WXUNUSED(event) )
995 {
996     UpdateMRL();
997 }
998
999 /*****************************************************************************
1000  * File access output event methods.
1001  *****************************************************************************/
1002 void SoutDialog::OnFileChange( wxCommandEvent& WXUNUSED(event) )
1003 {
1004     UpdateMRL();
1005 }
1006
1007 void SoutDialog::OnFileBrowse( wxCommandEvent& WXUNUSED(event) )
1008 {
1009     wxFileDialog dialog( this, wxU(_("Save file")), wxT(""), wxT(""), wxT("*"),
1010                          wxSAVE | wxOVERWRITE_PROMPT );
1011
1012     if( dialog.ShowModal() == wxID_OK )
1013     {
1014         file_combo->SetValue( dialog.GetPath() );
1015         UpdateMRL();
1016     }
1017 }
1018
1019 void SoutDialog::OnFileDump( wxCommandEvent& event )
1020 {
1021     misc_panel->Enable( !event.GetInt() );
1022     encapsulation_panel->Enable( !event.GetInt() );
1023     transcoding_panel->Enable( !event.GetInt() );
1024
1025     for( int i = 0; i < ACCESS_OUT_NUM; i++ )
1026     {
1027         if( i != FILE_ACCESS_OUT )
1028         {
1029             access_checkboxes[i]->Enable( !event.GetInt() );
1030             access_subpanels[i]->Enable( !event.GetInt() &&
1031                                          access_checkboxes[i]->IsChecked() );
1032         }
1033     }
1034
1035     UpdateMRL();
1036 }
1037
1038 /*****************************************************************************
1039  * Net access output event methods.
1040  *****************************************************************************/
1041 void SoutDialog::OnNetChange( wxCommandEvent& WXUNUSED(event) )
1042 {
1043     UpdateMRL();
1044 }
1045
1046 /*****************************************************************************
1047  * Encapsulation panel event methods.
1048  *****************************************************************************/
1049 void SoutDialog::OnEncapsulationChange( wxCommandEvent& event )
1050 {
1051     i_encapsulation_type = event.GetId() - EncapsulationRadio1_Event;
1052     UpdateMRL();
1053 }
1054
1055 /*****************************************************************************
1056  * Transcoding panel event methods.
1057  *****************************************************************************/
1058 void SoutDialog::OnTranscodingEnable( wxCommandEvent& event )
1059 {
1060     switch( event.GetId() )
1061     {
1062     case VideoTranscEnable_Event:
1063         video_codec_combo->Enable( event.GetInt() );
1064         video_bitrate_combo->Enable( event.GetInt() );
1065         video_scale_combo->Enable( event.GetInt() );
1066         break;
1067     case AudioTranscEnable_Event:
1068         audio_codec_combo->Enable( event.GetInt() );
1069         audio_bitrate_combo->Enable( event.GetInt() );
1070         audio_channels_combo->Enable( event.GetInt() );
1071         break;
1072     case SubtitlesTranscEnable_Event:
1073         subtitles_overlay_checkbox->Enable( !event.GetInt() );
1074         subtitles_codec_combo->Enable( event.GetInt() );
1075         break;
1076     case SubtitlesOverlayEnable_Event:
1077         subtitles_transc_checkbox->Enable( !event.GetInt() );
1078         break;
1079     }
1080
1081     UpdateMRL();
1082 }
1083
1084 void SoutDialog::OnTranscodingChange( wxCommandEvent& event )
1085 {
1086     UpdateMRL();
1087 }