konverter.kdevelop: cvs/konverter/src/GUI/Controller/konverterdialog.h Source File

Main Page | Class List | Directories | File List

# konverterdialog.h

    00001 /***************************************************************************
    00002  *   Copyright (C) 2004 by Marco Kraus                                     *
    00003  *   marco@libsdl.de                                                       *
    00004  *                                                                         *
    00005  *   This program is free software; you can redistribute it and/or modify  *
    00006  *   it under the terms of the GNU General Public License as published by  *
    00007  *   the Free Software Foundation; either version 2 of the License, or     *
    00008  *   (at your option) any later version.                                   *
    00009  *                                                                         *
    00010  *   This program is distributed in the hope that it will be useful,       *
    00011  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
    00012  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
    00013  *   GNU General Public License for more details.                          *
    00014  *                                                                         *
    00015  *   You should have received a copy of the GNU General Public License     *
    00016  *   along with this program; if not, write to the                         *
    00017  *   Free Software Foundation, Inc.,                                       *
    00018  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
    00019  ***************************************************************************/
    00020
    00021 #ifndef KONVERTERDIALOG_H
    00022 #define KONVERTERDIALOG_H
    00023
    00024 #include <qlineedit.h>
    00025 #include <qcombobox.h>
    00026 #include <kfiledialog.h>
    00027 #include <qprocess.h>
    00028 #include <qtextbrowser.h>
    00029 #include <qtabwidget.h>
    00030 #include <qprogressbar.h>
    00031 #include <qpushbutton.h>
    00032 #include <qtimer.h>
    00033 #include <qspinbox.h>
    00034 #include <qcheckbox.h>
    00035 #include <qlistbox.h>
    00036 #include <qtoolbox.h>
    00037 #include <qstringlist.h>
    00038 #include <qlistbox.h>
    00039 #include <qobject.h>
    00040 #include <qslider.h>
    00041 #include <qmessagebox.h>
    00042 #include <qfile.h>
    00043 #include <qregexp.h>
    00044 #include <qlabel.h>
    00045 #include <qdatetime.h>
    00046 #include <qmovie.h>
    00047 #include <kmessagebox.h>
    00048
    00049 //Splitter
    00050 #include <qfileinfo.h>
    00051 #include <kurl.h>
    00052 #include <klocale.h>
    00053
    00054 // kdoublespinbox widget
    00055 #include <knuminput.h>
    00056
    00057 // Help menu
    00058 #include <kpushbutton.h>
    00059 #include <kpopupmenu.h>
    00060 #include <khelpmenu.h>
    00061
    00062 #include "../View/KonverterMainDialog.h" // header of ui file
    00063
    00064 #include "aboutdialog.h"
    00065 #include "nooptdialog.h"
    00066 #include "mp3optdialog.h"
    00067 #include "pcmoptdialog.h"
    00068 #include "divxoptdialog.h"
    00069 #include "xvidoptdialog.h"
    00070 #include "mpeg2optdialog.h"
    00071 #include "mpeg1optdialog.h"
    00072 #include "divxlavcoptdialog.h"
    00073 #include "rawoptdialog.h"
    00074 #include "mp2optdialog.h"
    00075 #include "ac3optdialog.h"
    00076 #include "preview.h"
    00077 #include "konvprocess.h"
    00078 #include "workdlg.h" //Work Dialog
    00079 #include "soundfilters.h"
    00080 #include "videofilters.h"
    00081
    00082 #include "../../app/XineEngine/kxinewidget.h" //Xine
    00083
    00084 #include <iostream>
    00085 #include <cstdlib>
    00086 #include <cstdio>
    00087 #include <fcntl.h>
    00088 #include <sys/file.h>
    00089 #include <sys/types.h>
    00090 #include <unistd.h>
    00091
    00092 class KonverterDialog : public KonverterMainDialog
    00093 {
    00094   Q_OBJECT
    00095
    00096 public:
    00097   KonverterDialog(QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 );
    00098   ~KonverterDialog();
    00099
    00100 public slots:
    00101   virtual void          SelectInputFile();
    00102   virtual void          UpdateConversionCommandString();
    00103   virtual void          UpdateConcatCommandString();
    00104   virtual void          ExitKonverter();
    00105   virtual void          TabChanged();
    00106   virtual void          SelectOutputDir();
    00107   virtual void          SelectOutputDirConcat();
    00108   virtual void          SelectJoinFiles();
    00109   virtual void          RemoveJoinFile();
    00110   virtual void          ShowAboutDialog();
    00111   virtual void          ShowHelpDialog();
    00112   virtual void          ShowVideoOptionsDialog();
    00113   virtual void          ShowAudioOptionsDialog();
    00114   virtual void          ShowVideoFilter();
    00115   virtual void          ShowAudioFilter();
    00116   virtual void          ExecuteCommandString();
    00117
    00118   // main mencoder transformation process
    00119   virtual void    readFromStdout();
    00120   virtual void    readFromStderr();
    00121   virtual bool    processExiting();
    00122
    00123   virtual void    scrollToTop();
    00124
    00125   //Split tool
    00126   virtual void SplitNameChanged();
    00127   virtual void SplitSliderChanged();
    00128   virtual void SplitSpinChanged();
    00129   virtual void SplitReadFromStdout();
    00130   virtual void SplitProcessExitting();
    00131
    00132   virtual void OpenPreview(); //Open Preview Form
    00133   virtual void PrAoChanged();
    00134   virtual void ExecWorkW();//connects to workDlg widget aka cancel button
    00135
    00136   //twopass
    00137   virtual void ExtraOptsCheck();
    00138   virtual void TwoPassChanged();
    00139   virtual void InputFileChanged();
    00140 protected:
    00141
    00142 protected slots:
    00143
    00144 private:
    00145     // internal execute funxtion
    00146     void          ConvertFile();
    00147     void          ConcatFile();
    00148
    00149     // for mencoder process
    00150     KonvProcess* mencoder;
    00151     bool running;
    00152     bool appendText;
    00153     QString mencOptions;
    00154     QString dirPath;
    00155
    00156     // for progress bar calculation
    00157     QString LastStatus;
    00158     QString OutputLine;
    00159     int ProgressIndicator;
    00160     int MBPos;
    00161
    00162     // define codec options
    00163     QString AudioCodec;
    00164     QString VideoCodec;
    00165
    00166     // define additional codec options
    00167     QString VideoOpts;
    00168     QString AudioOpts;
    00169
    00170     //define filters
    00171     QString AudioFilt;
    00172     QString VideoFilt;
    00173
    00174     // check for already created instances
    00175     bool MP3OptionsCheck;
    00176     bool PCMOptionsCheck;
    00177     bool MP2OptionsCheck;
    00178     bool AC3OptionsCheck;
    00179     bool NoOptionsCheck;
    00180
    00181     bool DivXOptionsCheck;
    00182     bool XvidOptionsCheck;
    00183     bool MPEG2OptionsCheck;
    00184     bool MPEG1OptionsCheck;
    00185     bool DivXLavcOptionsCheck;
    00186     bool RawOptionsCheck;
    00187
    00188     bool SoundFiltersCheck;
    00189     bool VideoFiltersCheck;
    00190
    00191     // Options dialogs
    00192     NoOptDialog* noOpt;
    00193
    00194     MP3OptDialog* MP3Opt;
    00195     MP2OptDialog* MP2Opt;
    00196     AC3OptDialog* AC3Opt;
    00197     PCMOptDialog* PCMOpt;
    00198
    00199     DivXOptDialog* DivXOpt;
    00200     XvidOptDialog* XvidOpt;
    00201     MPEG2OptDialog* MPEG2Opt;
    00202     MPEG1OptDialog* MPEG1Opt;
    00203     DivXLavcOptDialog* DivXLavcOpt;
    00204     RawOptDialog* RawOpt;
    00205
    00206      // Codec options indicators
    00207      bool withDivx3;
    00208
    00209     //Splitting
    00210     bool SpFileExists;
    00211     void getSplitter();
    00212     void SetParts(int Parts);
    00213     void SplitMovie();
    00214     void SplitConstructCommand (int part);
    00215     KonvProcess* SplitProcess;
    00216     int SplitFileSize;
    00217     int SplitMovParts;
    00218     int SplitCurPart;
    00219     int SplitPosI;
    00220     int SplitPosVal;
    00221     int SplitPartSize;
    00222     QString SplitPosS;
    00223     QString SplitTemp;
    00224     QMessageBox* SplitDoneMessage;
    00225      //for QProces
    00226     QString SplitOutputLine;
    00227     QString SplitLastStatus;
    00228
    00229     //Function to convert Console path
    00230     QString ChShellEscape(QString escshell);
    00231
    00232     Preview* Pr; //Preview Form
    00233
    00234     //Load the movie and get all possible info
    00235     KXineWidget* movInfo;
    00236     void ChangeMovInfo();
    00237
    00238     //Working dialog
    00239     workdlg* workDlg;
    00240     bool woWorking;
    00241
    00242     //Passes
    00243     int mencPass;
    00244
    00245     KHelpMenu *helpPopUp; //help menu
    00246     SoundFilters* SFDialog;//SoundFiltersDialog
    00247     VideoFilters* VFDialog;//VideoFiltersDialog
    00248
    00249     //checks
    00250     bool checkConvert();
    00251 };
    00252
    00253 #endif