Thumbnail me
3.0
|
00001 /***************************************************************************/ 00021 #ifndef HEADER_THUMBNAILENGINE 00022 #define HEADER_THUMBNAILENGINE 00023 00024 #include "MainWindow.h" 00025 #include "ProcessingStatusBar.h" 00026 #include "SuccessDialog.h" 00027 00028 class MainWindow; 00029 00030 class ThumbnailEngine : public QObject 00031 { 00032 Q_OBJECT 00033 00034 public: 00039 enum Mode 00040 { 00041 SIMPLEMOD, 00042 PREVIEWMOD 00043 }; 00044 00045 public: 00046 explicit ThumbnailEngine(MainWindow *main_window); 00047 virtual ~ThumbnailEngine(); 00048 00049 private: 00050 MainWindow *main_window; 00051 QSettings *settings; 00052 00053 QLinkedList <ThumbnailItem*> listInputFile; 00054 QProcess *process; 00055 QImage *img; 00056 QStringList parameters; 00057 QStringList currentOutput; 00058 ThumbnailItem *currentItem; 00059 int current; 00060 QSignalMapper *convertSignalMapper; 00061 Mode modeConversion; 00062 00063 private: 00064 QStringList buildParams(ThumbnailItem* item); 00065 void launchProcess(QLinkedList <ThumbnailItem*> listInputFile); 00066 00067 private slots: 00068 void convertToFormat(QObject *o); 00069 void initSuccessDialog(QLinkedList <ThumbnailItem*> listInputFile); 00070 void start(int exitCode, QProcess::ExitStatus exitStatus); 00071 void success(); 00072 00073 public: 00074 QString absoluteFilePathOutput(QString pathOutput, QString absoluteOutputPath,QString suffix,QString format = QString()); 00075 bool isBinaryExists(); 00076 Mode mode() const; 00077 void setMode(Mode mode); 00078 00079 public slots: 00080 void buildOutput(); 00081 void deleteTemporaryFiles(); 00082 void detectShortDuration(); 00083 void run(int mode); 00084 void successDialogItemRemove(ThumbnailItem *item); 00085 00086 signals: 00091 void itemTooShortDuration(ThumbnailItem *item); 00092 }; 00093 #endif // HEADER_THUMBNAILENGINE