updated project

This commit is contained in:
Jared Bruni
2019-09-14 06:27:42 -07:00
parent c9afd2aeb7
commit 09a4b3c621
9 changed files with 99 additions and 5 deletions

View File

@@ -14,5 +14,5 @@ QMAKE_CXXFLAGS += -std=c++11 `pkg-config acidcam opencv --cflags`
RESOURCES += qresource.qrc
QMAKE_CFLAGS_ISYSTEM = -I
# Input
HEADERS += main_window.h new_dialog.h plugin.h qtheaders.h select_image.h display_window.h playback_thread.h search_box.h goto_window.h chroma_window.h user_define.h dl-man.h image_window.h
SOURCES += main.cpp main_window.cpp new_dialog.cpp plugin.cpp select_image.cpp display_window.cpp playback_thread.cpp search_box.cpp goto_window.cpp chroma_window.cpp user_define.cpp dl-man.cpp image_window.cpp
HEADERS += main_window.h new_dialog.h plugin.h qtheaders.h select_image.h display_window.h playback_thread.h search_box.h goto_window.h chroma_window.h user_define.h dl-man.h image_window.h options_window.h
SOURCES += main.cpp main_window.cpp new_dialog.cpp plugin.cpp select_image.cpp display_window.cpp playback_thread.cpp search_box.cpp goto_window.cpp chroma_window.cpp user_define.cpp dl-man.cpp image_window.cpp options_window.cpp

View File

@@ -14,5 +14,5 @@ QMAKE_CXXFLAGS += -std=c++11 `pkg-config acidcam opencv4 --cflags`
RESOURCES += qresource.qrc
# Input
HEADERS += main_window.h new_dialog.h plugin.h qtheaders.h select_image.h display_window.h playback_thread.h search_box.h goto_window.h chroma_window.h user_define.h dl-man.h image_window.h
SOURCES += main.cpp main_window.cpp new_dialog.cpp plugin.cpp select_image.cpp display_window.cpp playback_thread.cpp search_box.cpp goto_window.cpp chroma_window.cpp user_define.cpp dl-man.cpp image_window.cpp
HEADERS += main_window.h new_dialog.h plugin.h qtheaders.h select_image.h display_window.h playback_thread.h search_box.h goto_window.h chroma_window.h user_define.h dl-man.h image_window.h options_window.h
SOURCES += main.cpp main_window.cpp new_dialog.cpp plugin.cpp select_image.cpp display_window.cpp playback_thread.cpp search_box.cpp goto_window.cpp chroma_window.cpp user_define.cpp dl-man.cpp image_window.cpp options_window.cpp

View File

@@ -95,6 +95,9 @@ AC_MainWindow::AC_MainWindow(QWidget *parent) : QMainWindow(parent) {
image_window = new ImageWindow(this);
image_window->setPlayback(playback);
pref_window = new OptionsWindow(this);
pref_window->setPlayback(playback);
QObject::connect(playback, SIGNAL(procImage(QImage)), this, SLOT(updateFrame(QImage)));
QObject::connect(playback, SIGNAL(stopRecording()), this, SLOT(stopRecording()));
QObject::connect(playback, SIGNAL(frameIncrement()), this, SLOT(frameInc()));
@@ -354,6 +357,11 @@ void AC_MainWindow::createMenu() {
file_exit->setShortcut(tr("Ctrl+X"));
file_menu->addAction(file_exit);
show_options_window = new QAction(tr("Show Preferences"), this);
options->addAction(show_options_window);
connect(show_options_window, SIGNAL(triggered()), this, SLOT(showPrefWindow()));
movement = options->addMenu(tr("Movement"));
in_out_increase = new QAction(tr("Move In, Move Out, Increase"), this);
in_out_increase->setCheckable(true);
@@ -415,6 +423,7 @@ void AC_MainWindow::createMenu() {
options->addAction(fade_on);
options->addAction(repeat_v);
connect(fade_on, SIGNAL(triggered()), this, SLOT(setFade()));
connect(repeat_v, SIGNAL(triggered()), this, SLOT(repeat_vid()));
connect(clear_image, SIGNAL(triggered()), this, SLOT(clear_img()));
@@ -575,6 +584,9 @@ void AC_MainWindow::noflip_action() {
}
void AC_MainWindow::showPrefWindow() {
pref_window->show();
}
void AC_MainWindow::repeat_vid() {
bool val = repeat_v->isChecked();
playback->enableRepeat(val);

View File

@@ -18,6 +18,7 @@
#include "user_define.h"
#include "dl-man.h"
#include "image_window.h"
#include "options_window.h"
class SearchWindow;
@@ -56,6 +57,7 @@ public:
QAction *set_newnames;
QAction *show_fullscreen;
QAction *show_image_window;
QAction *show_options_window;
double speed_actions[7];
QRadioButton *filter_single, *filter_custom;
void updateList();
@@ -121,6 +123,7 @@ public slots:
void save_CustomFile();
void showFull();
void showImageWindow();
void showPrefWindow();
private:
void createControls();
void createMenu();
@@ -132,6 +135,7 @@ private:
DefineWindow *define_window;
ImageWindow *image_window;
GotoWindow *goto_window;
OptionsWindow *pref_window;
cv::VideoCapture capture_camera, capture_video;
cv::VideoWriter writer;
unsigned long video_frames;

44
src/options_window.cpp Normal file
View File

@@ -0,0 +1,44 @@
#include "options_window.h"
OptionsWindow::OptionsWindow(QWidget *parent) : QDialog(parent) {
setFixedSize(170, 175);
createControls();
}
void OptionsWindow::createControls() {
QLabel *label_x = new QLabel(tr("Thread Count: "), this);
label_x->setGeometry(10, 10, 100, 25);
op_thread = new QLineEdit("4", this);
op_thread->setGeometry(110, 10, 50, 25);
QLabel *label_y = new QLabel(tr("Intensity: "), this);
label_y->setGeometry(10, 40, 100, 25);
op_intensity = new QLineEdit("55", this);
op_intensity->setGeometry(110, 40, 50, 25);
op_setpref = new QPushButton(tr("Set"), this);
op_setpref->setGeometry(10, 135, 100, 25);
connect(op_setpref, SIGNAL(clicked()), this, SLOT(setValues()));
}
void OptionsWindow::setValues() {
int thread_count = atoi(op_thread->text().toStdString().c_str());
if(thread_count <= 0) {
QMessageBox::information(this, "Error require valid thread count", "Requires Valid Thread Count...");
return;
}
int intensity = atoi(op_intensity->text().toStdString().c_str());
if(intensity <= 0) {
QMessageBox::information(this, "Error requires valid intensity", "To set the value you must provide a valid intensity");
return;
}
playback->setPref(thread_count, intensity);
QString text;
QTextStream stream(&text);
stream << "Thread Count set to: " << thread_count << " and Intensity set to: " << intensity;
QMessageBox::information(this, "Pref Value Set", text);
}
void OptionsWindow::setPlayback(Playback *p) {
playback = p;
}

23
src/options_window.h Normal file
View File

@@ -0,0 +1,23 @@
#ifndef __OPTIONS_WINDOW_H__
#define __OPTIONS_WINDOW_H__
#include "qtheaders.h"
#include "playback_thread.h"
class OptionsWindow : public QDialog {
Q_OBJECT
public:
OptionsWindow(QWidget *parent);
void createControls();
void setPlayback(Playback *p);
public slots:
void setValues();
private:
QLineEdit *op_thread;
QLineEdit *op_intensity;
QPushButton *op_setpref;
Playback *playback;
};
#endif

View File

@@ -126,6 +126,9 @@ void Playback::setCycle(int type, int frame_skip, std::vector<std::string> &v) {
frame_num = frame_skip;
blend_image = cv::imread(v[0]);
blend_set = true;
static std::random_device r;
static auto rng = std::default_random_engine(r());
std::shuffle(cycle_values.begin(), cycle_values.end(), rng);
}
mutex.unlock();
}
@@ -163,6 +166,13 @@ void Playback::setColorOptions(int b, int g, int s) {
mutex.unlock();
}
void Playback::setPref(int thread_count, int intense) {
mutex.lock();
ac::setThreadCount(thread_count);
ac::setPixelCollection(intense);
mutex.unlock();
}
void Playback::setIndexChanged(std::string value) {
prev_filter = current_filter;
current_filter = filter_map[value];

View File

@@ -79,6 +79,7 @@ public:
void enableRepeat(bool re);
void setCycle(int type, int frame_skip, std::vector<std::string> &val);
void setCycle(int type);
void setPref(int thread_count, int intense);
signals:
void procImage(const QImage image);
void stopRecording();

View File

@@ -6,7 +6,7 @@
#ifndef _QT_HEADERS__
#define _QT_HEADERS__
#define ac_version "v1.44.0"
#define ac_version "v1.45.0"
#include<QApplication>
#include<QMainWindow>
#include<QDialog>