-
Notifications
You must be signed in to change notification settings - Fork 0
/
lv2_ext.cpp
61 lines (49 loc) · 1.68 KB
/
lv2_ext.cpp
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
//
// Created by djshaji on 5/3/24.
//
#include "lv2_ext.h"
int lv2_urid_map (URID * handle, const char * string) {
handle -> urids.push_back(std::string (string));
return handle -> urids.size();
}
void lv2_urid_unmap (URID * handle, int at) {
handle -> urids.erase(std::next(handle -> urids.begin(), at));
}
//int logger_printf (LV2_Log_Handle handle, LV2_URID type, const char* fmt, va_list ap) {
// return LOGD(fmt, ap);
//}
LV2_State_Status
store_callback(LV2_State_Handle handle,
std::basic_string<char> key,
const void* value,
size_t size,
uint32_t type,
uint32_t flags)
{
if ((flags & LV2_STATE_IS_POD)) {
// We only care about POD since we're keeping state in memory only.
// Disk or network use would also require LV2_STATE_IS_PORTABLE.
std::map<std::string, std::string> state_map ;
state_map [key] = std::string ((char *) value);
return LV2_STATE_SUCCESS;;
} else {
return LV2_STATE_ERR_BAD_FLAGS; // Non-POD events are unsupported
}
}
const void* retrieve_callback (LV2_State_Handle handle,
uint32_t key,
size_t* size,
uint32_t* type,
uint32_t* flags) {
return nullptr;
}
int logger_vprintf(LV2_Log_Handle handle,
LV2_URID type,
const char* fmt,
va_list ap) {
LOGD(fmt, ap);
return 0 ;
}
int logger_printf(LV2_Log_Handle handle, LV2_URID type, const char *fmt, ...) {
return 0;
}