mirror of
https://github.com/lostjared/Acid.Cam.v2.Qt.git
synced 2025-12-19 21:29:59 +01:00
Working on new camera session dialog
This commit is contained in:
@@ -38,7 +38,10 @@ AC_MainWindow::AC_MainWindow(QWidget *parent) : QMainWindow(parent) {
|
|||||||
createMenu();
|
createMenu();
|
||||||
|
|
||||||
cap_camera = new CaptureCamera(this);
|
cap_camera = new CaptureCamera(this);
|
||||||
|
cap_camera->setParent(this);
|
||||||
|
|
||||||
cap_video = new CaptureVideo(this);
|
cap_video = new CaptureVideo(this);
|
||||||
|
cap_video->setParent(this);
|
||||||
|
|
||||||
statusBar()->showMessage(tr("Acid Cam v2 Loaded - Use File Menu to Start"));
|
statusBar()->showMessage(tr("Acid Cam v2 Loaded - Use File Menu to Start"));
|
||||||
}
|
}
|
||||||
@@ -130,7 +133,7 @@ void AC_MainWindow::createMenu() {
|
|||||||
controls_stop->setShortcut(tr("Ctrl+C"));
|
controls_stop->setShortcut(tr("Ctrl+C"));
|
||||||
controls_menu->addAction(controls_stop);
|
controls_menu->addAction(controls_stop);
|
||||||
|
|
||||||
controls_snapshot = new QAction(tr("&Snap"), this);
|
controls_snapshot = new QAction(tr("Take &Snapshot"), this);
|
||||||
controls_snapshot->setShortcut(tr("Ctrl+S"));
|
controls_snapshot->setShortcut(tr("Ctrl+S"));
|
||||||
controls_menu->addAction(controls_snapshot);
|
controls_menu->addAction(controls_snapshot);
|
||||||
|
|
||||||
@@ -200,6 +203,19 @@ void AC_MainWindow::Log(const QString &s) {
|
|||||||
log_text->setTextCursor(tmpCursor);
|
log_text->setTextCursor(tmpCursor);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool AC_MainWindow::startCamera(int res, int dev, const QString &outdir, bool record) {
|
||||||
|
|
||||||
|
// setup device
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// if successful
|
||||||
|
file_new_capture->setEnabled(false);
|
||||||
|
file_new_video->setEnabled(false);
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
void AC_MainWindow::controls_Stop() {
|
void AC_MainWindow::controls_Stop() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ class AC_MainWindow : public QMainWindow {
|
|||||||
public:
|
public:
|
||||||
AC_MainWindow(QWidget *parent = 0);
|
AC_MainWindow(QWidget *parent = 0);
|
||||||
void Log(const QString &s);
|
void Log(const QString &s);
|
||||||
|
bool startCamera(int res, int dev, const QString &outdir, bool record);
|
||||||
|
|
||||||
QListWidget *filters, *custom_filters;
|
QListWidget *filters, *custom_filters;
|
||||||
QPushButton *btn_add, *btn_remove, *btn_moveup, *btn_movedown;
|
QPushButton *btn_add, *btn_remove, *btn_moveup, *btn_movedown;
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
#include "new_dialog.h"
|
#include "new_dialog.h"
|
||||||
|
#include "main_window.h"
|
||||||
|
|
||||||
|
|
||||||
CaptureCamera::CaptureCamera(QWidget *parent) : QDialog(parent) {
|
CaptureCamera::CaptureCamera(QWidget *parent) : QDialog(parent) {
|
||||||
setFixedSize(290, 120);
|
setFixedSize(290, 120);
|
||||||
@@ -38,12 +40,28 @@ void CaptureCamera::createControls() {
|
|||||||
connect(btn_select, SIGNAL(clicked()), this, SLOT(btn_Select()));
|
connect(btn_select, SIGNAL(clicked()), this, SLOT(btn_Select()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CaptureCamera::setParent(AC_MainWindow *p) {
|
||||||
|
win_parent = p;
|
||||||
|
}
|
||||||
|
|
||||||
void CaptureCamera::btn_Select() {
|
void CaptureCamera::btn_Select() {
|
||||||
|
|
||||||
|
QString dir = QFileDialog::getExistingDirectory(this, tr("Open Directory"), "/home",QFileDialog::ShowDirsOnly | QFileDialog::DontResolveSymlinks);
|
||||||
|
|
||||||
|
if(dir != "") {
|
||||||
|
output_dir->setText(dir);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CaptureCamera::btn_Start() {
|
void CaptureCamera::btn_Start() {
|
||||||
|
if(output_dir->text().length() > 0) {
|
||||||
|
if(win_parent->startCamera(combo_res->currentIndex(), combo_device->currentIndex(), output_dir->text(), chk_record->isChecked())) {
|
||||||
|
hide();
|
||||||
|
|
||||||
|
} else {
|
||||||
|
QMessageBox::information(this, "Could not open Capture device", "Make sure you Webcam is pluged in. If you have more than one Webcam use the proper device index.");
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
CaptureVideo::CaptureVideo(QWidget *parent) : QDialog(parent) {
|
CaptureVideo::CaptureVideo(QWidget *parent) : QDialog(parent) {
|
||||||
@@ -56,3 +74,11 @@ CaptureVideo::CaptureVideo(QWidget *parent) : QDialog(parent) {
|
|||||||
void CaptureVideo::createControls() {
|
void CaptureVideo::createControls() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CaptureVideo::setParent(AC_MainWindow *p) {
|
||||||
|
win_parent = p;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -3,21 +3,27 @@
|
|||||||
|
|
||||||
#include "qtheaders.h"
|
#include "qtheaders.h"
|
||||||
|
|
||||||
|
class AC_MainWindow;
|
||||||
|
|
||||||
class CaptureCamera : public QDialog {
|
class CaptureCamera : public QDialog {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
CaptureCamera(QWidget *parent = 0);
|
CaptureCamera(QWidget *parent = 0);
|
||||||
void createControls();
|
void createControls();
|
||||||
|
void setParent(AC_MainWindow *p);
|
||||||
|
|
||||||
QComboBox *combo_res, *combo_device;
|
QComboBox *combo_res, *combo_device;
|
||||||
QLineEdit *output_dir;
|
QLineEdit *output_dir;
|
||||||
QCheckBox *chk_record;
|
QCheckBox *chk_record;
|
||||||
QPushButton *btn_start, *btn_select;
|
QPushButton *btn_start, *btn_select;
|
||||||
|
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void btn_Select();
|
void btn_Select();
|
||||||
void btn_Start();
|
void btn_Start();
|
||||||
|
|
||||||
|
private:
|
||||||
|
AC_MainWindow *win_parent;
|
||||||
};
|
};
|
||||||
|
|
||||||
class CaptureVideo : public QDialog {
|
class CaptureVideo : public QDialog {
|
||||||
@@ -25,6 +31,10 @@ class CaptureVideo : public QDialog {
|
|||||||
public:
|
public:
|
||||||
CaptureVideo(QWidget *parent = 0);
|
CaptureVideo(QWidget *parent = 0);
|
||||||
void createControls();
|
void createControls();
|
||||||
|
void setParent(AC_MainWindow *p);
|
||||||
|
|
||||||
|
private:
|
||||||
|
AC_MainWindow *win_parent;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -18,6 +18,7 @@
|
|||||||
#include<QLabel>
|
#include<QLabel>
|
||||||
#include<QTextStream>
|
#include<QTextStream>
|
||||||
#include<QLineEdit>
|
#include<QLineEdit>
|
||||||
|
#include<QFileDialog>
|
||||||
#include"ac.h"
|
#include"ac.h"
|
||||||
#include"fractal.h"
|
#include"fractal.h"
|
||||||
#include<unordered_map>
|
#include<unordered_map>
|
||||||
|
|||||||
Reference in New Issue
Block a user