| 1 | /***************************************************************************** |
| 2 | ** QNapi |
| 3 | ** Copyright (C) 2008-2017 Piotr KrzemiĆski <[email protected]> |
| 4 | ** |
| 5 | ** This program is free software; you can redistribute it and/or modify |
| 6 | ** it under the terms of the GNU General Public License as published by |
| 7 | ** the Free Software Foundation; either version 2 of the License, or |
| 8 | ** (at your option) any later version. |
| 9 | ** |
| 10 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE |
| 11 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
| 12 | ** |
| 13 | *****************************************************************************/ |
| 14 | |
| 15 | #ifndef __FRMCONVERT_H__ |
| 16 | #define __FRMCONVERT_H__ |
| 17 | |
| 18 | #include <Maybe.h> |
| 19 | #include <QDialog> |
| 20 | #include <QSharedPointer> |
| 21 | #include "config/postprocessingconfig.h" |
| 22 | #include "config/staticconfig.h" |
| 23 | #include "subconvert/subtitleconverter.h" |
| 24 | #include "subconvert/subtitleformatsregistry.h" |
| 25 | #include "ui_frmconvert.h" |
| 26 | |
| 27 | class frmConvert : public QDialog { |
| 28 | Q_OBJECT |
| 29 | public: |
| 30 | frmConvert(QWidget *parent = 0, Qt::WindowFlags f = 0); |
| 31 | ~frmConvert() {} |
| 32 | |
| 33 | private: |
| 34 | Ui::frmConvert ui; |
| 35 | QSharedPointer<const StaticConfig> staticConfig; |
| 36 | const PostProcessingConfig ppConfig; |
| 37 | QSharedPointer<const SubtitleFormatsRegistry> subtitleFormatsRegistry; |
| 38 | SubtitleConverter subConverter; |
| 39 | bool targetFileNameSelected; |
| 40 | QString srcFormat, targetFormat; |
| 41 | |
| 42 | void checkFPSNeeded(); |
| 43 | Maybe<QString> determineMovieFPS(const QString &defaultMovieFilePath); |
| 44 | void generateTargetFileName(); |
| 45 | |
| 46 | private slots: |
| 47 | |
| 48 | void srcSubSelectClicked(); |
| 49 | void srcSubFileLoaded(const QString &srcSubFileName); |
| 50 | void targetFormatChanged(int targetFormatIdx); |
| 51 | void movieFPSSelectClicked(); |
| 52 | void targetMovieFPSSelectClicked(); |
| 53 | void targetExtensionChanged(); |
| 54 | void subDelayToggled(); |
| 55 | void convertClicked(); |
| 56 | }; |
| 57 | |
| 58 | #endif // __FRMCONVERT_H__ |