]> git.sesse.net Git - vlc/blobdiff - modules/gui/qt4/dialogs/sout.cpp
Qt: enable UDP address edit when RTP is toggled
[vlc] / modules / gui / qt4 / dialogs / sout.cpp
index 1eb7fbc2f5d2292705a9e4bca312b8cede36c286..7bf522b732cb74623028ba8545265524103a37fe 100644 (file)
@@ -199,10 +199,10 @@ SoutDialog::SoutDialog( QWidget *parent, intf_thread_t *_p_intf,
     BUTTONACT( okButton, ok() );
     BUTTONACT( cancelButton, cancel() );
 
-    if( b_transcode_only ) toggleSout();
-
     CONNECT( ui.UDPOutput, toggled( bool ), this, changeUDPandRTPmess( bool ) );
     CONNECT( ui.RTPOutput, clicked(bool), this, RTPtoggled( bool ) );
+
+    if( b_transcode_only ) toggleSout();
 }
 
 void SoutDialog::fileBrowse()
@@ -241,10 +241,18 @@ void SoutDialog::setSTranscodeOptions( bool b_trans )
 
 void SoutDialog::setRawOptions( bool b_raw )
 {
+    ui.localOutput->setEnabled( !b_raw );
+    ui.HTTPOutput->setEnabled( !b_raw );
+    ui.MMSHOutput->setEnabled( !b_raw );
+    ui.UDPOutput->setEnabled( !b_raw );
+    ui.RTPOutput->setEnabled( !b_raw );
+    ui.IcecastOutput->setEnabled( !b_raw );
+    ui.UDPRTPLabel->setEnabled( !b_raw );
+
     if( b_raw )
         ui.tabWidget->setDisabled( true );
     else
-        SoutDialog::setOptions();
+        setOptions();
 }
 
 void SoutDialog::setOptions()
@@ -282,7 +290,6 @@ void SoutDialog::setOptions()
     updateMRL();
 }
 
-//FIXME
 void SoutDialog::toggleSout()
 {
     //Toggle all the streaming options.
@@ -291,7 +298,7 @@ void SoutDialog::toggleSout()
     HIDEORSHOW( ui.HTTPEdit ) ; HIDEORSHOW( ui.RTPEdit ) ; HIDEORSHOW( ui.MMSHEdit ) ; HIDEORSHOW( ui.UDPEdit ) ;
     HIDEORSHOW( ui.HTTPLabel ) ; HIDEORSHOW( ui.RTPLabel ) ; HIDEORSHOW( ui.MMSHLabel ) ; HIDEORSHOW( ui.UDPLabel ) ;
     HIDEORSHOW( ui.HTTPPortLabel ) ; HIDEORSHOW( ui.RTPPortLabel ) ; HIDEORSHOW( ui.MMSHPortLabel ) ; HIDEORSHOW( ui.UDPPortLabel )
-    HIDEORSHOW( ui.HTTPPort ) ; HIDEORSHOW( ui.RTPPort ) ; HIDEORSHOW( ui.MMSHPort ) ; HIDEORSHOW( ui.UDPPort ) ; HIDEORSHOW( ui.RTPPortLabel2 ); HIDEORSHOW( ui.RTPPort2 );
+    HIDEORSHOW( ui.HTTPPort ) ; HIDEORSHOW( ui.RTPPort ) ; HIDEORSHOW( ui.MMSHPort ) ; HIDEORSHOW( ui.UDPPort ) ; HIDEORSHOW( ui.RTPPortLabel2 ); HIDEORSHOW( ui.RTPPort2 ); HIDEORSHOW( ui.UDPRTPLabel )
 
     HIDEORSHOW( ui.sap ); HIDEORSHOW( ui.sapName );
     HIDEORSHOW( ui.sapGroup ); HIDEORSHOW( ui.sapGroupLabel );
@@ -307,9 +314,8 @@ void SoutDialog::toggleSout()
     if( b_transcode_only ) okButton->setText( "&Save" );
     else okButton->setText( "&Stream" );
 
-    /* FIXME:
-     * The Save dialog is too big if the Stream dialog has already be shown */
-    updateGeometry();
+    setMinimumHeight( 500 );
+    resize( width(), sizeHint().height() );
 }
 
 void SoutDialog::changeUDPandRTPmess( bool b_udp )
@@ -344,6 +350,7 @@ void SoutDialog::RTPtoggled( bool b_en )
     ui.RTPLabel->setEnabled( b_en );
     ui.RTPEdit->setEnabled( b_en );
     ui.UDPOutput->setEnabled( b_en );
+    ui.UDPEdit->setEnabled( b_en );
     ui.UDPPort->setEnabled( b_en );
     ui.UDPPortLabel->setEnabled( b_en );
     ui.RTPPort2->setEnabled( b_en );
@@ -375,6 +382,7 @@ void SoutDialog::updateMRL()
     sout.b_icecast = ui.IcecastOutput->isChecked();
     sout.b_rtp = ui.RTPOutput->isChecked();
     sout.b_udp = ui.UDPOutput->isChecked();
+    sout.b_dump = ui.rawInput->isChecked();
     sout.b_sap = ui.sap->isChecked();
     sout.b_all_es = ui.soutAll->isChecked();
     sout.psz_vcodec = strdup( qtu( ui.vCodecBox->itemData( ui.vCodecBox->currentIndex() ).toString() ) );
@@ -426,7 +434,8 @@ void SoutDialog::updateMRL()
     bool trans = false;
     bool more = false;
 
-    if ( ui.transcodeVideo->isChecked() || ui.transcodeAudio->isChecked() )
+    if ( ui.transcodeVideo->isChecked() || ui.transcodeAudio->isChecked()
+         && !ui.rawInput->isChecked() /*demuxdump speciality*/ )
     {
         if ( ui.transcodeVideo->isChecked() )
         {
@@ -465,6 +474,15 @@ void SoutDialog::updateMRL()
         mrl.append( "}" );
     }
 
+    /* Special case for demuxdump */
+    if ( sout.b_file && sout.b_dump )
+    {
+        mrl = ":demux=dump :demuxdump-file=";
+        mrl.append( sout.psz_file );
+    }
+    else
+
+
     /* Protocol output */
     if ( sout.b_local || sout.b_file || sout.b_http ||
          sout.b_mms || sout.b_rtp || sout.b_udp || sout.b_icecast )