]> git.sesse.net Git - vlc/commitdiff
Try to fix Sout Dialog ( Part 1 )
authorJean-Baptiste Kempf <jb@videolan.org>
Sat, 2 Aug 2008 01:19:12 +0000 (18:19 -0700)
committerJean-Baptiste Kempf <jb@videolan.org>
Sat, 2 Aug 2008 01:21:23 +0000 (18:21 -0700)
This should fix part of the behaviour for RTP/UDP and the video/audio port.
MRL is not correct since I don't exactly  how it should look like for rtp with two ports.

modules/gui/qt4/dialogs/sout.cpp
modules/gui/qt4/dialogs/sout.hpp
modules/gui/qt4/ui/sout.ui

index 553be6aed60d8867b7fd6f0503d78cdeff2eb373..551fbc1d7edf82bc1cc583c27db7c8a231cabaee 100644 (file)
@@ -1,7 +1,7 @@
 /*****************************************************************************
  * sout.cpp : Stream output dialog ( old-style )
  ****************************************************************************
- * Copyright (C) 2006 the VideoLAN team
+ * Copyright (C) 2007-2008 the VideoLAN team
  * Copyright (C) 2007 Société des arts technologiques
  * Copyright (C) 2007 Savoir-faire Linux
  *
@@ -26,6 +26,7 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
  *****************************************************************************/
+
 #ifdef HAVE_CONFIG_H
 # include "config.h"
 #endif
@@ -103,8 +104,8 @@ SoutDialog::SoutDialog( QWidget *parent, intf_thread_t *_p_intf,
     /* UI stuff */
     ui.setupUi( this );
 
-    ui.UDPEdit->hide(); ui.UDPLabel->hide();
-    ui.UDPPort->hide(); ui.UDPPortLabel->hide();
+    changeUDPandRTPmess( false );
+
 /* ADD HERE for new profiles */
 #define ADD_PROFILE( name, shortname ) ui.profileBox->addItem( qtr( name ), QVariant( QString( shortname ) ) );
     ADD_PROFILE( "Custom" , "Custom" )
@@ -149,8 +150,10 @@ SoutDialog::SoutDialog( QWidget *parent, intf_thread_t *_p_intf,
     ADD_SCALING( "1.75" )
     ADD_SCALING( "2" )
 
-    ui.mrlEdit->setToolTip ( qtr( "Stream output string.\n This is automatically generated "
-                                                "when you change the above settings,\n but you can update it manually." ) ) ;
+    ui.mrlEdit->setToolTip ( qtr( "Stream output string.\n"
+                "This is automatically generated "
+                 "when you change the above settings,\n"
+                 "but you can update it manually." ) ) ;
 
 //     /* Connect everything to the updateMRL function */
  #define CB( x ) CONNECT( ui.x, toggled( bool ), this, updateMRL() );
@@ -192,11 +195,11 @@ SoutDialog::SoutDialog( QWidget *parent, intf_thread_t *_p_intf,
     BUTTONACT( cancelButton, cancel() );
 
     if( b_transcode_only ) toggleSout();
-}
+
+    CONNECT( ui.UDPOutput, toggled( bool ), this, changeUDPandRTPmess( bool ) );}
 
 void SoutDialog::fileBrowse()
 {
-    ui.tabWidget->setTabEnabled( 0,false );
     QString fileName = QFileDialog::getSaveFileName( this, qtr( "Save file" ), "",
         qtr( "Containers (*.ps *.ts *.mpg *.ogg *.asf *.mp4 *.mov *.wav *.raw *.flv)" ) );
     ui.fileEdit->setText( fileName );
@@ -232,18 +235,15 @@ void SoutDialog::setSTranscodeOptions( bool b_trans )
 void SoutDialog::setRawOptions( bool b_raw )
 {
     if( b_raw )
-    {
         ui.tabWidget->setDisabled( true );
-    }
     else
-    {
         SoutDialog::setOptions();
-    }
 }
 
 void SoutDialog::setOptions()
 {
-    QString profileString = ui.profileBox->itemData( ui.profileBox->currentIndex() ).toString();
+    QString profileString =
+        ui.profileBox->itemData( ui.profileBox->currentIndex() ).toString();
     msg_Dbg( p_intf, "Profile Used: %s",  qta( profileString ));
     int index;
 
@@ -267,18 +267,15 @@ void SoutDialog::setOptions()
 
         /* If the profile is not a custom one, then disable the tabWidget */
         if ( profileString == "Custom" )
-        {
             ui.tabWidget->setEnabled( true );
-        }
         else
-        {
             ui.tabWidget->setDisabled( true );
-        }
 
     /* Update the MRL !! */
     updateMRL();
 }
 
+//FIXME
 void SoutDialog::toggleSout()
 {
     //Toggle all the streaming options.
@@ -298,14 +295,27 @@ void SoutDialog::toggleSout()
     updateGeometry();
 }
 
+void SoutDialog::changeUDPandRTPmess( bool b_udp )
+{
+    ui.RTPEdit->setVisible( !b_udp );
+    ui.RTPLabel->setVisible( !b_udp );
+    ui.RTPPort->setVisible( !b_udp );
+    ui.RTPPortLabel->setVisible( !b_udp );
+    ui.UDPEdit->setVisible( b_udp );
+    ui.UDPLabel->setVisible( b_udp );
+    ui.UDPPortLabel->setText( b_udp ? qtr( "Port:") : qtr( "Video Port:" ) );
+    ui.RTPPortLabel->setText( b_udp ? qtr( "Port:") : qtr( "Audio Port:" ) );
+}
+
 void SoutDialog::ok()
 {
     mrl = ui.mrlEdit->text();
     accept();
 }
+
 void SoutDialog::cancel()
 {
-    mrl = ui.mrlEdit->text();
+    mrl.clear();
     reject();
 }
 
@@ -411,7 +421,8 @@ void SoutDialog::updateMRL()
         mrl.append( "}" );
     }
 
-    if ( sout.b_local || sout.b_file || sout.b_http || sout.b_mms || sout.b_rtp || sout.b_udp )
+    if ( sout.b_local || sout.b_file || sout.b_http ||
+         sout.b_mms || sout.b_rtp || sout.b_udp )
     {
 
 #define ISMORE() if ( more ) mrl.append( "," );
index 72e61dce53bc6a55ec6374f2a1d07f79f6942574..8f477960610dcbdcea56dcc264854073e493873c 100644 (file)
@@ -86,6 +86,7 @@ private slots:
     void setATranscodeOptions( bool );
     void setSTranscodeOptions( bool );
     void setRawOptions( bool );
+    void changeUDPandRTPmess( bool );
 };
 
 #endif
index 509011876f6e550e417095c6fd9d39f7d3fb9eeb..30f133f66dcc5e2fbb69a23a061f44f025193433 100644 (file)
@@ -6,8 +6,8 @@
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>617</width>
-    <height>678</height>
+    <width>726</width>
+    <height>782</height>
    </rect>
   </property>
   <property name="sizePolicy" >
         </item>
         <item row="5" column="0" >
          <widget class="QCheckBox" name="UDPOutput" >
+          <property name="enabled" >
+           <bool>false</bool>
+          </property>
           <property name="toolTip" >
            <string>_("Using this option is not recommended in most of the cases.")</string>
           </property>
         </item>
         <item row="5" column="1" >
          <widget class="QLabel" name="UDPLabel" >
+          <property name="enabled" >
+           <bool>true</bool>
+          </property>
           <property name="text" >
            <string>_("Address")</string>
           </property>
          </widget>
         </item>
         <item row="5" column="2" >
-         <widget class="QLineEdit" name="UDPEdit" />
+         <widget class="QLineEdit" name="UDPEdit" >
+          <property name="enabled" >
+           <bool>true</bool>
+          </property>
+         </widget>
         </item>
         <item row="5" column="3" >
          <widget class="QLabel" name="UDPPortLabel" >
+          <property name="enabled" >
+           <bool>false</bool>
+          </property>
           <property name="text" >
            <string>_("Port")</string>
           </property>
         </item>
         <item row="5" column="4" >
          <widget class="QSpinBox" name="UDPPort" >
+          <property name="enabled" >
+           <bool>false</bool>
+          </property>
           <property name="maximumSize" >
            <size>
             <width>90</width>
       <number>1</number>
      </property>
      <widget class="QWidget" name="muxer" >
+      <property name="geometry" >
+       <rect>
+        <x>0</x>
+        <y>0</y>
+        <width>704</width>
+        <height>148</height>
+       </rect>
+      </property>
       <attribute name="title" >
        <string>_("Encapsulation")</string>
       </attribute>
       <property name="enabled" >
        <bool>true</bool>
       </property>
+      <property name="geometry" >
+       <rect>
+        <x>0</x>
+        <y>0</y>
+        <width>704</width>
+        <height>148</height>
+       </rect>
+      </property>
       <attribute name="title" >
        <string>_("Video codec")</string>
       </attribute>
       </layout>
      </widget>
      <widget class="QWidget" name="audioCodec" >
+      <property name="geometry" >
+       <rect>
+        <x>0</x>
+        <y>0</y>
+        <width>704</width>
+        <height>148</height>
+       </rect>
+      </property>
       <attribute name="title" >
        <string>_("Audio codec")</string>
       </attribute>
       </layout>
      </widget>
      <widget class="QWidget" name="subtitles" >
+      <property name="geometry" >
+       <rect>
+        <x>0</x>
+        <y>0</y>
+        <width>704</width>
+        <height>148</height>
+       </rect>
+      </property>
       <attribute name="title" >
        <string>_("Subtitles")</string>
       </attribute>
        <property name="orientation" >
         <enum>Qt::Horizontal</enum>
        </property>
-       <property name="sizeHint" >
+       <property name="sizeHint" stdset="0" >
         <size>
          <width>40</width>
          <height>20</height>
     </hint>
    </hints>
   </connection>
-  <connection>
-   <sender>rawInput</sender>
-   <signal>clicked(bool)</signal>
-   <receiver>RTPOutput</receiver>
-   <slot>setDisabled(bool)</slot>
-   <hints>
-    <hint type="sourcelabel" >
-     <x>595</x>
-     <y>75</y>
-    </hint>
-    <hint type="destinationlabel" >
-     <x>66</x>
-     <y>172</y>
-    </hint>
-   </hints>
-  </connection>
-  <connection>
-   <sender>rawInput</sender>
-   <signal>clicked(bool)</signal>
-   <receiver>MMSHOutput</receiver>
-   <slot>setDisabled(bool)</slot>
-   <hints>
-    <hint type="sourcelabel" >
-     <x>485</x>
-     <y>92</y>
-    </hint>
-    <hint type="destinationlabel" >
-     <x>46</x>
-     <y>141</y>
-    </hint>
-   </hints>
-  </connection>
-  <connection>
-   <sender>UDPOutput</sender>
-   <signal>toggled(bool)</signal>
-   <receiver>UDPPort</receiver>
-   <slot>setVisible(bool)</slot>
-   <hints>
-    <hint type="sourcelabel" >
-     <x>98</x>
-     <y>212</y>
-    </hint>
-    <hint type="destinationlabel" >
-     <x>493</x>
-     <y>212</y>
-    </hint>
-   </hints>
-  </connection>
-  <connection>
-   <sender>UDPOutput</sender>
-   <signal>toggled(bool)</signal>
-   <receiver>UDPPortLabel</receiver>
-   <slot>setVisible(bool)</slot>
-   <hints>
-    <hint type="sourcelabel" >
-     <x>107</x>
-     <y>212</y>
-    </hint>
-    <hint type="destinationlabel" >
-     <x>396</x>
-     <y>212</y>
-    </hint>
-   </hints>
-  </connection>
-  <connection>
-   <sender>UDPOutput</sender>
-   <signal>toggled(bool)</signal>
-   <receiver>UDPLabel</receiver>
-   <slot>setVisible(bool)</slot>
-   <hints>
-    <hint type="sourcelabel" >
-     <x>107</x>
-     <y>212</y>
-    </hint>
-    <hint type="destinationlabel" >
-     <x>241</x>
-     <y>212</y>
-    </hint>
-   </hints>
-  </connection>
-  <connection>
-   <sender>UDPOutput</sender>
-   <signal>toggled(bool)</signal>
-   <receiver>UDPEdit</receiver>
-   <slot>setVisible(bool)</slot>
-   <hints>
-    <hint type="sourcelabel" >
-     <x>107</x>
-     <y>212</y>
-    </hint>
-    <hint type="destinationlabel" >
-     <x>315</x>
-     <y>212</y>
-    </hint>
-   </hints>
-  </connection>
   <connection>
    <sender>IcecastOutput</sender>
    <signal>clicked(bool)</signal>
     </hint>
    </hints>
   </connection>
+  <connection>
+   <sender>RTPOutput</sender>
+   <signal>clicked(bool)</signal>
+   <receiver>UDPOutput</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel" >
+     <x>110</x>
+     <y>190</y>
+    </hint>
+    <hint type="destinationlabel" >
+     <x>110</x>
+     <y>225</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>RTPOutput</sender>
+   <signal>clicked(bool)</signal>
+   <receiver>UDPPort</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel" >
+     <x>110</x>
+     <y>190</y>
+    </hint>
+    <hint type="destinationlabel" >
+     <x>597</x>
+     <y>225</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>RTPOutput</sender>
+   <signal>clicked(bool)</signal>
+   <receiver>UDPPortLabel</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel" >
+     <x>110</x>
+     <y>190</y>
+    </hint>
+    <hint type="destinationlabel" >
+     <x>497</x>
+     <y>225</y>
+    </hint>
+   </hints>
+  </connection>
  </connections>
 </ui>