aboutsummaryrefslogtreecommitdiff
path: root/brightness_ctrl.hpp
diff options
context:
space:
mode:
authorGravatar Chris Xiong <chirs241097@gmail.com> 2018-07-11 11:05:55 +0800
committerGravatar Chris Xiong <chirs241097@gmail.com> 2018-07-11 11:05:55 +0800
commit37ba32b0bbb368a392d2e10b11e45fbde3126e69 (patch)
tree9df0348ccb4e87b2d7c95821a5cd7d3a0f8c1c89 /brightness_ctrl.hpp
parentb5932d1d22d35cef95eb1cffbf489619b264442d (diff)
downloadlightsd-37ba32b0bbb368a392d2e10b11e45fbde3126e69.tar.xz
Manual mode added.
Quit gracefully. Multiple code clean-ups in the Sensor class.
Diffstat (limited to 'brightness_ctrl.hpp')
-rw-r--r--brightness_ctrl.hpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/brightness_ctrl.hpp b/brightness_ctrl.hpp
index c1e8a34..fce960d 100644
--- a/brightness_ctrl.hpp
+++ b/brightness_ctrl.hpp
@@ -1,3 +1,5 @@
+//Chris Xiong 2018
+//3-Clause BSD License
#ifndef BRIGHTNESS_CTRL_HPP
#define BRIGHTNESS_CTRL_HPP
#include <chrono>
@@ -13,6 +15,7 @@ private:
filesystem::path cpath,brpath,maxbrpath;
std::vector<int> thresh,value;
int delay,direction,br,maxbr,minabr,tr,offset;
+ int doffset;
size_t cur;
SensorALS *als;
std::mutex interrupt_m,threshnotify_m,adjust_m;
@@ -21,13 +24,16 @@ private:
public:
void init(float initv,SensorALS *s);
void set_path(filesystem::path p);
- void set_thresh(std::vector<int> _th);
- void set_value(std::vector<int> _v);
+ void set_thresh(const std::vector<int> &_th);
+ void set_value(const std::vector<int> &_v);
void set_delay(int _d);
void set_trigrange(int _tr);
void set_minabr(int _mbr);
void set_offset(int rel,int off);
+ void set_frozen(bool frozen);
+ int get_offset();
+ int get_brightness();
void force_adjust();
void on_sensor_report(float v);