[vlc-devel] [PATCH v3 1/3] qt: rename SoutMrl to SoutChain

Jérôme Froissart software at froissart.eu
Mon Oct 28 22:15:47 CET 2019


---
 .../qt/components/sout/profile_selector.cpp   |  8 ++--
 .../gui/qt/components/sout/sout_widgets.cpp   | 36 +++++++++---------
 modules/gui/qt/dialogs/convert.cpp            |  2 +-
 modules/gui/qt/dialogs/sout.cpp               | 38 +++++++++----------
 modules/gui/qt/dialogs/sout.hpp               | 14 +++----
 modules/gui/qt/dialogs/vlm.cpp                |  4 +-
 modules/gui/qt/dialogs_provider.cpp           |  4 +-
 7 files changed, 53 insertions(+), 53 deletions(-)

diff --git a/modules/gui/qt/components/sout/profile_selector.cpp b/modules/gui/qt/components/sout/profile_selector.cpp
index 586a01f681..fca708d0c8 100644
--- a/modules/gui/qt/components/sout/profile_selector.cpp
+++ b/modules/gui/qt/components/sout/profile_selector.cpp
@@ -242,7 +242,7 @@ void VLCProfileSelector::updateOptions( int i )
     }\
     else value = QString()

-    SoutMrl smrl;
+    SoutChain smrl;
     smrl.begin( "transcode" );

     /* First muxer options */
@@ -358,7 +358,7 @@ void VLCProfileSelector::updateOptions( int i )
     smrl.end();
 #undef HASHPICK

-    transcode = smrl.getMrl();
+    transcode = smrl.to_string();

     cleanup:
     /* Temp hash tables cleanup */
@@ -376,7 +376,7 @@ void VLCProfileSelector::updateOptionsOldFormat( int i )

     mux = options[0];

-    SoutMrl smrl;
+    SoutChain smrl;
     if( options[1].toInt() || options[2].toInt() || options[3].toInt() )
     {
         smrl.begin( "transcode" );
@@ -418,7 +418,7 @@ void VLCProfileSelector::updateOptionsOldFormat( int i )

         smrl.end();

-        transcode = smrl.getMrl();
+        transcode = smrl.to_string();
     }
     else
         transcode = "";
diff --git a/modules/gui/qt/components/sout/sout_widgets.cpp b/modules/gui/qt/components/sout/sout_widgets.cpp
index 8eb9cccea3..86528283cf 100644
--- a/modules/gui/qt/components/sout/sout_widgets.cpp
+++ b/modules/gui/qt/components/sout/sout_widgets.cpp
@@ -144,7 +144,7 @@ QString FileDestBox::getMRL( const QString& mux )
 {
     if( fileEdit->text().isEmpty() ) return "";

-    SoutMrl m;
+    SoutChain m;
     m.begin( "file" );
     QString outputfile = fileEdit->text();
     if( !mux.isEmpty() )
@@ -163,7 +163,7 @@ QString FileDestBox::getMRL( const QString& mux )
     m.option( "no-overwrite" );
     m.end();

-    return m.getMrl();
+    return m.to_string();
 }

 void FileDestBox::fileBrowse()
@@ -214,7 +214,7 @@ QString HTTPDestBox::getMRL( const QString& mux )
     port.setNum( HTTPPort->value() );
     QString dst = ":" + port + path;

-    SoutMrl m;
+    SoutChain m;
     m.begin( "http" );
     /* Path-extension is primary muxer to use if possible,
        otherwise check for mux-choise and see that it isn't mp4
@@ -229,7 +229,7 @@ QString HTTPDestBox::getMRL( const QString& mux )
     m.option( "dst", dst );
     m.end();

-    return m.getMrl();
+    return m.to_string();
 }

 MMSHDestBox::MMSHDestBox( QWidget *_parent ) : VirtualDestBox( _parent )
@@ -262,14 +262,14 @@ QString MMSHDestBox::getMRL( const QString& )
 {
     if( MMSHEdit->text().isEmpty() ) return "";

-    SoutMrl m;
+    SoutChain m;
     m.begin( "std" );
     m.option(  "access", "mmsh" );
     m.option( "mux", "asfh" );
     m.option( "dst", MMSHEdit->text(), MMSHPort->value() );
     m.end();

-    return m.getMrl();
+    return m.to_string();
 }


@@ -310,12 +310,12 @@ QString RTSPDestBox::getMRL( const QString& )
     port.setNum( RTSPPort->value() );
     QString sdp = "rtsp://:" + port + path;

-    SoutMrl m;
+    SoutChain m;
     m.begin( "rtp" );
     m.option( "sdp", sdp );
     m.end();

-    return m.getMrl();
+    return m.to_string();
 }


@@ -348,7 +348,7 @@ QString UDPDestBox::getMRL( const QString& mux )
 {
     if( UDPEdit->text().isEmpty() ) return "";

-    SoutMrl m;
+    SoutChain m;
     m.begin( "udp" );
     /* udp output, ts-mux is really only reasonable one to use*/
     if( !mux.isEmpty() && !mux.compare("ts" ) )
@@ -356,7 +356,7 @@ QString UDPDestBox::getMRL( const QString& mux )
     m.option( "dst", UDPEdit->text(), UDPPort->value() );
     m.end();

-    return m.getMrl();
+    return m.to_string();
 }

 SRTDestBox::SRTDestBox(QWidget *_parent, const char *_mux) :
@@ -400,7 +400,7 @@ QString SRTDestBox::getMRL(const QString&)
     if (addr.isEmpty())
         return qfu( "" );
     QString destination = addr + ":" + QString::number( SRTPort->value() );
-    SoutMrl m;
+    SoutChain m;
     m.begin( "srt" );
     m.option( "dst", destination );
     /* mp4-mux ain't usable in rtp-output either */
@@ -412,7 +412,7 @@ QString SRTDestBox::getMRL(const QString&)
     }
     m.end();

-    return m.getMrl();
+    return m.to_string();
 }

 RISTDestBox::RISTDestBox( QWidget *_parent, const char *_mux )
@@ -452,7 +452,7 @@ QString RISTDestBox::getMRL( const QString& )

     if( addr.isEmpty() ) return qfu("");
     QString destination = addr + ":" + QString::number(RISTPort->value());
-    SoutMrl m;
+    SoutChain m;
     m.begin( "std" );
     if( !name.isEmpty() )
     {
@@ -466,7 +466,7 @@ QString RISTDestBox::getMRL( const QString& )
     m.option( "dst", destination );
     m.end();

-    return m.getMrl();
+    return m.to_string();
 }


@@ -507,7 +507,7 @@ QString RTPDestBox::getMRL( const QString& )

     if( addr.isEmpty() ) return qfu("");

-    SoutMrl m;
+    SoutChain m;
     m.begin( "rtp" );
     m.option( "dst", RTPEdit->text() );
     m.option( "port", RTPPort->value() );
@@ -521,7 +521,7 @@ QString RTPDestBox::getMRL( const QString& )
     }
     m.end();

-    return m.getMrl();
+    return m.to_string();
 }


@@ -569,7 +569,7 @@ QString ICEDestBox::getMRL( const QString& )
 {
     if( ICEEdit->text().isEmpty() ) return "";

-    SoutMrl m;
+    SoutChain m;
     m.begin( "std" );
     m.option( "access", "shout" );
     m.option( "mux", "ogg" );
@@ -581,6 +581,6 @@ QString ICEDestBox::getMRL( const QString& )

     m.option( "dst", url );
     m.end();
-    return m.getMrl();
+    return m.to_string();
 }

diff --git a/modules/gui/qt/dialogs/convert.cpp b/modules/gui/qt/dialogs/convert.cpp
index cf157472b6..a6505a6fd0 100644
--- a/modules/gui/qt/dialogs/convert.cpp
+++ b/modules/gui/qt/dialogs/convert.cpp
@@ -236,7 +236,7 @@ void ConvertDialog::close()
             else
                 mrl += chain;
         }
-        msg_Dbg( p_intf, "Transcode MRL: %s", qtu( mrl ) );
+        msg_Dbg( p_intf, "Transcode chain: %s", qtu( mrl ) );
         mrls.append(mrl);
     }
     accept();
diff --git a/modules/gui/qt/dialogs/sout.cpp b/modules/gui/qt/dialogs/sout.cpp
index bbcc308d63..21457d5807 100644
--- a/modules/gui/qt/dialogs/sout.cpp
+++ b/modules/gui/qt/dialogs/sout.cpp
@@ -36,7 +36,7 @@
 #include <QSpinBox>
 #include <assert.h>

-SoutDialog::SoutDialog( QWidget *parent, intf_thread_t *_p_intf, const QString& inputMRL )
+SoutDialog::SoutDialog( QWidget *parent, intf_thread_t *_p_intf, const QString& inputChain )
            : QWizard( parent )
 {
     p_intf = _p_intf;
@@ -46,7 +46,7 @@ SoutDialog::SoutDialog( QWidget *parent, intf_thread_t *_p_intf, const QString&

     /* UI stuff */
     ui.setupUi( this );
-    ui.inputBox->setMRL( inputMRL );
+    ui.inputBox->setMRL( inputChain );
     ui.helpEdit->setPlainText( qtr("This wizard will allow you to stream or "
             "convert your media for use locally, on your private network, "
             "or on the Internet.\n"
@@ -78,16 +78,16 @@ SoutDialog::SoutDialog( QWidget *parent, intf_thread_t *_p_intf, const QString&

     BUTTONACT( ui.addButton, addDest() );

-//     /* Connect everything to the updateMRL function */
-#define CB( x ) CONNECT( ui.x, toggled( bool ), this, updateMRL() );
-#define CT( x ) CONNECT( ui.x, textChanged( const QString& ), this, updateMRL() );
-#define CS( x ) CONNECT( ui.x, valueChanged( int ), this, updateMRL() );
-#define CC( x ) CONNECT( ui.x, currentIndexChanged( int ), this, updateMRL() );
+//     /* Connect everything to the updateChain function */
+#define CB( x ) CONNECT( ui.x, toggled( bool ), this, updateChain() );
+#define CT( x ) CONNECT( ui.x, textChanged( const QString& ), this, updateChain() );
+#define CS( x ) CONNECT( ui.x, valueChanged( int ), this, updateChain() );
+#define CC( x ) CONNECT( ui.x, currentIndexChanged( int ), this, updateChain() );

     /* Misc */
     CB( soutAll );
     CB( localOutput ); CB( transcodeBox );
-    CONNECT( ui.profileSelect, optionsChanged(), this, updateMRL() );
+    CONNECT( ui.profileSelect, optionsChanged(), this, updateChain() );

     setButtonText( QWizard::BackButton, qtr("Back") );
     setButtonText( QWizard::CancelButton, qtr("Cancel") );
@@ -107,7 +107,7 @@ void SoutDialog::closeTab( int i )
     QWidget* temp = ui.destTab->widget( i );
     ui.destTab->removeTab( i );
     delete temp;
-    updateMRL();
+    updateChain();
 }

 void SoutDialog::addDest( )
@@ -163,22 +163,22 @@ void SoutDialog::addDest( )
     }

     int index = ui.destTab->addTab( db, caption );
-    CONNECT( db, mrlUpdated(), this, updateMRL() );
+    CONNECT( db, mrlUpdated(), this, updateChain() );
     ui.destTab->setCurrentIndex( index );
-    updateMRL();
+    updateChain();
 }

 void SoutDialog::done( int r )
 {
-    mrl = ui.mrlEdit->toPlainText();
+    chain = ui.mrlEdit->toPlainText();
     QWizard::done(r);
 }

-void SoutDialog::updateMRL()
+void SoutDialog::updateChain()
 {
     QString qs_mux = ui.profileSelect->getMux();

-    SoutMrl smrl( ":sout=#" );
+    SoutChain smrl( ":sout=#" );
     if( !ui.profileSelect->getTranscode().isEmpty() && ui.transcodeBox->isChecked() )
     {
         smrl.begin( ui.profileSelect->getTranscode() );
@@ -224,15 +224,15 @@ void SoutDialog::updateMRL()

     if ( multi ) smrl.end();

-    mrl = smrl.getMrl();
+    chain = smrl.to_string();

     if( ui.soutAll->isChecked() )
-        mrl.append( " :sout-all" );
+        chain.append( " :sout-all" );
     else
-        mrl.append( " :no-sout-all" );
+        chain.append( " :no-sout-all" );

-    mrl.append( " :sout-keep" );
+    chain.append( " :sout-keep" );

-    ui.mrlEdit->setPlainText( mrl );
+    ui.mrlEdit->setPlainText( chain );
 }

diff --git a/modules/gui/qt/dialogs/sout.hpp b/modules/gui/qt/dialogs/sout.hpp
index 909dcf80bf..e57aa39bc8 100644
--- a/modules/gui/qt/dialogs/sout.hpp
+++ b/modules/gui/qt/dialogs/sout.hpp
@@ -36,17 +36,17 @@

 class QPushButton;

-class SoutMrl
+class SoutChain
 {
 public:
-    SoutMrl( const QString& head = "")
+    SoutChain( const QString& head = "")
     {
         mrl = head;
         b_first = true;
         b_has_bracket = false;
     }

-    QString getMrl()
+    QString to_string()
     {
         return mrl;
     }
@@ -110,23 +110,23 @@ class SoutDialog : public QWizard
 {
     Q_OBJECT
 public:
-    SoutDialog( QWidget* parent, intf_thread_t *, const QString& mrl = "");
+    SoutDialog( QWidget* parent, intf_thread_t *, const QString& chain = "");
     virtual ~SoutDialog(){}

-    QString getMrl(){ return mrl; }
+    QString getChain(){ return chain; }

 protected:
     virtual void done( int );
 private:
     Ui::Sout ui;

-    QString mrl;
+    QString chain;
     QPushButton *okButton;

     intf_thread_t* p_intf;

 public slots:
-    void updateMRL();
+    void updateChain();

 private slots:
     void closeTab( int );
diff --git a/modules/gui/qt/dialogs/vlm.cpp b/modules/gui/qt/dialogs/vlm.cpp
index 8034bf0edd..bd9742782f 100644
--- a/modules/gui/qt/dialogs/vlm.cpp
+++ b/modules/gui/qt/dialogs/vlm.cpp
@@ -378,8 +378,8 @@ void VLMDialog::selectOutput()
     SoutDialog *s = new SoutDialog( this, p_intf );
     if( s->exec() == QDialog::Accepted )
     {
-        int i = s->getMrl().indexOf( " " );
-        ui.outputLedit->setText( s->getMrl().left( i ) );
+        int i = s->getChain().indexOf( " " );
+        ui.outputLedit->setText( s->getChain().left( i ) );
     }
 }

diff --git a/modules/gui/qt/dialogs_provider.cpp b/modules/gui/qt/dialogs_provider.cpp
index 0603d31707..70551ea47d 100644
--- a/modules/gui/qt/dialogs_provider.cpp
+++ b/modules/gui/qt/dialogs_provider.cpp
@@ -679,7 +679,7 @@ void DialogsProvider::streamingDialog( QWidget *parent,
         s->setAttribute( Qt::WA_QuitOnClose, false ); // See #4883
         if( s->exec() == QDialog::Accepted )
         {
-            outputMRLs.append(s->getMrl());
+            outputMRLs.append(s->getChain());
             delete s;
         }
         else
@@ -704,7 +704,7 @@ void DialogsProvider::streamingDialog( QWidget *parent,
         }
     }

-    /* Get SoutMRL(s) */
+    /* Get SoutChain(s) */
     if( !outputMRLs.isEmpty() )
     {
         QVector<vlc::playlist::Media> outputMedias;
--
2.20.1



More information about the vlc-devel mailing list