-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathlibwing.h
More file actions
124 lines (108 loc) · 6.84 KB
/
libwing.h
File metadata and controls
124 lines (108 loc) · 6.84 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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
#ifndef LIBWING_H
#define LIBWING_H
#include <stdint.h>
#ifdef __cplusplus
extern "C" {
#endif
typedef struct WingDiscoveryInfo WingDiscoveryInfo;
typedef struct WingConsole WingConsole;
typedef struct WingMeter WingMeter;
typedef struct Response Response;
// Enums
typedef enum {
WING_RESPONSE_END = 0,
WING_RESPONSE_NODE_DEFINITION = 1,
WING_RESPONSE_NODE_DATA = 2
} WingResponseType;
typedef enum {
WING_NODE_TYPE_NODE = 0,
WING_NODE_TYPE_LINEAR_FLOAT = 1,
WING_NODE_TYPE_LOGARITHMIC_FLOAT = 2,
WING_NODE_TYPE_FADER_LEVEL = 3,
WING_NODE_TYPE_INTEGER = 4,
WING_NODE_TYPE_STRING_ENUM = 5,
WING_NODE_TYPE_FLOAT_ENUM = 6,
WING_NODE_TYPE_STRING = 7
} WingNodeType;
typedef enum {
WING_NODE_UNIT_NONE = 0,
WING_NODE_UNIT_DB = 1,
WING_NODE_UNIT_PERCENT = 2,
WING_NODE_UNIT_MILLISECONDS = 3,
WING_NODE_UNIT_HERTZ = 4,
WING_NODE_UNIT_METERS = 5,
WING_NODE_UNIT_SECONDS = 6,
WING_NODE_UNIT_OCTAVES = 7
} WingNodeUnit;
typedef enum {
CHANNEL = 0xA0,
AUX = 0xA1,
BUS = 0xA2,
MAIN = 0xA3,
MATRIX = 0xA4,
DCA = 0xA5,
FX = 0xA6,
SOURCE = 0xA7,
OUTPUT = 0xA8,
MONITOR = 0xA9,
RTA = 0xAA,
CHANNEL2 = 0xAB,
AUX2 = 0xAC,
BUS2 = 0xAD,
MAIN2 = 0xAE,
MATRIX2 = 0xAF
} MeterType;
#define METER_ID(type, index) (((type << 8) | (index & 0xFF)) & 0xFFFF)
WingDiscoveryInfo* wing_discover_scan (int stop_on_first); // Return value must be freed by wing_discover_destroy()
int wing_discover_count (const WingDiscoveryInfo* handle);
const char* wing_discover_get_ip (const WingDiscoveryInfo* handle, int index); // Return value must be free by wing_string_destroy()
const char* wing_discover_get_name (const WingDiscoveryInfo* handle, int index); // Return value must be free by wing_string_destroy()
const char* wing_discover_get_model (const WingDiscoveryInfo* handle, int index); // Return value must be free by wing_string_destroy()
const char* wing_discover_get_serial (const WingDiscoveryInfo* handle, int index); // Return value must be free by wing_string_destroy()
const char* wing_discover_get_firmware (const WingDiscoveryInfo* handle, int index); // Return value must be free by wing_string_destroy()
void wing_discover_destroy (WingDiscoveryInfo* handle);
WingConsole* wing_console_connect (const char* ip); // Return value must be freed by wing_console_destroy()
Response* wing_console_read (WingConsole* handle); // Return value must be freed by wing_response_destroy()
int wing_console_set_string (WingConsole* handle, int32_t id, const char* value);
int wing_console_set_float (WingConsole* handle, int32_t id, float value);
int wing_console_set_int (WingConsole* handle, int32_t id, int value);
int wing_console_request_node_definition (WingConsole* handle, int32_t id);
int wing_console_request_node_data (WingConsole* handle, int32_t id);
uint16_t wing_console_request_meter (WingConsole* handle, uint16_t *meter_ids, size_t len); // see above about meter ids
int wing_console_read_meter (WingConsole* handle, WingMeter* meter, uint16_t *out_id, int16_t *out_data);
void wing_console_destroy (WingConsole* handle);
WingResponseType wing_response_get_type (const Response* handle);
void wing_response_destroy (Response* handle);
const char* wing_node_data_get_string (const Response* handle); // Return value must be free by wing_string_destroy()
float wing_node_data_get_float (const Response* handle);
int wing_node_data_get_int (const Response* handle);
int wing_node_data_has_string (const Response* handle);
int wing_node_data_has_float (const Response* handle);
int wing_node_data_has_int (const Response* handle);
int32_t wing_node_definition_get_parent_id (const Response* handle);
int32_t wing_node_definition_get_id (const Response* handle);
uint16_t wing_node_definition_get_index (const Response* handle);
WingNodeType wing_node_definition_get_type (const Response* handle);
WingNodeUnit wing_node_definition_get_unit (const Response* handle);
const char* wing_node_definition_get_name (const Response* handle); // Return value must be free by wing_string_destroy()
const char* wing_node_definition_get_long_name (const Response* handle); // Return value must be free by wing_string_destroy()
int wing_node_definition_is_read_only (const Response* handle);
int wing_node_definition_get_min_float (const Response* handle, float* ret);
int wing_node_definition_get_max_float (const Response* handle, float* ret);
int wing_node_definition_get_steps (const Response* handle, int* ret);
int wing_node_definition_get_min_int (const Response* handle, int* ret);
int wing_node_definition_get_max_int (const Response* handle, int* ret);
int wing_node_definition_get_max_string_len (const Response* handle, int* ret);
int wing_node_definition_get_string_enum_count (const Response* handle);
int wing_node_definition_get_float_enum_count (const Response* handle);
int wing_node_definition_get_float_enum_item (const Response* handle, int index, float* ret);
int wing_node_definition_get_float_enum_long_item (const Response* handle, int index, const char** ret);
int wing_node_definition_get_string_enum_item (const Response* handle, int index, const char** ret);
int wing_node_definition_get_string_enum_long_item (const Response* handle, int index, const char** ret);
int wing_name_to_id (const char* name, int32_t* out_id);
// you must call this to free the memory of any string returned by the library
void wing_string_destroy (const char* handle);
#ifdef __cplusplus
}
#endif
#endif /* LIBWING_H */