-
Notifications
You must be signed in to change notification settings - Fork 0
/
LightpackDevice.hpp
43 lines (31 loc) · 1.13 KB
/
LightpackDevice.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#ifndef LIGHTPACK_DEVICE_HPP
#define LIGHTPACK_DEVICE_HPP
#include <boost/utility.hpp>
#include <libusb-1.0/libusb.h>
#include "colorspace_types.hpp"
#include <vector>
namespace prismatoid {
namespace devices {
const int kLightpackDeviceBufferSize = 61;
namespace types = prismatoid::types;
class LightpackDevice: public boost::noncopyable {
public:
static LightpackDevice * init(libusb_context *ctx);
static LightpackDevice * instance();
virtual ~LightpackDevice();
bool open();
void close();
bool set_colors(const std::vector<types::Rgb12>& colors);
bool set_smoothness(const int smoothness);
protected:
LightpackDevice(libusb_context *ctx);
void write();
static LightpackDevice *this_;
private:
unsigned char buf_[kLightpackDeviceBufferSize];
libusb_context *ctx_;
libusb_device_handle *dev_;
};
} /* devices */
} /* prismatoid */
#endif /* end of include guard: LIGHTPACK_DEVICE_HPP */