From bb07b2adaf2356c29c24d1141fc8deb622006616 Mon Sep 17 00:00:00 2001 From: lostjared Date: Thu, 2 Feb 2017 10:11:42 -0800 Subject: [PATCH] working on video file dialog --- src/main_window.cpp | 17 +++++++++++++++++ src/main_window.h | 7 ++++--- src/new_dialog.cpp | 31 +++++++++++++++++++++++++++++-- src/new_dialog.h | 9 ++++++++- 4 files changed, 58 insertions(+), 6 deletions(-) diff --git a/src/main_window.cpp b/src/main_window.cpp index 5a0d3e0..5fb6de9 100644 --- a/src/main_window.cpp +++ b/src/main_window.cpp @@ -212,7 +212,16 @@ bool AC_MainWindow::startCamera(int res, int dev, const QString &outdir, bool re // if successful file_new_capture->setEnabled(false); file_new_video->setEnabled(false); + return true; +} +bool AC_MainWindow::startVideo(const QString &filename, const QString &outdir, bool record) { + + + + // if successful + file_new_capture->setEnabled(false); + file_new_video->setEnabled(false); return true; } @@ -244,6 +253,14 @@ void AC_MainWindow::controls_Step() { } +void AC_MainWindow::timer_Camera() { + +} + +void AC_MainWindow::timer_Video() { + +} + void AC_MainWindow::help_About() { QMessageBox::information(this, tr("About Acid Cam"), tr("Written by Jared Bruni

Social Media Accounts

\n\n GitHub
\nYouTube
Instagram
Facebook

\n")); } diff --git a/src/main_window.h b/src/main_window.h index 6da1e5a..d806cff 100644 --- a/src/main_window.h +++ b/src/main_window.h @@ -10,7 +10,7 @@ public: AC_MainWindow(QWidget *parent = 0); void Log(const QString &s); bool startCamera(int res, int dev, const QString &outdir, bool record); - + bool startVideo(const QString &filename, const QString &outdir, bool record); QListWidget *filters, *custom_filters; QPushButton *btn_add, *btn_remove, *btn_moveup, *btn_movedown; QTextEdit *log_text; @@ -33,14 +33,15 @@ public slots: void controls_Pause(); void controls_Step(); void help_About(); - - + void timer_Camera(); + void timer_Video(); private: void createControls(); void createMenu(); CaptureCamera *cap_camera; CaptureVideo *cap_video; + cv::VideoCapture capture_camera, capture_video; }; diff --git a/src/new_dialog.cpp b/src/new_dialog.cpp index 86a59ac..5204bea 100644 --- a/src/new_dialog.cpp +++ b/src/new_dialog.cpp @@ -65,20 +65,47 @@ void CaptureCamera::btn_Start() { } CaptureVideo::CaptureVideo(QWidget *parent) : QDialog(parent) { - setFixedSize(640, 480); + setFixedSize(330, 100); setWindowTitle(("Capture from Video")); setWindowIcon(QPixmap(":/images/icon.png")); createControls(); } void CaptureVideo::createControls() { + btn_setedit = new QPushButton("Source File", this); + btn_setedit->setGeometry(10, 10, 110, 20); + edit_src = new QLineEdit(this); + edit_src->setGeometry(120, 10, 200, 20); + edit_src->setReadOnly(true); + btn_setout = new QPushButton("Set Output", this); + btn_setout->setGeometry(10, 30, 110, 20); + edit_outdir = new QLineEdit(this); + edit_outdir->setGeometry(120, 30, 200, 20); + edit_outdir->setReadOnly(true); + btn_start = new QPushButton("Start", this); + btn_start->setGeometry(10, 60, 100, 20); + chk_record = new QCheckBox("Record", this); + chk_record->setGeometry(110, 60, 100, 20); + connect(btn_setedit, SIGNAL(clicked()), this, SLOT(btn_SetSourceFile())); + connect(btn_setout, SIGNAL(clicked()), this, SLOT(btn_SetOutputDir())); + connect(btn_start, SIGNAL(clicked()), this, SLOT(btn_Start())); } void CaptureVideo::setParent(AC_MainWindow *p) { win_parent = p; } - +void CaptureVideo::btn_SetSourceFile() { + +} + +void CaptureVideo::btn_SetOutputDir() { + +} + +void CaptureVideo::btn_Start() { + +} diff --git a/src/new_dialog.h b/src/new_dialog.h index 026403a..3349de8 100644 --- a/src/new_dialog.h +++ b/src/new_dialog.h @@ -32,7 +32,14 @@ public: CaptureVideo(QWidget *parent = 0); void createControls(); void setParent(AC_MainWindow *p); - + + QLineEdit *edit_src, *edit_outdir; + QPushButton *btn_setedit, *btn_setout, *btn_start; + QCheckBox *chk_record; +public slots: + void btn_SetSourceFile(); + void btn_SetOutputDir(); + void btn_Start(); private: AC_MainWindow *win_parent;