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

Qt: split correctly the input options for Convertion and Sout Dialogs.

parent b42755d7
...@@ -903,7 +903,7 @@ void PLModel::popupSave() ...@@ -903,7 +903,7 @@ void PLModel::popupSave()
{ {
QStringList mrls = selectedURIs(); QStringList mrls = selectedURIs();
if( !mrls.isEmpty() ) if( !mrls.isEmpty() )
THEDP->streamingDialog( NULL, mrls[0], true ); THEDP->streamingDialog( NULL, mrls[0] );
} }
#include <QUrl> #include <QUrl>
......
...@@ -360,7 +360,8 @@ void OpenDialog::finish( bool b_enqueue = false ) ...@@ -360,7 +360,8 @@ void OpenDialog::finish( bool b_enqueue = false )
QString qs = optionsList[j].trimmed(); QString qs = optionsList[j].trimmed();
if( !qs.isEmpty() ) if( !qs.isEmpty() )
{ {
input_item_AddOption( p_input, qtu( qs ), VLC_INPUT_OPTION_TRUSTED ); input_item_AddOption( p_input, qtu( qs ),
VLC_INPUT_OPTION_TRUSTED );
#ifdef DEBUG_QT #ifdef DEBUG_QT
msg_Warn( p_intf, "Input option: %s", qtu( qs ) ); msg_Warn( p_intf, "Input option: %s", qtu( qs ) );
#endif #endif
...@@ -387,13 +388,14 @@ void OpenDialog::transcode() ...@@ -387,13 +388,14 @@ void OpenDialog::transcode()
void OpenDialog::stream( bool b_transcode_only ) void OpenDialog::stream( bool b_transcode_only )
{ {
QString soutMRL = getMRL(); QString soutMRL = getMRL( false );
if( soutMRL.isEmpty() ) return; if( soutMRL.isEmpty() ) return;
toggleVisible(); toggleVisible();
/* Dbg and send :D */ /* Dbg and send :D */
msg_Dbg( p_intf, "MRL passed to the Sout: %s", qtu( soutMRL ) ); msg_Dbg( p_intf, "MRL passed to the Sout: %s", qtu( soutMRL ) );
THEDP->streamingDialog( this, soutMRL, b_transcode_only ); THEDP->streamingDialog( this, soutMRL, b_transcode_only,
ui.advancedLineInput->text().split( ":" ) );
} }
/* Update the MRL */ /* Update the MRL */
......
...@@ -566,43 +566,68 @@ void DialogsProvider::saveAPlaylist() ...@@ -566,43 +566,68 @@ void DialogsProvider::saveAPlaylist()
* Sout emulation * Sout emulation
****************************************************************************/ ****************************************************************************/
void DialogsProvider::streamingDialog( QWidget *parent, QString mrl, void DialogsProvider::streamingDialog( QWidget *parent,
bool b_transcode_only ) QString mrl,
bool b_transcode_only,
QStringList options )
{ {
char *psz_option; char *psz_soutoption;
/* Stream */
if( !b_transcode_only ) if( !b_transcode_only )
{ {
SoutDialog *s = SoutDialog::getInstance( parent, p_intf, mrl ); SoutDialog *s = SoutDialog::getInstance( parent, p_intf, mrl );
if( s->exec() == QDialog::Accepted ) if( s->exec() == QDialog::Accepted )
{ {
psz_option = strdup( qtu( s->getMrl() ) ); psz_soutoption = strdup( qtu( s->getMrl() ) );
delete s; delete s;
} }
else else
{ {
delete s; delete s; return;
return;
} }
} else { } else {
/* Convert */
ConvertDialog *s = new ConvertDialog( parent, p_intf, mrl ); ConvertDialog *s = new ConvertDialog( parent, p_intf, mrl );
if( s->exec() == QDialog::Accepted ) if( s->exec() == QDialog::Accepted )
{ {
psz_option = strdup( qtu( s->getMrl() ) ); psz_soutoption = strdup( qtu( s->getMrl() ) );
delete s; delete s;
} }
else else
{ {
delete s; delete s; return;
return;
} }
} }
if( !EMPTY_STR( psz_option ) ) /* Get SoutMRL */
if( !EMPTY_STR( psz_soutoption ) )
{ {
msg_Dbg( p_intf, "Streaming MRL is: %s", psz_option ); /* Create Input */
playlist_AddExt( THEPL, qtu( mrl ), _("Streaming"), input_item_t *p_input;
PLAYLIST_APPEND | PLAYLIST_GO, PLAYLIST_END, p_input = input_item_New( p_intf, qtu( mrl ), _("Streaming") );
-1, 1, &psz_option, VLC_INPUT_OPTION_TRUSTED, true, pl_Unlocked );
/* Add normal Options */
for( int j = 0; j < options.size(); j++ )
{
QString qs = options[j].trimmed();
if( !qs.isEmpty() )
{
input_item_AddOption( p_input, qtu( qs ),
VLC_INPUT_OPTION_TRUSTED );
}
}
/* Add SoutMRL */
msg_Dbg( p_intf, "Streaming MRL is: %s", psz_soutoption );
input_item_AddOption( p_input, psz_soutoption, VLC_INPUT_OPTION_TRUSTED );
/* Switch between enqueuing and starting the item */
/* FIXME: playlist_AddInput() can fail */
playlist_AddInput( THEPL, p_input,
PLAYLIST_APPEND | PLAYLIST_GO, PLAYLIST_END, true, pl_Unlocked );
vlc_gc_decref( p_input );
RecentsMRL::getInstance( p_intf )->addRecent( mrl ); RecentsMRL::getInstance( p_intf )->addRecent( mrl );
} }
} }
......
...@@ -22,8 +22,8 @@ ...@@ -22,8 +22,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/ *****************************************************************************/
#ifndef _DIALOGS_PROVIDER_H_ #ifndef QVLC_DIALOGS_PROVIDER_H_
#define _DIALOGS_PROVIDER_H_ #define QVLC_DIALOGS_PROVIDER_H_
#ifdef HAVE_CONFIG_H #ifdef HAVE_CONFIG_H
# include "config.h" # include "config.h"
...@@ -82,6 +82,7 @@ enum { ...@@ -82,6 +82,7 @@ enum {
class QEvent; class QEvent;
class QSignalMapper; class QSignalMapper;
class QVLCMenu; class QVLCMenu;
#include <QStringList>
class DialogsProvider : public QObject class DialogsProvider : public QObject
{ {
...@@ -176,8 +177,8 @@ public slots: ...@@ -176,8 +177,8 @@ public slots:
void PLAppendDir(); void PLAppendDir();
void MLAppendDir(); void MLAppendDir();
void streamingDialog( QWidget *parent, QString mrl = "", void streamingDialog( QWidget *parent, QString mrl, bool b_stream = true,
bool b_stream = true ); QStringList options = QStringList("") );
void openAndStreamingDialogs(); void openAndStreamingDialogs();
void openAndTranscodingDialogs(); void openAndTranscodingDialogs();
......
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