diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2020-03-29 15:35:26 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2020-03-29 15:36:42 +0200 |
commit | afe7629a1308f51b2fbcca40af8e4d16cea6c9cc (patch) | |
tree | 00021b7430e2f2350be21a7898c60f32d05ef30d /video-ps3eye/module.hpp | |
parent | 4ed107dcc0889d8267d9a69bb6077576f81790ce (diff) |
video/ps3eye: implement dialog
Diffstat (limited to 'video-ps3eye/module.hpp')
-rw-r--r-- | video-ps3eye/module.hpp | 34 |
1 files changed, 29 insertions, 5 deletions
diff --git a/video-ps3eye/module.hpp b/video-ps3eye/module.hpp index 957e221e..9f7aaec1 100644 --- a/video-ps3eye/module.hpp +++ b/video-ps3eye/module.hpp @@ -5,21 +5,45 @@ #include "compat/shm.h" #include "options/options.hpp" #include "compat/macros1.h" +#include "ui_dialog.h" -using namespace options; - +#include <QDialog> #include <QProcess> +using namespace options; + using video::impl::camera; using video::impl::camera_; using video::frame; -struct settings : opts +struct settings final { - settings() : opts{"video-ps3eye"} {} + bundle b = make_bundle("video-ps3eye"); + shm_wrapper shm { "ps3eye-driver-shm", nullptr, sizeof(ps3eye::shm) }; - value<slider_value> exposure{b, "exposure", {63, 0, 63}}; + value<slider_value> exposure{b, "exposure", {255, 0, 255}}; value<slider_value> gain{b, "gain", {30, 0, 63}}; + + void set_exposure(); + void set_gain(); +}; + +class dialog final : public QWidget +{ + Q_OBJECT + Ui_Dialog ui; + settings s; + + shm_wrapper shm { "ps3eye-driver-shm", nullptr, sizeof(ps3eye::shm) }; + + void do_ok() { s.b->save(); close(); deleteLater(); } + void do_cancel() { s.b->reload(); close(); deleteLater(); } + +protected: + void closeEvent(QCloseEvent*) override { do_cancel(); } + +public: + explicit dialog(QWidget* parent = nullptr); }; struct ps3eye_camera final : video::impl::camera |