#include "util/qvlcframe.hpp"
#include "input_manager.hpp"
-#include "dialogs_provider.hpp"
OpenDialog *OpenDialog::instance = NULL;
OpenDialog::OpenDialog( QWidget *parent, intf_thread_t *_p_intf, bool modal,
- bool _stream_after ) : QVLCDialog( parent, _p_intf )
+ int _action_flag ) : QVLCDialog( parent, _p_intf )
{
setModal( modal );
- b_stream_after = _stream_after;
+ i_action_flag = _action_flag;
ui.setupUi( this );
setWindowTitle( qtr("Open" ) );
buttonSizePolicy.setHorizontalStretch(0);
buttonSizePolicy.setVerticalStretch(0);
- playButton = new QToolButton();
+ playButton = new QToolButton( this );
playButton->setText( qtr( "&Play" ) );
playButton->setSizePolicy( buttonSizePolicy );
playButton->setMinimumSize( QSize(90, 0) );
playButton->setPopupMode( QToolButton::MenuButtonPopup );
playButton->setToolButtonStyle( Qt::ToolButtonTextOnly );
- playButton->setAutoRaise( false );
cancelButton = new QToolButton();
cancelButton->setText( qtr( "&Cancel" ) );
QKeySequence( "Alt+P" ) );
openButtonMenu->addAction( qtr("&Stream"), this, SLOT( stream() ) ,
QKeySequence( "Alt+S" ) );
+ openButtonMenu->addAction( qtr("&Convert"), this, SLOT( transcode( ) ) ,
+ QKeySequence( "Alt+C" ) );
playButton->setMenu( openButtonMenu );
ui.buttonsBox->addButton( playButton, QDialogButtonBox::AcceptRole );
ui.buttonsBox->addButton( cancelButton, QDialogButtonBox::RejectRole );
-
/* Force MRL update on tab change */
CONNECT( ui.Tab, currentChanged(int), this, signalCurrent());
CONNECT( netOpenPanel, mrlUpdated( QString ), this, updateMRL(QString) );
CONNECT( discOpenPanel, mrlUpdated( QString ), this, updateMRL(QString) );
CONNECT( captureOpenPanel, mrlUpdated( QString ), this,
- updateMRL(QString) );
+ updateMRL(QString) );
CONNECT( fileOpenPanel, methodChanged( QString ),
- this, newMethod(QString) );
+ this, newMethod(QString) );
CONNECT( netOpenPanel, methodChanged( QString ),
- this, newMethod(QString) );
+ this, newMethod(QString) );
CONNECT( discOpenPanel, methodChanged( QString ),
- this, newMethod(QString) );
+ this, newMethod(QString) );
+ /* FIXME CAPTURE */
+ /* Advanced frame Connects */
CONNECT( ui.slaveText, textChanged(QString), this, updateMRL());
CONNECT( ui.cacheSpinBox, valueChanged(int), this, updateMRL());
CONNECT( ui.startTimeSpinBox, valueChanged(int), this, updateMRL());
+ BUTTONACT( ui.advancedCheckBox , toggleAdvancedPanel() );
/* Buttons action */
BUTTONACT( playButton, play());
BUTTONACT( cancelButton, cancel());
- if ( b_stream_after ) setAfter();
+ /* At creation time, modify the default buttons */
+ if ( i_action_flag ) setMenuAction();
- BUTTONACT( ui.advancedCheckBox , toggleAdvancedPanel() );
/* Initialize caching */
storedMethod = "";
{
}
-void OpenDialog::setAfter()
+/* Finish the dialog and decide if you open another one after */
+void OpenDialog::setMenuAction()
{
- if (!b_stream_after )
- {
- playButton->setText( qtr("&Play") );
- BUTTONACT( playButton, play() );
- }
- else
+ switch ( i_action_flag )
{
- playButton->setText( qtr("&Stream") );
- BUTTONACT( playButton, stream() );
- }
+ case OPEN_AND_STREAM:
+ playButton->setText( qtr("&Stream") );
+ BUTTONACT( playButton, stream() );
+ break;
+ case OPEN_AND_SAVE:
+ playButton->setText( qtr("&Convert / Save") );
+ BUTTONACT( playButton, stream( true ) );
+ break;
+ case OPEN_AND_PLAY:
+ default:
+ playButton->setText( qtr("&Play") );
+ BUTTONACT( playButton, play() );
+ }
}
void OpenDialog::showTab(int i_tab=0)
}
}
-/***********
+/***********
* Actions *
***********/
/* If EnterKey is pressed */
void OpenDialog::close()
{
- if ( !b_stream_after )
+ /* FIXME */
+ if ( !i_action_flag )
{
play();
}
/* Play button */
void OpenDialog::play()
{
- playOrEnqueue( false );
+ finish( false );
}
void OpenDialog::enqueue()
{
- playOrEnqueue( true );
+ finish( true );
}
-void OpenDialog::stream()
+void OpenDialog::transcode()
{
- /* not finished FIXME */
- THEDP->streamingDialog( mrl );
+ stream( true );
}
+void OpenDialog::stream( bool b_transcode_only )
+{
+ /* not finished FIXME */
+ /* Should go through the finish function */
+ THEDP->streamingDialog( mrl, b_transcode_only );
+}
-void OpenDialog::playOrEnqueue( bool b_enqueue = false )
+void OpenDialog::finish( bool b_enqueue = false )
{
this->toggleVisible();
mrl = ui.advancedLineInput->text();
#include "util/qvlcframe.hpp"
#include "components/open.hpp"
+#include "dialogs_provider.hpp"
+
#include <QTabWidget>
#include <QBoxLayout>
#include <QString>
Q_OBJECT;
public:
static OpenDialog * getInstance( QWidget *parent, intf_thread_t *p_intf,
- bool _stream_after = false )
+ int _action_flag = 0 )
{
if( !instance)
- instance = new OpenDialog( parent, p_intf, false, _stream_after );
+ instance = new OpenDialog( parent, p_intf, false, _action_flag );
else
{
- instance->b_stream_after = _stream_after;
- instance->setAfter();
+ instance->i_action_flag = _action_flag;
+ instance->setMenuAction();
}
return instance;
}
- OpenDialog( QWidget *parent, intf_thread_t *, bool modal,
- bool stream_after = false);
+ OpenDialog( QWidget *parent, intf_thread_t *, bool modal,
+ int _action_flag = 0 );
virtual ~OpenDialog();
void showTab( int );
public slots:
void play();
- void stream();
+ void stream( bool b_transode_only = false );
void enqueue();
+ void transcode();
private:
static OpenDialog *instance;
input_thread_t *p_input;
QString storedMethod;
QString mrlSub;
int advHeight, mainHeight;
- bool b_stream_after;
+ int i_action_flag;
QStringList SeparateEntries( QString );
-
+
QToolButton *cancelButton;
QToolButton *playButton;
- void playOrEnqueue( bool );
+ void finish( bool );
private slots:
- void setAfter();
+ void setMenuAction();
void cancel();
void close();
void toggleAdvancedPanel();
{
QGridLayout *main_layout = new QGridLayout( this );
setWindowTitle( qtr( "Preferences" ) );
- resize( 700, 600 );
+ resize( 700, 550 );
/* Create Panels */
tree_panel = new QWidget( 0 );
#include <QFileDialog>
-SoutDialog::SoutDialog( QWidget *parent, intf_thread_t *_p_intf ) :
- QVLCDialog( parent, _p_intf )
+SoutDialog::SoutDialog( QWidget *parent, intf_thread_t *_p_intf,
+ bool _transcode_only ) : QVLCDialog( parent, _p_intf )
{
setWindowTitle( qtr( "Stream output") );
- setModal( true );
+
/* UI stuff */
ui.setupUi( this );
+
#define ADD_VCODEC( name, fcc) ui.vCodec->addItem( name, QVariant( fcc ) );
ADD_VCODEC( "MPEG-1", "mp1v" );
ADD_VCODEC( "MPEG-2", "mp2v" );
BUTTONACT( okButton, ok());
BUTTONACT( cancelButton, cancel());
+
+ if( _transcode_only ) toggleSout();
}
void SoutDialog::fileBrowse()
TGV( ui.HTTPLabel ) ; TGV( ui.UDPLabel ) ; TGV( ui.MMSHLabel ) ;
TGV( ui.HTTPPortLabel ) ; TGV( ui.UDPPortLabel ) ; TGV( ui.MMSHPortLabel ) ;
TGV( ui.HTTPPort ) ; TGV( ui.UDPPort ) ; TGV( ui.MMSHPort ) ;
+ updateGeometry();
}
void SoutDialog::ok()
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * 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 _SOUT_DIALOG_H_
#define _SOUT_DIALOG_H_
{
Q_OBJECT;
public:
- SoutDialog( QWidget* parent, intf_thread_t * );
+ SoutDialog( QWidget* parent, intf_thread_t *,
+ bool _transcode_only = false );
virtual ~SoutDialog() {}
QString mrl;
* Sout emulation
****************************************************************************/
-void DialogsProvider::streamingDialog( QString mrl)
+void DialogsProvider::streamingDialog( QString mrl, bool b_transcode_only )
{
- SoutDialog *s = new SoutDialog( p_intf->p_sys->p_mi, p_intf );
+ SoutDialog *s = new SoutDialog( p_intf->p_sys->p_mi, p_intf,
+ b_transcode_only );
if( s->exec() == QDialog::Accepted )
{
msg_Err(p_intf, "mrl %s\n", qta(s->mrl));
void DialogsProvider::openThenStreamingDialogs()
{
- OpenDialog::getInstance( p_intf->p_sys->p_mi , p_intf, true )->showTab( 0 );
+ OpenDialog::getInstance( p_intf->p_sys->p_mi , p_intf, OPEN_AND_STREAM )
+ ->showTab( 0 );
+}
+
+void DialogsProvider::openThenTranscodingDialogs()
+{
+ OpenDialog::getInstance( p_intf->p_sys->p_mi , p_intf, OPEN_AND_SAVE )
+ ->showTab( 0 );
}
/*
void DialogsProvider::streamingDialog()
#define OPEN_NETWORK_TAB 0x2
#define OPEN_CAPTURE_TAB 0x3
+#define OPEN_AND_PLAY 0x0
+#define OPEN_AND_STREAM 0x1
+#define OPEN_AND_SAVE 0x2
+
class QEvent;
class QSignalMapper;
class QVLCMenu;
void menuAction( QObject *);
void menuUpdateAction( QObject *);
void SDMenuAction( QString );
- void streamingDialog( QString mrl = "");
+ void streamingDialog( QString mrl = "", bool b_stream = true );
void openThenStreamingDialogs();
+ void openThenTranscodingDialogs();
void openPlaylist();
void savePlaylist();
void PLAppendDir();
#ifndef WIN32
pthread_sigmask (SIG_BLOCK, &set, NULL);
#endif
- BAR_ADD( FileMenu(), qtr("Media") );
+ BAR_ADD( FileMenu(), qtr("&Media") );
if( playlist )
{
- BAR_ADD( PlaylistMenu( mi,p_intf ), qtr("Playlist" ) );
+ BAR_ADD( PlaylistMenu( mi,p_intf ), qtr("&Playlist" ) );
}
BAR_ADD( ToolsMenu( p_intf, mi, adv_controls_enabled,
- visual_selector_enabled ), qtr("Tools") );
- BAR_DADD( VideoMenu( p_intf, NULL ), qtr("Video"), 1 );
- BAR_DADD( AudioMenu( p_intf, NULL ), qtr("Audio"), 2 );
- BAR_DADD( NavigMenu( p_intf, NULL ), qtr("Navigation"), 3 );
+ visual_selector_enabled ), qtr("&Tools") );
+ BAR_DADD( VideoMenu( p_intf, NULL ), qtr("&Video"), 1 );
+ BAR_DADD( AudioMenu( p_intf, NULL ), qtr("&Audio"), 2 );
+ BAR_DADD( NavigMenu( p_intf, NULL ), qtr("&Navigation"), 3 );
- BAR_ADD( HelpMenu(), qtr("Help" ) );
+ BAR_ADD( HelpMenu(), qtr("&Help" ) );
}
QMenu *QVLCMenu::FileMenu()
{
menu->addSeparator();
DP_SADD( qtr("&Streaming..."), "", "", openThenStreamingDialogs(),
"Ctrl+S" );
+ DP_SADD( qtr("Conve&rt / Save..."), "", "", openThenTranscodingDialogs(),
+ "Ctrl+R" );
menu->addSeparator();
DP_SADD( qtr("&Quit") , "", "", quit(), "Ctrl+Q");
return menu;
QMenu *menu = new QMenu();
DP_SADD( qtr("Help") , "", "", helpDialog(), "F1" );
menu->addSeparator();
- DP_SADD( qtr(I_MENU_ABOUT), "", "", aboutDialog(), "Ctrl+Shift+F1");
+ DP_SADD( qtr(I_MENU_ABOUT), "", "", aboutDialog(), "Ctrl+F1");
return menu;
}
PLModel *p_model = (PLModel *) param;
PLEvent *event = new PLEvent( PLUpdate_Type, 0 );
QApplication::postEvent( p_model, static_cast<QEvent*>(event) );
+ printf( "blabla" );
return VLC_SUCCESS;
}
QApplication::postEvent( p_model, static_cast<QEvent*>(event) );
event = new PLEvent( ItemUpdate_Type, nval.i_int );
QApplication::postEvent( p_model, static_cast<QEvent*>(event) );
+ printf( "blabla" );
return VLC_SUCCESS;
}
PLModel *p_model = (PLModel *) param;
PLEvent *event = new PLEvent( ItemUpdate_Type, nval.i_int );
QApplication::postEvent( p_model, static_cast<QEvent*>(event) );
+ printf( "blabla" );
return VLC_SUCCESS;
}
PLModel *p_model = (PLModel *) param;
PLEvent *event = new PLEvent( ItemDelete_Type, nval.i_int );
QApplication::postEvent( p_model, static_cast<QEvent*>(event) );
+ printf( "blabla" );
return VLC_SUCCESS;
}
}
PLEvent *event = new PLEvent( p_add );
QApplication::postEvent( p_model, static_cast<QEvent*>(event) );
+ printf( "blabla" );
return VLC_SUCCESS;
}
<x>0</x>
<y>0</y>
<width>440</width>
- <height>286</height>
+ <height>300</height>
</rect>
</property>
<property name="windowTitle" >
<rect>
<x>0</x>
<y>0</y>
- <width>435</width>
- <height>249</height>
+ <width>436</width>
+ <height>194</height>
</rect>
</property>
<property name="sizePolicy" >
<sizepolicy>
<hsizetype>7</hsizetype>
- <vsizetype>3</vsizetype>
+ <vsizetype>1</vsizetype>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
<item row="0" column="0" colspan="3" >
<widget class="QWidget" native="1" name="tempWidget" />
</item>
- <item row="5" column="0" colspan="3" >
- <spacer>
- <property name="orientation" >
- <enum>Qt::Vertical</enum>
- </property>
- <property name="sizeHint" >
- <size>
- <width>200</width>
- <height>2</height>
- </size>
- </property>
- </spacer>
- </item>
<item row="2" column="2" >
<spacer>
<property name="orientation" >
<property name="sizeHint" >
<size>
<width>273</width>
- <height>16</height>
+ <height>14</height>
</size>
</property>
</spacer>
</layout>
</widget>
</item>
+ <item row="5" column="0" colspan="3" >
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeType" >
+ <enum>QSizePolicy::MinimumExpanding</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>200</width>
+ <height>2</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
</layout>
</widget>
<layoutdefault spacing="0" margin="0" />
<x>0</x>
<y>0</y>
<width>660</width>
- <height>676</height>
+ <height>669</height>
</rect>
</property>
+ <property name="sizePolicy" >
+ <sizepolicy>
+ <hsizetype>1</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
<property name="windowTitle" >
<string>Stream Output</string>
</property>
</property>
<item>
<widget class="QGroupBox" name="groupBox" >
+ <property name="sizePolicy" >
+ <sizepolicy>
+ <hsizetype>1</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
<property name="title" >
<string>Outputs</string>
</property>