sout.hpp
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef QVLC_SOUT_DIALOG_H_
00025 #define QVLC_SOUT_DIALOG_H_ 1
00026
00027 #ifdef HAVE_CONFIG_H
00028 # include "config.h"
00029 #endif
00030
00031 #include <vlc_common.h>
00032
00033 #include "ui/sout.h"
00034 #include "util/qvlcframe.hpp"
00035
00036 class QPushButton;
00037 class QToolButton;
00038 class QCheckBox;
00039 class QGridLayout;
00040 class QTextEdit;
00041
00042 class SoutMrl
00043 {
00044 public:
00045 SoutMrl( const QString& head = "")
00046 {
00047 mrl = head;
00048 b_first = true;
00049 b_has_bracket = false;
00050 }
00051
00052 QString getMrl()
00053 {
00054 return mrl;
00055 }
00056
00057 void begin( const QString& module )
00058 {
00059 if( !b_first )
00060 mrl += ":";
00061 b_first = false;
00062
00063 mrl += module;
00064 b_has_bracket = false;
00065 }
00066 void end()
00067 {
00068 if( b_has_bracket )
00069 mrl += "}";
00070 }
00071 void option( const QString& option, const QString& value = "" )
00072 {
00073 if( !b_has_bracket )
00074 mrl += "{";
00075 else
00076 mrl += ",";
00077 b_has_bracket = true;
00078
00079 mrl += option;
00080
00081 if( !value.isEmpty() )
00082 {
00083 char *psz = config_StringEscape( qtu(value) );
00084 if( psz )
00085 {
00086 mrl += "=" + qfu( psz );
00087 free( psz );
00088 }
00089 }
00090 }
00091 void option( const QString& name, const int i_value, const int i_precision = 10 )
00092 {
00093 option( name, QString::number( i_value, i_precision ) );
00094 }
00095 void option( const QString& name, const double f_value )
00096 {
00097 option( name, QString::number( f_value ) );
00098 }
00099
00100 void option( const QString& name, const QString& base, const int i_value, const int i_precision = 10 )
00101 {
00102 option( name, base + ":" + QString::number( i_value, i_precision ) );
00103 }
00104
00105 private:
00106 QString mrl;
00107 bool b_has_bracket;
00108 bool b_first;
00109 };
00110
00111
00112 class SoutDialog : public QVLCDialog
00113 {
00114 Q_OBJECT
00115 public:
00116 SoutDialog( QWidget* parent, intf_thread_t *, const QString& mrl = "");
00117 virtual ~SoutDialog(){}
00118
00119 QString getMrl(){ return mrl; }
00120
00121 private:
00122 Ui::Sout ui;
00123
00124 QString mrl;
00125 QPushButton *okButton;
00126 QToolButton *closeTabButton;
00127
00128 public slots:
00129 void updateMRL();
00130
00131 private slots:
00132 void ok();
00133 void cancel();
00134 void next();
00135 void prev();
00136 void closeTab();
00137 void tabChanged( int );
00138 void addDest();
00139 };
00140
00141 #endif