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