From 61930d9a77d4121ee7b2f0be0a205340df078233 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Kempf Date: Fri, 1 Aug 2008 18:19:12 -0700 Subject: [PATCH] Try to fix Sout Dialog ( Part 1 ) 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 | 47 +++++--- modules/gui/qt4/dialogs/sout.hpp | 1 + modules/gui/qt4/ui/sout.ui | 200 +++++++++++++++---------------- 3 files changed, 130 insertions(+), 118 deletions(-) diff --git a/modules/gui/qt4/dialogs/sout.cpp b/modules/gui/qt4/dialogs/sout.cpp index 553be6aed6..551fbc1d7e 100644 --- a/modules/gui/qt4/dialogs/sout.cpp +++ b/modules/gui/qt4/dialogs/sout.cpp @@ -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( "," ); diff --git a/modules/gui/qt4/dialogs/sout.hpp b/modules/gui/qt4/dialogs/sout.hpp index 72e61dce53..8f47796061 100644 --- a/modules/gui/qt4/dialogs/sout.hpp +++ b/modules/gui/qt4/dialogs/sout.hpp @@ -86,6 +86,7 @@ private slots: void setATranscodeOptions( bool ); void setSTranscodeOptions( bool ); void setRawOptions( bool ); + void changeUDPandRTPmess( bool ); }; #endif diff --git a/modules/gui/qt4/ui/sout.ui b/modules/gui/qt4/ui/sout.ui index 509011876f..30f133f66d 100644 --- a/modules/gui/qt4/ui/sout.ui +++ b/modules/gui/qt4/ui/sout.ui @@ -6,8 +6,8 @@ 0 0 - 617 - 678 + 726 + 782 @@ -279,6 +279,9 @@ + + false + _("Using this option is not recommended in most of the cases.") @@ -289,16 +292,26 @@ + + true + _("Address") - + + + true + + + + false + _("Port") @@ -309,6 +322,9 @@ + + false + 90 @@ -445,6 +461,14 @@ 1 + + + 0 + 0 + 704 + 148 + + _("Encapsulation") @@ -532,6 +556,14 @@ true + + + 0 + 0 + 704 + 148 + + _("Video codec") @@ -621,6 +653,14 @@ + + + 0 + 0 + 704 + 148 + + _("Audio codec") @@ -713,6 +753,14 @@ + + + 0 + 0 + 704 + 148 + + _("Subtitles") @@ -851,7 +899,7 @@ Qt::Horizontal - + 40 20 @@ -1224,102 +1272,6 @@ - - rawInput - clicked(bool) - RTPOutput - setDisabled(bool) - - - 595 - 75 - - - 66 - 172 - - - - - rawInput - clicked(bool) - MMSHOutput - setDisabled(bool) - - - 485 - 92 - - - 46 - 141 - - - - - UDPOutput - toggled(bool) - UDPPort - setVisible(bool) - - - 98 - 212 - - - 493 - 212 - - - - - UDPOutput - toggled(bool) - UDPPortLabel - setVisible(bool) - - - 107 - 212 - - - 396 - 212 - - - - - UDPOutput - toggled(bool) - UDPLabel - setVisible(bool) - - - 107 - 212 - - - 241 - 212 - - - - - UDPOutput - toggled(bool) - UDPEdit - setVisible(bool) - - - 107 - 212 - - - 315 - 212 - - - IcecastOutput clicked(bool) @@ -1448,5 +1400,53 @@ + + RTPOutput + clicked(bool) + UDPOutput + setEnabled(bool) + + + 110 + 190 + + + 110 + 225 + + + + + RTPOutput + clicked(bool) + UDPPort + setEnabled(bool) + + + 110 + 190 + + + 597 + 225 + + + + + RTPOutput + clicked(bool) + UDPPortLabel + setEnabled(bool) + + + 110 + 190 + + + 497 + 225 + + + -- 2.39.2