summaryrefslogtreecommitdiffhomepage
path: root/video-ps3eye/module.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'video-ps3eye/module.hpp')
-rw-r--r--video-ps3eye/module.hpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/video-ps3eye/module.hpp b/video-ps3eye/module.hpp
index 56ffe5df..26cfad60 100644
--- a/video-ps3eye/module.hpp
+++ b/video-ps3eye/module.hpp
@@ -10,6 +10,7 @@
#include <QDialog>
#include <QProcess>
+#include <QTimer>
using namespace options;
@@ -34,6 +35,7 @@ class dialog final : public QWidget
Q_OBJECT
Ui_Dialog ui;
settings s;
+ QTimer t{this};
shm_wrapper shm { "ps3eye-driver-shm", nullptr, sizeof(ps3eye::shm) };
@@ -41,10 +43,11 @@ class dialog final : public QWidget
void do_cancel() { s.b->reload(); close(); deleteLater(); }
protected:
- void closeEvent(QCloseEvent*) override { do_cancel(); }
+ void closeEvent(QCloseEvent*) override { do_cancel(); if (t.isActive()) { s.set_exposure(); s.set_gain(); } }
public:
explicit dialog(QWidget* parent = nullptr);
+ static void show_open_failure_msgbox(const QString& error);
};
struct ps3eye_camera final : video::impl::camera
@@ -54,7 +57,7 @@ struct ps3eye_camera final : video::impl::camera
settings s;
frame fr;
Timer t;
- unsigned char data[640 * 480 * 3] = {};
+ unsigned char data[640 * 480 * ps3eye::num_channels] = {};
int framerate = 30, sleep_ms = 1;
bool open = false;
unsigned timecode = 0;