sout.hpp

Go to the documentation of this file.
00001 /*****************************************************************************
00002  * sout.hpp : Stream output dialog ( old-style, ala WX )
00003  ****************************************************************************
00004  * Copyright ( C ) 2006 the VideoLAN team
00005  * $Id: 85c1284ca30df23e1bdd2d45bf83bc143347852b $
00006  *
00007  * Authors: Clément Stenac <zorglub@videolan.org>
00008  *
00009  * This program is free software; you can redistribute it and/or modify
00010  * it under the terms of the GNU General Public License as published by
00011  * the Free Software Foundation; either version 2 of the License, or
00012  * ( at your option ) any later version.
00013  *
00014  * This program is distributed in the hope that it will be useful,
00015  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00016  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00017  * GNU General Public License for more details.
00018  *
00019  * You should have received a copy of the GNU General Public License
00020  * along with this program; if not, write to the Free Software
00021  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
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> /* Gettext functions */
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

Generated on Tue May 25 08:04:57 2010 for VLC by  doxygen 1.5.6