-
Notifications
You must be signed in to change notification settings - Fork 141
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
1,848 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
project(Anime4KCPP_GUI LANGUAGES CXX) | ||
|
||
set(CMAKE_INCLUDE_CURRENT_DIR ON) | ||
|
||
set(CMAKE_AUTOUIC ON) | ||
set(CMAKE_AUTOMOC ON) | ||
set(CMAKE_AUTORCC ON) | ||
|
||
set(CMAKE_CXX_STANDARD 17) | ||
set(CMAKE_CXX_STANDARD_REQUIRED ON) | ||
|
||
set(TS_FILES ./src/Anime4KCPP_GUI_zh_CN.ts) | ||
set(UI_FILE ./src/mainwindow.ui) | ||
|
||
include_directories(include ../ThirdParty/include ../Anime4KCore/include) | ||
file(GLOB INCLUDE include/*.h) | ||
|
||
aux_source_directory(src SOURCE) | ||
|
||
add_executable(Anime4KCPP_GUI | ||
WIN32 | ||
${INCLUDE} | ||
${SOURCE} | ||
${TS_FILES} | ||
${UI_FILE} | ||
) | ||
|
||
find_package(Qt5 COMPONENTS Widgets LinguistTools REQUIRED) | ||
find_package(OpenCV REQUIRED) | ||
|
||
include_directories(${OpenCV_INCLUDE_DIRS}) | ||
|
||
target_link_libraries(Anime4KCPP_GUI PRIVATE Qt5::Widgets) | ||
target_link_libraries(${PROJECT_NAME} PRIVATE ${OpenCV_LIBS}) | ||
target_link_libraries(${PROJECT_NAME} PRIVATE Anime4KCore) | ||
|
||
qt5_create_translation(QM_FILES ${CMAKE_SOURCE_DIR} ${TS_FILES}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#ifndef COMMUNICATOR_H | ||
#define COMMUNICATOR_H | ||
|
||
#include <QObject> | ||
|
||
class Communicator : public QObject | ||
{ | ||
Q_OBJECT | ||
public: | ||
explicit Communicator(QObject *parent = nullptr); | ||
|
||
signals: | ||
void error(int row, QString err); | ||
void done(int row, double pro, quint64 time); | ||
void allDone(); | ||
void showInfo(std::string info); | ||
}; | ||
|
||
#endif // COMMUNICATOR_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
#ifndef MAINWINDOW_H | ||
#define MAINWINDOW_H | ||
|
||
#include "communicator.h" | ||
#include "Anime4K.h" | ||
|
||
#include <QMainWindow> | ||
#include <QTranslator> | ||
#include <QCloseEvent> | ||
#include <QMessageBox> | ||
#include <QStandardItemModel> | ||
#include <QFileDialog> | ||
#include <QFileInfo> | ||
#include <QMimeData> | ||
#include <QtConcurrent/QtConcurrent> | ||
#include <QMutex> | ||
#include <QMetaType> | ||
|
||
#define CORE_VERSION "1.3" | ||
#define VERSION "0.9" | ||
|
||
QT_BEGIN_NAMESPACE | ||
namespace Ui { class MainWindow; } | ||
QT_END_NAMESPACE | ||
|
||
enum FileType | ||
{ | ||
IMAGE = 0, VIDEO = 1, ERROR=2 | ||
}; | ||
|
||
class MainWindow : public QMainWindow | ||
{ | ||
Q_OBJECT | ||
|
||
public: | ||
MainWindow(QWidget *parent = nullptr); | ||
~MainWindow(); | ||
|
||
protected: | ||
void closeEvent(QCloseEvent *event); | ||
void dragEnterEvent(QDragEnterEvent *event); | ||
void dropEvent(QDropEvent *event); | ||
|
||
private: | ||
void initTextBrowser(); | ||
bool checkFFmpeg(); | ||
QString formatSuffixList(const QString &&type, QString str); | ||
void initAnime4K(Anime4K *&anime4K); | ||
void releaseAnime4K(Anime4K *&anime4K); | ||
FileType fileType(QFileInfo &file); | ||
|
||
private slots: | ||
void solt_done_renewState(int row, double pro, quint64 time); | ||
void solt_error_renewState(int row, QString err); | ||
void solt_allDone_remindUser(); | ||
void solt_showInfo_renewTextBrowser(std::string info); | ||
|
||
private slots: | ||
void on_actionQuit_triggered(); | ||
|
||
void on_pushButtonInputPath_clicked(); | ||
|
||
void on_pushButtonOutputPath_clicked(); | ||
|
||
void on_pushButtonClear_clicked(); | ||
|
||
void on_pushButtonDelete_clicked(); | ||
|
||
void on_radioButtonFast_clicked(); | ||
|
||
void on_radioButtonBalance_clicked(); | ||
|
||
void on_radioButtonQuality_clicked(); | ||
|
||
void on_checkBoxEnablePreprocessing_stateChanged(int arg1); | ||
|
||
void on_checkBoxEnablePostprocessing_stateChanged(int arg1); | ||
|
||
void on_pushButtonPreview_clicked(); | ||
|
||
void on_pushButtonPreviewPick_clicked(); | ||
|
||
void on_pushButtonStart_clicked(); | ||
|
||
void on_actionAbout_triggered(); | ||
|
||
void on_tabWidgetMain_tabBarClicked(int index); | ||
|
||
void on_actionChinese_triggered(); | ||
|
||
void on_actionEnglish_triggered(); | ||
|
||
private: | ||
Ui::MainWindow *ui; | ||
QTranslator *translator; | ||
QStandardItemModel *tableModel; | ||
QMutex *mutex; | ||
quint64 totalTime; | ||
int imageCount; | ||
int videoCount; | ||
bool ffmpeg; | ||
}; | ||
#endif // MAINWINDOW_H |
Oops, something went wrong.