-
Notifications
You must be signed in to change notification settings - Fork 18
/
mainwindow.h
63 lines (51 loc) · 2.69 KB
/
mainwindow.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QDragEnterEvent>
#include <QMimeData>
#include "ui_mainwindow.h"
#include "video.h"
namespace Ui { class MainWindow; }
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
MainWindow();
~MainWindow() { deleteTemporaryFiles(); delete ui; }
private:
Ui::MainWindow *ui;
QVector<Video *> _videoList;
QStringList _everyVideo;
QStringList _rejectedVideos;
QStringList _extensionList;
Prefs _prefs;
bool _userPressedStop = false;
QString _previousRunFolders = QStringLiteral("");
int _previousRunThumbnails = -1;
private slots:
void deleteTemporaryFiles() const;
void closeEvent(QCloseEvent *event) { Q_UNUSED (event) _userPressedStop = true; }
void dragEnterEvent(QDragEnterEvent *event) { if(event->mimeData()->hasUrls()) event->acceptProposedAction(); }
void dropEvent(QDropEvent *event);
void loadExtensions();
bool detectffmpeg() const;
void setComparisonMode(const int &mode) { if(mode == _prefs._PHASH) ui->selectPhash->click(); else ui->selectSSIM->click(); ui->directoryBox->setFocus(); }
void on_selectThumbnails_activated(const int &index) { ui->directoryBox->setFocus(); _prefs._thumbnails = index;
if(_prefs._thumbnails == cutEnds) ui->differentDurationCombo->setCurrentIndex(0); }
void on_selectPhash_clicked(const bool &checked) { if(checked) _prefs._comparisonMode = _prefs._PHASH; ui->directoryBox->setFocus(); }
void on_selectSSIM_clicked(const bool &checked) { if(checked) _prefs._comparisonMode = _prefs._SSIM; ui->directoryBox->setFocus(); }
void on_blocksizeCombo_activated(const int &index) { _prefs._ssimBlockSize = static_cast<int>(pow(2, index+1)); ui->directoryBox->setFocus(); }
void on_differentDurationCombo_activated(const int &index) { _prefs._differentDurationModifier = index; ui->directoryBox->setFocus(); }
void on_sameDurationCombo_activated(const int &index) { _prefs._sameDurationModifier = index; ui->directoryBox->setFocus(); }
void on_thresholdSlider_valueChanged(const int &value) { ui->thresholdSlider->setValue(value); calculateThreshold(value); ui->directoryBox->setFocus(); }
void calculateThreshold(const int &value);
void on_browseFolders_clicked() const;
void on_directoryBox_returnPressed() { on_findDuplicates_clicked(); }
void on_findDuplicates_clicked();
void findVideos(QDir &dir);
void processVideos();
void videoSummary();
void addStatusMessage(const QString &message) const;
void addVideo(Video *addMe);
void removeVideo(Video *deleteMe);
};
#endif // MAINWINDOW_H