-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathCameraController.h
More file actions
81 lines (63 loc) · 2.28 KB
/
CameraController.h
File metadata and controls
81 lines (63 loc) · 2.28 KB
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
#ifndef __CameraControllerApi__
#define __CameraControllerApi__
#include <iostream>
#include <string>
#include <vector>
#include <exception>
#include <gphoto2/gphoto2-camera.h>
#include "predef.h"
using std::string;
class CameraController
{
static GPContextErrorFunc _error_callback(GPContext *context, const char *text, void *data);
static GPContextMessageFunc _message_callback(GPContext *context, const char *text, void *data);
public:
CameraController();
~CameraController();
void init();
void release();
string getport();
void setPort(string port);
bool camera_found();
bool is_initialized();
bool is_halfpressed() { return _halfpressed; }
bool is_busy();
void is_bussy(bool busy);
int capture(const char *filename);
int capture2(const char* filename);
int capture3(const char* filename);
int downloadimage(const char* filename);
int get_settings_value(const char *key, string &val);
int get_settings_choices(const char *key, std::vector<string> &choices);
int set_settings_value(const char *key, const char *val);
int set_settings_value(const char* key, int val);
int apply_autofocus(int camnum, bool enable);
int apply_essential_param_param(int camnum);
void set_essential_param(CAMERA_PARAM param, string value);
// int preview(const char **file_data);
// int bulb(const char *filename, string &data);
// int get_settings(ptree &sett);
// int get_files(ptree &tree);
// int get_file(const char *filename, const char *filepath, string &base64out);
private:
Camera *_camera;
GPContext *_context;
bool _halfpressed;
bool _is_busy;
bool _liveview_running;
bool _camera_found;
bool _is_initialized;
bool _save_images;
// string iso;
// string shutterspeed;
// string aperture;
string port;
void _init_camera();
int _wait_and_handle_event (useconds_t waittime, CameraEventType *type, int download);
void _set_capturetarget(int index);
// int _get_files(ptree &tree, const char *folder);
// void _build_settings_tree(CameraWidget *w);
// void _read_widget(CameraWidget *w, ptree &tree, string node);
// void _get_item_value(CameraWidget *w, ptree &tree);
};
#endif