Commit e3611943 authored by Francois Cartegnie's avatar Francois Cartegnie

Qt: profile_selector: Bind data to muxers

parent 970a1b94
...@@ -31,6 +31,7 @@ ...@@ -31,6 +31,7 @@
#include <QComboBox> #include <QComboBox>
#include <QLabel> #include <QLabel>
#include <QMessageBox> #include <QMessageBox>
#include <QRadioButton>
#include <assert.h> #include <assert.h>
...@@ -262,6 +263,21 @@ VLCProfileEditor::VLCProfileEditor( const QString& qs_name, const QString& value ...@@ -262,6 +263,21 @@ VLCProfileEditor::VLCProfileEditor( const QString& qs_name, const QString& value
inline void VLCProfileEditor::registerCodecs() inline void VLCProfileEditor::registerCodecs()
{ {
#define SETMUX( button, val ) ui.button->setProperty( "sout", val );
SETMUX( PSMux, "ps" )
SETMUX( TSMux, "ts" )
SETMUX( WEBMux, "webm" )
SETMUX( MPEG1Mux, "mpeg1" )
SETMUX( OggMux, "ogg" )
SETMUX( ASFMux, "asf" )
SETMUX( MOVMux, "mp4" )
SETMUX( WAVMux, "wav" )
SETMUX( RAWMux, "raw" )
SETMUX( FLVMux, "flv" )
SETMUX( MKVMux, "mkv" )
SETMUX( AVIMux, "avi" )
SETMUX( MJPEGMux, "mpjpeg" )
#undef SETMUX
#define ADD_VCODEC( name, fourcc ) ui.vCodecBox->addItem( name, QVariant( fourcc ) ); #define ADD_VCODEC( name, fourcc ) ui.vCodecBox->addItem( name, QVariant( fourcc ) );
ADD_VCODEC( "MPEG-1", "mp1v" ) ADD_VCODEC( "MPEG-1", "mp1v" )
...@@ -325,21 +341,17 @@ void VLCProfileEditor::fillProfile( const QString& qs ) ...@@ -325,21 +341,17 @@ void VLCProfileEditor::fillProfile( const QString& qs )
return; return;
const QString mux = options[0]; const QString mux = options[0];
#define CHECKMUX( button, text) if( text == mux ) ui.button->setChecked( true ); else for ( int i=0; i< ui.muxer->layout()->count(); i++ )
CHECKMUX( PSMux, "ps" ) {
CHECKMUX( TSMux, "ts" ) QRadioButton *current =
CHECKMUX( WEBMux, "webm" ) qobject_cast<QRadioButton *>(ui.muxer->layout()->itemAt(i)->widget());
CHECKMUX( MPEG1Mux, "mpeg1" ) if ( unlikely( !current ) ) continue;/* someone is messing up with ui */
CHECKMUX( OggMux, "ogg" ) if ( current->property("sout").toString() == mux )
CHECKMUX( ASFMux, "asf" ) {
CHECKMUX( MOVMux, "mp4" ) current->setChecked( true );
CHECKMUX( WAVMux, "wav" ) break;/* radios are exclusive */
CHECKMUX( RAWMux, "raw" ) }
CHECKMUX( FLVMux, "flv" ) }
CHECKMUX( MKVMux, "mkv" )
CHECKMUX( AVIMux, "avi" )
CHECKMUX( MJPEGMux, "mpjpeg" ){}
#undef CHECKMUX
ui.keepVideo->setChecked( !options[1].toInt() ); ui.keepVideo->setChecked( !options[1].toInt() );
ui.transcodeVideo->setChecked( ( options[4] != "none" ) ); ui.transcodeVideo->setChecked( ( options[4] != "none" ) );
...@@ -421,21 +433,17 @@ void VLCProfileEditor::close() ...@@ -421,21 +433,17 @@ void VLCProfileEditor::close()
QString VLCProfileEditor::transcodeValue() QString VLCProfileEditor::transcodeValue()
{ {
#define SMUX( x, txt ) if( ui.x->isChecked() ) muxValue = txt; else for ( int i=0; i< ui.muxer->layout()->count(); i++ )
SMUX( PSMux, "ps" ) {
SMUX( TSMux, "ts" ) QRadioButton *current =
SMUX( WEBMux, "webm" ) qobject_cast<QRadioButton *>(ui.muxer->layout()->itemAt(i)->widget());
SMUX( MPEG1Mux, "mpeg1" ) if ( unlikely( !current ) ) continue;/* someone is messing up with ui */
SMUX( OggMux, "ogg" ) if ( current->isChecked() )
SMUX( ASFMux, "asf" ) {
SMUX( MOVMux, "mp4" ) muxValue = current->property("sout").toString();
SMUX( WAVMux, "wav" ) break;/* radios are exclusive */
SMUX( RAWMux, "raw" ) }
SMUX( FLVMux, "flv" ) }
SMUX( MKVMux, "mkv" )
SMUX( AVIMux, "avi" )
SMUX( MJPEGMux, "mpjpeg" ){}
#undef SMUX
#define currentData( box ) box->itemData( box->currentIndex() ) #define currentData( box ) box->itemData( box->currentIndex() )
QString qs_acodec, qs_vcodec; QString qs_acodec, qs_vcodec;
......
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