* modules/gui/wxwindows/*: misc small improvements and fixes.
[vlc.git] / modules / gui / wxwindows / streamout.cpp
index 885aa6e..2fb7fca 100644 (file)
@@ -2,7 +2,7 @@
  * streamout.cpp : wxWindows plugin for vlc
  *****************************************************************************
  * Copyright (C) 2000-2001 VideoLAN
- * $Id: streamout.cpp,v 1.2 2003/03/22 11:21:58 gbazin Exp $
+ * $Id: streamout.cpp,v 1.5 2003/04/01 16:11:43 gbazin Exp $
  *
  * Authors: Gildas Bazin <gbazin@netcourrier.com>
  *
@@ -126,12 +126,13 @@ END_EVENT_TABLE()
  * Constructor.
  *****************************************************************************/
 SoutDialog::SoutDialog( intf_thread_t *_p_intf, Interface *_p_main_interface ):
-    wxDialog( _p_main_interface, -1, _("Stream Output"), wxDefaultPosition,
+    wxDialog( _p_main_interface, -1, _("Stream output"), wxDefaultPosition,
              wxDefaultSize, wxDEFAULT_FRAME_STYLE )
 {
     /* Initializations */
     p_intf = _p_intf;
     p_main_interface = _p_main_interface;
+    SetIcon( *p_intf->p_sys->p_icon );
 
     /* Create a panel to put everything in */
     wxPanel *panel = new wxPanel( this, -1 );
@@ -140,7 +141,7 @@ SoutDialog::SoutDialog( intf_thread_t *_p_intf, Interface *_p_main_interface ):
     /* Create MRL combobox */
     wxBoxSizer *mrl_sizer_sizer = new wxBoxSizer( wxHORIZONTAL );
     wxStaticBox *mrl_box = new wxStaticBox( panel, -1,
-                               _("Stream Output MRL") );
+                               _("Stream output MRL") );
     wxStaticBoxSizer *mrl_sizer = new wxStaticBoxSizer( mrl_box,
                                                         wxHORIZONTAL );
     wxStaticText *mrl_label = new wxStaticText( panel, -1,
@@ -229,15 +230,13 @@ void SoutDialog::UpdateMRL()
         break;
 
     case UDP_ACCESS_OUT:
-        mrl = "udp" + encapsulation + ":"
-              + net_addr->GetLineText(0)
-              + wxString::Format( ":%d", net_port->GetValue() );
-        break;
-
     case RTP_ACCESS_OUT:
-        mrl = "rtp" + encapsulation + ":"
-              + net_addr->GetLineText(0)
-              + wxString::Format( ":%d", net_port->GetValue() );
+        mrl = ( i_access_type == UDP_ACCESS_OUT ) ? "udp" : "rtp";
+       mrl += encapsulation + ":" + net_addr->GetLineText(0);
+       if( net_port->GetValue() != config_GetInt( p_intf, "server-port" ) )
+       {
+           mrl += wxString::Format( ":%d", net_port->GetValue() );
+       }
         break;
     }
 
@@ -301,12 +300,13 @@ wxPanel *SoutDialog::AccessPanel( wxWindow* parent )
     subpanel_sizer->Add( net_addr, 1,
                          wxEXPAND | wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL );
 
+    int val = config_GetInt( p_intf, "server-port" );
     label = new wxStaticText( access_subpanels[2], -1, _("Port") );
     net_port = new wxSpinCtrl( access_subpanels[2], NetPort_Event,
-                               wxString::Format(_("%d"), 0/*val*/),
+                               wxString::Format("%d", val),
                                wxDefaultPosition, wxDefaultSize,
                                wxSP_ARROW_KEYS,
-                               0, 16000, 0/*val*/);
+                               0, 16000, val );
 
     subpanel_sizer->Add( label, 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL );
     subpanel_sizer->Add( net_port, 0,
@@ -357,7 +357,7 @@ wxPanel *SoutDialog::EncapsulationPanel( wxWindow* parent )
             new wxRadioButton( panel, EncapsulationRadio1_Event + i,
                                encapsulation_array[i] );
         panel_sizer->Add( encapsulation_radios[i], 0,
-                          wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL );
+                          wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL | wxALL, 5 );
     }
 
     panel->SetSizerAndFit( panel_sizer );