Commit 8f01bd1f authored by Francois Cartegnie's avatar Francois Cartegnie

Qt: SoutWidgets: refactor (fix #8865)

parent 5e00cfc3
...@@ -79,17 +79,28 @@ void SoutInputBox::setMRL( const QString& mrl ) ...@@ -79,17 +79,28 @@ void SoutInputBox::setMRL( const QString& mrl )
#define CT( x ) connect( x, SIGNAL(textChanged(QString)), this, SIGNAL(mrlUpdated()) ); #define CT( x ) connect( x, SIGNAL(textChanged(QString)), this, SIGNAL(mrlUpdated()) );
#define CS( x ) connect( x, SIGNAL(valueChanged(int)), this, SIGNAL(mrlUpdated()) ); #define CS( x ) connect( x, SIGNAL(valueChanged(int)), this, SIGNAL(mrlUpdated()) );
VirtualDestBox::VirtualDestBox( QWidget *_parent ) : QWidget( _parent )
{
label = new QLabel( this );
label->setWordWrap( true );
layout = new QGridLayout( this );
layout->addWidget( label, 0, 0, 1, -1);
}
VirtualDestBox::~VirtualDestBox()
{
delete label;
delete layout;
}
/* FileDest Box */ /* FileDest Box */
FileDestBox::FileDestBox( QWidget *_parent, intf_thread_t * _p_intf ) : VirtualDestBox( _parent ) FileDestBox::FileDestBox( QWidget *_parent, intf_thread_t * _p_intf ) : VirtualDestBox( _parent )
{ {
p_intf = _p_intf; p_intf = _p_intf;
QPushButton *fileSelectButton; QPushButton *fileSelectButton;
QGridLayout *layout = new QGridLayout( this );
QLabel *fileOutput = new QLabel( label->setText( qtr( "This module writes the transcoded stream to a file.") );
qtr( "This module writes the transcoded stream to a file."), this );
layout->addWidget(fileOutput, 0, 0, 1, -1);
QLabel *fileLabel = new QLabel( qtr( "Filename"), this ); QLabel *fileLabel = new QLabel( qtr( "Filename"), this );
layout->addWidget(fileLabel, 1, 0, 1, 1); layout->addWidget(fileLabel, 1, 0, 1, 1);
...@@ -144,12 +155,7 @@ void FileDestBox::fileBrowse() ...@@ -144,12 +155,7 @@ void FileDestBox::fileBrowse()
HTTPDestBox::HTTPDestBox( QWidget *_parent ) : VirtualDestBox( _parent ) HTTPDestBox::HTTPDestBox( QWidget *_parent ) : VirtualDestBox( _parent )
{ {
QGridLayout *layout = new QGridLayout( this ); label->setText( qtr( "This module outputs the transcoded stream to a network via HTTP.") );
QLabel *httpOutput = new QLabel(
qtr( "This module outputs the transcoded stream to a network via HTTP."),
this );
layout->addWidget(httpOutput, 0, 0, 1, -1);
QLabel *HTTPLabel = new QLabel( qtr("Path"), this ); QLabel *HTTPLabel = new QLabel( qtr("Path"), this );
QLabel *HTTPPortLabel = new QLabel( qtr("Port"), this ); QLabel *HTTPPortLabel = new QLabel( qtr("Port"), this );
...@@ -203,12 +209,8 @@ QString HTTPDestBox::getMRL( const QString& mux ) ...@@ -203,12 +209,8 @@ QString HTTPDestBox::getMRL( const QString& mux )
MMSHDestBox::MMSHDestBox( QWidget *_parent ) : VirtualDestBox( _parent ) MMSHDestBox::MMSHDestBox( QWidget *_parent ) : VirtualDestBox( _parent )
{ {
QGridLayout *layout = new QGridLayout( this ); label->setText( qtr( "This module outputs the transcoded stream to a network "
"via the mms protocol." ) );
QLabel *mmshOutput = new QLabel(
qtr( "This module outputs the transcoded stream to a network "
"via the mms protocol." ), this );
layout->addWidget(mmshOutput, 0, 0, 1, -1);
QLabel *MMSHLabel = new QLabel( qtr("Address"), this ); QLabel *MMSHLabel = new QLabel( qtr("Address"), this );
QLabel *MMSHPortLabel = new QLabel( qtr("Port"), this ); QLabel *MMSHPortLabel = new QLabel( qtr("Port"), this );
...@@ -248,12 +250,8 @@ QString MMSHDestBox::getMRL( const QString& ) ...@@ -248,12 +250,8 @@ QString MMSHDestBox::getMRL( const QString& )
RTSPDestBox::RTSPDestBox( QWidget *_parent ) : VirtualDestBox( _parent ) RTSPDestBox::RTSPDestBox( QWidget *_parent ) : VirtualDestBox( _parent )
{ {
QGridLayout *layout = new QGridLayout( this ); label->setText(
qtr( "This module outputs the transcoded stream to a network via RTSP." ) );
QLabel *rtspOutput = new QLabel(
qtr( "This module outputs the transcoded stream to a network via "
"RTSP." ), this );
layout->addWidget( rtspOutput, 0, 0, 1, -1 );
QLabel *RTSPLabel = new QLabel( qtr("Path"), this ); QLabel *RTSPLabel = new QLabel( qtr("Path"), this );
QLabel *RTSPPortLabel = new QLabel( qtr("Port"), this ); QLabel *RTSPPortLabel = new QLabel( qtr("Port"), this );
...@@ -298,12 +296,8 @@ QString RTSPDestBox::getMRL( const QString& ) ...@@ -298,12 +296,8 @@ QString RTSPDestBox::getMRL( const QString& )
UDPDestBox::UDPDestBox( QWidget *_parent ) : VirtualDestBox( _parent ) UDPDestBox::UDPDestBox( QWidget *_parent ) : VirtualDestBox( _parent )
{ {
QGridLayout *layout = new QGridLayout( this ); label->setText(
qtr( "This module outputs the transcoded stream to a network via UDP.") );
QLabel *udpOutput = new QLabel(
qtr( "This module outputs the transcoded stream to a network via UDP."),
this );
layout->addWidget(udpOutput, 0, 0, 1, -1);
QLabel *UDPLabel = new QLabel( qtr("Address"), this ); QLabel *UDPLabel = new QLabel( qtr("Address"), this );
QLabel *UDPPortLabel = new QLabel( qtr("Port"), this ); QLabel *UDPPortLabel = new QLabel( qtr("Port"), this );
...@@ -345,12 +339,7 @@ QString UDPDestBox::getMRL( const QString& mux ) ...@@ -345,12 +339,7 @@ QString UDPDestBox::getMRL( const QString& mux )
RTPDestBox::RTPDestBox( QWidget *_parent, const char *_mux ) RTPDestBox::RTPDestBox( QWidget *_parent, const char *_mux )
: VirtualDestBox( _parent ), mux( qfu(_mux) ) : VirtualDestBox( _parent ), mux( qfu(_mux) )
{ {
QGridLayout *layout = new QGridLayout( this ); label->setText( qtr( "This module outputs the transcoded stream to a network via RTP.") );
QLabel *rtpOutput = new QLabel(
qtr( "This module outputs the transcoded stream to a network via RTP."),
this );
layout->addWidget(rtpOutput, 0, 0, 1, -1);
QLabel *RTPLabel = new QLabel( qtr("Address"), this ); QLabel *RTPLabel = new QLabel( qtr("Address"), this );
RTPEdit = new QLineEdit(this); RTPEdit = new QLineEdit(this);
...@@ -404,12 +393,8 @@ QString RTPDestBox::getMRL( const QString& ) ...@@ -404,12 +393,8 @@ QString RTPDestBox::getMRL( const QString& )
ICEDestBox::ICEDestBox( QWidget *_parent ) : VirtualDestBox( _parent ) ICEDestBox::ICEDestBox( QWidget *_parent ) : VirtualDestBox( _parent )
{ {
QGridLayout *layout = new QGridLayout( this ); label->setText(
qtr( "This module outputs the transcoded stream to an Icecast server.") );
QLabel *iceOutput = new QLabel(
qtr( "This module outputs the transcoded stream to an Icecast server."),
this );
layout->addWidget(iceOutput, 0, 0, 1, -1);
QLabel *ICELabel = new QLabel( qtr("Address"), this ); QLabel *ICELabel = new QLabel( qtr("Address"), this );
QLabel *ICEPortLabel = new QLabel( qtr("Port"), this ); QLabel *ICEPortLabel = new QLabel( qtr("Port"), this );
......
...@@ -31,6 +31,7 @@ ...@@ -31,6 +31,7 @@
class QLineEdit; class QLineEdit;
class QLabel; class QLabel;
class QSpinBox; class QSpinBox;
class QGridLayout;
class SoutInputBox : public QGroupBox class SoutInputBox : public QGroupBox
{ {
...@@ -48,10 +49,14 @@ class VirtualDestBox : public QWidget ...@@ -48,10 +49,14 @@ class VirtualDestBox : public QWidget
{ {
Q_OBJECT Q_OBJECT
public: public:
VirtualDestBox( QWidget *_parent = NULL ) : QWidget( _parent ){} VirtualDestBox( QWidget *_parent = NULL );
virtual QString getMRL( const QString& ) = 0; virtual QString getMRL( const QString& ) = 0;
virtual ~VirtualDestBox();
protected: protected:
QString mrl; QString mrl;
protected:
QLabel *label;
QGridLayout *layout;
signals: signals:
void mrlUpdated(); void mrlUpdated();
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment