Commit f9ff5b64 authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

Qt4 - Use a main instance of Sout for VLM. Clean DP since all dialogs (except...

Qt4 - Use a main instance of Sout for VLM. Clean DP since all dialogs (except Bookmarks that won't be done...) are done.
parent 890b8c21
......@@ -339,7 +339,7 @@ void OpenDialog::stream( bool b_transcode_only )
{
mrl = ui.advancedLineInput->text();
toggleVisible();
THEDP->streamingDialog( mrl, b_transcode_only );
THEDP->streamingDialog( this, mrl, b_transcode_only );
}
/* Update the MRL */
......
/*****************************************************************************
* sout.cpp : Stream output dialog ( old-style )
****************************************************************************
* Copyright ( C ) 2006 the VideoLAN team
* Copyright (C) 2006 the VideoLAN team
* Copyright (C) 2007 Société des arts technologiques
* Copyright (C) 2007 Savoir-faire Linux
*
......@@ -135,11 +135,6 @@ SoutDialog::SoutDialog( QWidget *parent, intf_thread_t *_p_intf,
if( b_transcode_only ) toggleSout();
}
QString SoutDialog::getMrl()
{
return mrl;
}
void SoutDialog::fileBrowse()
{
ui.tabWidget->setTabEnabled( 0,false );
......
......@@ -39,13 +39,33 @@ class SoutDialog : public QVLCDialog
{
Q_OBJECT;
public:
static SoutDialog * getInstance( QWidget *parent,
intf_thread_t *p_intf,
bool transcode_only )
{
if( !instance )
instance = new SoutDialog( parent, p_intf, transcode_only );
else
{
instance->setParent( parent );
if( transcode_only != instance->b_transcode_only )
{
instance->toggleSout();
instance->b_transcode_only = transcode_only;
}
}
return instance;
};
virtual ~SoutDialog();
QString getMrl(){ return mrl; }
private:
SoutDialog( QWidget* parent, intf_thread_t *,
bool _transcode_only = false );
virtual ~SoutDialog() {}
static SoutDialog *instance;
QString getMrl();
//sout_gui_descr_t *sout;
private:
Ui::Sout ui;
QPushButton *okButton;
QString mrl;
......
......@@ -25,6 +25,7 @@
#include "dialogs/vlm.hpp"
#include "dialogs/open.hpp"
#include "dialogs/sout.hpp"
#include <QString>
#include <QComboBox>
......@@ -138,6 +139,7 @@ VLMDialog::VLMDialog( intf_thread_t *_p_intf ) : QVLCFrame( _p_intf )
BUTTONACT( ui.clearButton, clearWidgets() );
BUTTONACT( ui.saveButton, saveModifications() );
BUTTONACT( ui.inputButton, selectInput() );
BUTTONACT( ui.outputButton, selectOutput() );
}
VLMDialog::~VLMDialog()
......@@ -248,6 +250,13 @@ void VLMDialog::selectInput()
ui.inputLedit->setText( o->getMRL() );
}
void VLMDialog::selectOutput()
{
SoutDialog *s = SoutDialog::getInstance( this, p_intf, false );
if( s->exec() == QDialog::Accepted )
ui.outputLedit->setText( s->getMrl() );
}
/* Object Modification */
void VLMDialog::removeVLMItem( VLMAWidget *vlmObj )
{
......
......@@ -100,6 +100,7 @@ private slots:
void showScheduleWidget( int );
void selectVLMItem( int );
void selectInput();
void selectOutput();
};
class VLMWrapper
......
......@@ -133,6 +133,7 @@ void DialogsProvider::customEvent( QEvent *event )
updateDialog(); break;
#endif
case INTF_DIALOG_EXIT:
quit(); break;
default:
msg_Warn( p_intf, "unimplemented dialog" );
}
......@@ -414,10 +415,11 @@ void DialogsProvider::saveAPlaylist()
* Sout emulation
****************************************************************************/
void DialogsProvider::streamingDialog( QString mrl, bool b_transcode_only )
void DialogsProvider::streamingDialog( QWidget *parent, QString mrl,
bool b_transcode_only )
{
SoutDialog *s = new SoutDialog( p_intf->p_sys->p_mi, p_intf,
b_transcode_only );
SoutDialog *s = SoutDialog::getInstance( parent, p_intf, b_transcode_only );
if( s->exec() == QDialog::Accepted )
{
msg_Err( p_intf, "Sout mrl %s", qta( s->getMrl() ) );
......@@ -430,7 +432,6 @@ void DialogsProvider::streamingDialog( QString mrl, bool b_transcode_only )
PLAYLIST_APPEND | PLAYLIST_GO, PLAYLIST_END,
-1, &psz_option, 1, VLC_TRUE, VLC_FALSE );
}
delete s;
}
void DialogsProvider::openThenStreamingDialogs()
......@@ -444,29 +445,6 @@ void DialogsProvider::openThenTranscodingDialogs()
OpenDialog::getInstance( p_intf->p_sys->p_mi , p_intf, OPEN_AND_SAVE )
->showTab( 0 );
}
/*
void DialogsProvider::streamingDialog()
{
OpenDialog *o = new OpenDialog( p_intf->p_sys->p_mi, p_intf, true );
if ( o->exec() == QDialog::Accepted )
{
SoutDialog *s = new SoutDialog( p_intf->p_sys->p_mi, p_intf );
if( s->exec() == QDialog::Accepted )
{
msg_Err(p_intf, "mrl %s\n", qta(s->mrl));
/* Just do it
int i_len = strlen( qtu(s->mrl) ) + 10;
char *psz_option = (char*)malloc(i_len);
snprintf( psz_option, i_len - 1, ":sout=%s", qtu(s->mrl));
playlist_AddExt( THEPL, qtu( o->mrl ), "Streaming",
PLAYLIST_APPEND | PLAYLIST_GO, PLAYLIST_END,
-1, &psz_option, 1, VLC_TRUE, VLC_FALSE );
}
delete s;
}
delete o;
}*/
/****************************************************************************
......
......@@ -95,6 +95,8 @@ class QVLCMenu;
class DialogsProvider : public QObject
{
Q_OBJECT;
friend class QVLCMenu;
public:
static DialogsProvider *getInstance()
{
......@@ -121,11 +123,11 @@ public:
EXT_FILTER_PLAYLIST,
QString path = QString() );
protected:
friend class QVLCMenu;
QSignalMapper *menusMapper;
QSignalMapper *menusUpdateMapper;
QSignalMapper *SDMapper;
void customEvent( QEvent *);
private:
DialogsProvider( intf_thread_t *);
intf_thread_t *p_intf;
......@@ -170,7 +172,8 @@ public slots:
void PLAppendDir();
void MLAppendDir();
void streamingDialog( QString mrl = "", bool b_stream = true );
void streamingDialog( QWidget *parent, QString mrl = "",
bool b_stream = true );
void openThenStreamingDialogs();
void openThenTranscodingDialogs();
......
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