Merge remote-tracking branch 'origin/main' into messaging
This commit is contained in:
commit
b4029257c2
@ -1,7 +1,7 @@
|
|||||||
#
|
#
|
||||||
# Tibia
|
# Tibia
|
||||||
#
|
#
|
||||||
# Copyright (C) 2023, 2024 Orastron Srl unipersonale
|
# Copyright (C) 2023-2025 Orastron Srl unipersonale
|
||||||
#
|
#
|
||||||
# Tibia is free software: you can redistribute it and/or modify
|
# Tibia is free software: you can redistribute it and/or modify
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
@ -18,6 +18,8 @@
|
|||||||
# File author: Stefano D'Angelo
|
# File author: Stefano D'Angelo
|
||||||
#
|
#
|
||||||
|
|
||||||
|
SHELL := bash -o pipefail
|
||||||
|
|
||||||
TEMPLATE := android
|
TEMPLATE := android
|
||||||
|
|
||||||
include vars.mk
|
include vars.mk
|
||||||
|
@ -18,6 +18,8 @@
|
|||||||
# File author: Stefano D'Angelo
|
# File author: Stefano D'Angelo
|
||||||
#
|
#
|
||||||
|
|
||||||
|
SHELL := bash -o pipefail
|
||||||
|
|
||||||
TEMPLATE := cmd
|
TEMPLATE := cmd
|
||||||
|
|
||||||
include vars.mk
|
include vars.mk
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
#
|
#
|
||||||
# Tibia
|
# Tibia
|
||||||
#
|
#
|
||||||
# Copyright (C) 2023, 2024 Orastron Srl unipersonale
|
# Copyright (C) 2023-2025 Orastron Srl unipersonale
|
||||||
#
|
#
|
||||||
# Tibia is free software: you can redistribute it and/or modify
|
# Tibia is free software: you can redistribute it and/or modify
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
@ -18,6 +18,8 @@
|
|||||||
# File author: Stefano D'Angelo
|
# File author: Stefano D'Angelo
|
||||||
#
|
#
|
||||||
|
|
||||||
|
SHELL := bash -o pipefail
|
||||||
|
|
||||||
TEMPLATE := daisy-seed
|
TEMPLATE := daisy-seed
|
||||||
|
|
||||||
include vars.mk
|
include vars.mk
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
#
|
#
|
||||||
# Tibia
|
# Tibia
|
||||||
#
|
#
|
||||||
# Copyright (C) 2024 Orastron Srl unipersonale
|
# Copyright (C) 2024, 2025 Orastron Srl unipersonale
|
||||||
#
|
#
|
||||||
# Tibia is free software: you can redistribute it and/or modify
|
# Tibia is free software: you can redistribute it and/or modify
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
@ -18,6 +18,8 @@
|
|||||||
# File author: Stefano D'Angelo
|
# File author: Stefano D'Angelo
|
||||||
#
|
#
|
||||||
|
|
||||||
|
SHELL := bash -o pipefail
|
||||||
|
|
||||||
TEMPLATE := ios
|
TEMPLATE := ios
|
||||||
|
|
||||||
include vars.mk
|
include vars.mk
|
||||||
@ -34,7 +36,7 @@ BUILD_DATA_DIR := build/gen/res
|
|||||||
-include $(MKINC_DIR)/vars-pre.mk
|
-include $(MKINC_DIR)/vars-pre.mk
|
||||||
|
|
||||||
CFLAGS := -O3 -Wall -Wpedantic -Wextra
|
CFLAGS := -O3 -Wall -Wpedantic -Wextra
|
||||||
CFLAGS_ALL := -I$(DATA_DIR)/src -I$(PLUGIN_DIR) -I$(API_DIR) -fvisiblity=hidden $(CFLAGS_EXTRA) $(CFLAGS)
|
CFLAGS_ALL := -I$(DATA_DIR)/src -I$(PLUGIN_DIR) -I$(API_DIR) -fvisibility=hidden $(CFLAGS_EXTRA) $(CFLAGS)
|
||||||
|
|
||||||
CXXFLAGS := $(CFLAGS)
|
CXXFLAGS := $(CFLAGS)
|
||||||
CXXFLAGS_ALL := -I$(DATA_DIR)/src -I$(PLUGIN_DIR) -I$(API_DIR) -fvisibility=hidden $(CXXFLAGS_EXTRA) $(CXXFLAGS)
|
CXXFLAGS_ALL := -I$(DATA_DIR)/src -I$(PLUGIN_DIR) -I$(API_DIR) -fvisibility=hidden $(CXXFLAGS_EXTRA) $(CXXFLAGS)
|
||||||
|
@ -164,6 +164,7 @@ void (^midiNotifyBlock)(const MIDINotification *message) = ^(const MIDINotificat
|
|||||||
};
|
};
|
||||||
|
|
||||||
void (^midiReceiveBlock)(const MIDIEventList *evtlist, void *srcConnRefCon) = ^(const MIDIEventList *evtlist, void *srcConnRefCon) {
|
void (^midiReceiveBlock)(const MIDIEventList *evtlist, void *srcConnRefCon) = ^(const MIDIEventList *evtlist, void *srcConnRefCon) {
|
||||||
|
(void)srcConnRefCon;
|
||||||
const MIDIEventPacket *p = evtlist->packet;
|
const MIDIEventPacket *p = evtlist->packet;
|
||||||
for (UInt32 i = 0; i < evtlist->numPackets; i++) {
|
for (UInt32 i = 0; i < evtlist->numPackets; i++) {
|
||||||
for (UInt32 j = 0; j < p->wordCount; j++) {
|
for (UInt32 j = 0; j < p->wordCount; j++) {
|
||||||
|
@ -26,5 +26,5 @@ module.exports = function (data, api) {
|
|||||||
api.generateFileFromTemplateFile(`src${sep}index.html`, `src${sep}index.html`, data);
|
api.generateFileFromTemplateFile(`src${sep}index.html`, `src${sep}index.html`, data);
|
||||||
api.copyFile(`src${sep}native.mm`, `src${sep}native.mm`);
|
api.copyFile(`src${sep}native.mm`, `src${sep}native.mm`);
|
||||||
api.copyFile(`src${sep}app-Bridging-Header.h`, `src${sep}app-Bridging-Header.h`);
|
api.copyFile(`src${sep}app-Bridging-Header.h`, `src${sep}app-Bridging-Header.h`);
|
||||||
api.copyFile(`src${sep}app.swift`, `src${sep}app.swift`, data);
|
api.copyFile(`src${sep}app.swift`, `src${sep}app.swift`);
|
||||||
};
|
};
|
||||||
|
@ -18,6 +18,8 @@
|
|||||||
# File author: Stefano D'Angelo
|
# File author: Stefano D'Angelo
|
||||||
#
|
#
|
||||||
|
|
||||||
|
SHELL := bash -o pipefail
|
||||||
|
|
||||||
TEMPLATE := lv2
|
TEMPLATE := lv2
|
||||||
|
|
||||||
include vars.mk
|
include vars.mk
|
||||||
@ -69,7 +71,7 @@ LDFLAGS :=
|
|||||||
LDFLAGS_ALL := -shared $(shell pkg-config --libs lv2) $(LDFLAGS_EXTRA) $(LDFLAGS)
|
LDFLAGS_ALL := -shared $(shell pkg-config --libs lv2) $(LDFLAGS_EXTRA) $(LDFLAGS)
|
||||||
|
|
||||||
CXXFLAGS := $(CFLAGS)
|
CXXFLAGS := $(CFLAGS)
|
||||||
CXXFLAGS_ALL := -I$(DATA_DIR)/src -I$(PLUGIN_DIR) -I$(API_DIR) -fPIC $(CXXFLAGS_EXTRA) $(CXXFLAGS)
|
CXXFLAGS_ALL := -I$(DATA_DIR)/src -I$(PLUGIN_DIR) -I$(API_DIR) $(shell pkg-config --cflags lv2) -fPIC -fvisibility=hidden $(CXXFLAGS_EXTRA) $(CXXFLAGS)
|
||||||
|
|
||||||
ifeq ($(UNAME_S), Darwin)
|
ifeq ($(UNAME_S), Darwin)
|
||||||
CFLAGS_ALL := $(CFLAGS_ALL) -arch arm64 -arch x86_64
|
CFLAGS_ALL := $(CFLAGS_ALL) -arch arm64 -arch x86_64
|
||||||
|
@ -62,7 +62,11 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if (DATA_PRODUCT_CONTROL_INPUTS_N > 0) && defined(DATA_STATE_DSP_CUSTOM)
|
#if (DATA_PRODUCT_CONTROL_INPUTS_N > 0) && defined(DATA_STATE_DSP_CUSTOM)
|
||||||
# include <stdatomic.h>
|
# ifdef __cplusplus
|
||||||
|
# include <atomic>
|
||||||
|
# else
|
||||||
|
# include <stdatomic.h>
|
||||||
|
# endif
|
||||||
# if defined(_WIN32) || defined(__CYGWIN__)
|
# if defined(_WIN32) || defined(__CYGWIN__)
|
||||||
# include <processthreadsapi.h>
|
# include <processthreadsapi.h>
|
||||||
# define yield SwitchToThread
|
# define yield SwitchToThread
|
||||||
@ -134,7 +138,11 @@ typedef struct {
|
|||||||
float params[DATA_PRODUCT_CONTROL_INPUTS_N];
|
float params[DATA_PRODUCT_CONTROL_INPUTS_N];
|
||||||
# ifdef DATA_STATE_DSP_CUSTOM
|
# ifdef DATA_STATE_DSP_CUSTOM
|
||||||
float params_sync[DATA_PRODUCT_CONTROL_INPUTS_N];
|
float params_sync[DATA_PRODUCT_CONTROL_INPUTS_N];
|
||||||
|
# ifdef __cplusplus
|
||||||
|
std::atomic_flag sync_lock_flag;
|
||||||
|
# else
|
||||||
atomic_flag sync_lock_flag;
|
atomic_flag sync_lock_flag;
|
||||||
|
# endif
|
||||||
char synced;
|
char synced;
|
||||||
char loaded;
|
char loaded;
|
||||||
# endif
|
# endif
|
||||||
@ -172,14 +180,22 @@ static const char * get_bundle_path_cb(void *handle) {
|
|||||||
#ifdef DATA_STATE_DSP_CUSTOM
|
#ifdef DATA_STATE_DSP_CUSTOM
|
||||||
static void state_lock_cb(void *handle) {
|
static void state_lock_cb(void *handle) {
|
||||||
plugin_instance * i = (plugin_instance *)handle;
|
plugin_instance * i = (plugin_instance *)handle;
|
||||||
|
# ifdef __cplusplus
|
||||||
|
while (i->sync_lock_flag.test_and_set())
|
||||||
|
# else
|
||||||
while (atomic_flag_test_and_set(&i->sync_lock_flag))
|
while (atomic_flag_test_and_set(&i->sync_lock_flag))
|
||||||
|
# endif
|
||||||
yield();
|
yield();
|
||||||
i->synced = 0;
|
i->synced = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void state_unlock_cb(void *handle) {
|
static void state_unlock_cb(void *handle) {
|
||||||
plugin_instance * i = (plugin_instance *)handle;
|
plugin_instance * i = (plugin_instance *)handle;
|
||||||
|
# ifdef __cplusplus
|
||||||
|
i->sync_lock_flag.clear();
|
||||||
|
# else
|
||||||
atomic_flag_clear(&i->sync_lock_flag);
|
atomic_flag_clear(&i->sync_lock_flag);
|
||||||
|
# endif
|
||||||
}
|
}
|
||||||
|
|
||||||
static int state_write_cb(void *handle, const char *data, size_t length) {
|
static int state_write_cb(void *handle, const char *data, size_t length) {
|
||||||
@ -231,7 +247,12 @@ static LV2_Handle instantiate(const struct LV2_Descriptor * descriptor, double s
|
|||||||
(void)descriptor;
|
(void)descriptor;
|
||||||
(void)bundle_path;
|
(void)bundle_path;
|
||||||
|
|
||||||
plugin_instance *instance = malloc(sizeof(plugin_instance));
|
// make C++ compilers happy
|
||||||
|
const char * missing;
|
||||||
|
plugin_callbacks cbs;
|
||||||
|
size_t req;
|
||||||
|
|
||||||
|
plugin_instance *instance = (plugin_instance *)malloc(sizeof(plugin_instance));
|
||||||
if (instance == NULL)
|
if (instance == NULL)
|
||||||
goto err_instance;
|
goto err_instance;
|
||||||
|
|
||||||
@ -240,7 +261,7 @@ static LV2_Handle instantiate(const struct LV2_Descriptor * descriptor, double s
|
|||||||
goto err_bundle_path;
|
goto err_bundle_path;
|
||||||
|
|
||||||
// from https://lv2plug.in/book
|
// from https://lv2plug.in/book
|
||||||
const char * missing = lv2_features_query(features,
|
missing = lv2_features_query(features,
|
||||||
LV2_LOG__log, &instance->logger.log, false,
|
LV2_LOG__log, &instance->logger.log, false,
|
||||||
LV2_URID__map, &instance->map, true,
|
LV2_URID__map, &instance->map, true,
|
||||||
NULL);
|
NULL);
|
||||||
@ -277,7 +298,7 @@ static LV2_Handle instantiate(const struct LV2_Descriptor * descriptor, double s
|
|||||||
|
|
||||||
instance->sample_rate = (float)sample_rate;
|
instance->sample_rate = (float)sample_rate;
|
||||||
plugin_set_sample_rate(&instance->p, instance->sample_rate);
|
plugin_set_sample_rate(&instance->p, instance->sample_rate);
|
||||||
size_t req = plugin_mem_req(&instance->p);
|
req = plugin_mem_req(&instance->p);
|
||||||
if (req != 0) {
|
if (req != 0) {
|
||||||
instance->mem = malloc(req);
|
instance->mem = malloc(req);
|
||||||
if (instance->mem == NULL) {
|
if (instance->mem == NULL) {
|
||||||
@ -332,28 +353,28 @@ static void connect_port(LV2_Handle instance, uint32_t port, void * data_locatio
|
|||||||
|
|
||||||
#if DATA_PRODUCT_AUDIO_INPUT_CHANNELS_N > 0
|
#if DATA_PRODUCT_AUDIO_INPUT_CHANNELS_N > 0
|
||||||
if (port < DATA_PRODUCT_AUDIO_INPUT_CHANNELS_N) {
|
if (port < DATA_PRODUCT_AUDIO_INPUT_CHANNELS_N) {
|
||||||
i->x[port] = data_location;
|
i->x[port] = (const float *)data_location;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
port -= DATA_PRODUCT_AUDIO_INPUT_CHANNELS_N;
|
port -= DATA_PRODUCT_AUDIO_INPUT_CHANNELS_N;
|
||||||
#endif
|
#endif
|
||||||
#if DATA_PRODUCT_AUDIO_OUTPUT_CHANNELS_N > 0
|
#if DATA_PRODUCT_AUDIO_OUTPUT_CHANNELS_N > 0
|
||||||
if (port < DATA_PRODUCT_AUDIO_OUTPUT_CHANNELS_N) {
|
if (port < DATA_PRODUCT_AUDIO_OUTPUT_CHANNELS_N) {
|
||||||
i->y[port] = data_location;
|
i->y[port] = (float *)data_location;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
port -= DATA_PRODUCT_AUDIO_OUTPUT_CHANNELS_N;
|
port -= DATA_PRODUCT_AUDIO_OUTPUT_CHANNELS_N;
|
||||||
#endif
|
#endif
|
||||||
#if DATA_PRODUCT_MIDI_INPUTS_N > 0
|
#if DATA_PRODUCT_MIDI_INPUTS_N > 0
|
||||||
if (port < DATA_PRODUCT_MIDI_INPUTS_N) {
|
if (port < DATA_PRODUCT_MIDI_INPUTS_N) {
|
||||||
i->x_midi[port] = data_location;
|
i->x_midi[port] = (const LV2_Atom_Sequence *)data_location;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
port -= DATA_PRODUCT_MIDI_INPUTS_N;
|
port -= DATA_PRODUCT_MIDI_INPUTS_N;
|
||||||
#endif
|
#endif
|
||||||
#if DATA_PRODUCT_MIDI_OUTPUTS_N > 0
|
#if DATA_PRODUCT_MIDI_OUTPUTS_N > 0
|
||||||
if (port < DATA_PRODUCT_MIDI_OUTPUTS_N) {
|
if (port < DATA_PRODUCT_MIDI_OUTPUTS_N) {
|
||||||
i->y_midi[port] = data_location;
|
i->y_midi[port] = (LV2_Atom_Sequence *)data_location;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
port -= DATA_PRODUCT_MIDI_OUTPUTS_N;
|
port -= DATA_PRODUCT_MIDI_OUTPUTS_N;
|
||||||
@ -372,7 +393,7 @@ static void connect_port(LV2_Handle instance, uint32_t port, void * data_locatio
|
|||||||
port -= DATA_MESSAGING_PORTS_N;
|
port -= DATA_MESSAGING_PORTS_N;
|
||||||
#endif
|
#endif
|
||||||
#if (DATA_PRODUCT_CONTROL_INPUTS_N + DATA_PRODUCT_CONTROL_OUTPUTS_N) > 0
|
#if (DATA_PRODUCT_CONTROL_INPUTS_N + DATA_PRODUCT_CONTROL_OUTPUTS_N) > 0
|
||||||
i->c[port] = data_location;
|
i->c[port] = (float *)data_location;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -386,9 +407,13 @@ static void activate(LV2_Handle instance) {
|
|||||||
# ifdef DATA_STATE_DSP_CUSTOM
|
# ifdef DATA_STATE_DSP_CUSTOM
|
||||||
for (uint32_t j = 0; j < DATA_PRODUCT_CONTROL_INPUTS_N; j++)
|
for (uint32_t j = 0; j < DATA_PRODUCT_CONTROL_INPUTS_N; j++)
|
||||||
i->params_sync[j] = i->params[j];
|
i->params_sync[j] = i->params[j];
|
||||||
|
# ifdef __cplusplus
|
||||||
|
i->sync_lock_flag.clear();
|
||||||
|
# else
|
||||||
// why is this not correct?
|
// why is this not correct?
|
||||||
// i->sync_lock_flag = ATOMIC_FLAG_INIT;
|
// i->sync_lock_flag = ATOMIC_FLAG_INIT;
|
||||||
atomic_flag_clear(&i->sync_lock_flag);
|
atomic_flag_clear(&i->sync_lock_flag);
|
||||||
|
# endif
|
||||||
i->synced = 1;
|
i->synced = 1;
|
||||||
i->loaded = 0;
|
i->loaded = 0;
|
||||||
# endif
|
# endif
|
||||||
@ -442,7 +467,11 @@ static void run(LV2_Handle instance, uint32_t sample_count) {
|
|||||||
|
|
||||||
#if DATA_PRODUCT_CONTROL_INPUTS_N > 0
|
#if DATA_PRODUCT_CONTROL_INPUTS_N > 0
|
||||||
# ifdef DATA_STATE_DSP_CUSTOM
|
# ifdef DATA_STATE_DSP_CUSTOM
|
||||||
|
# ifdef __cplusplus
|
||||||
|
_Bool locked = !i->sync_lock_flag.test_and_set();
|
||||||
|
# else
|
||||||
_Bool locked = !atomic_flag_test_and_set(&i->sync_lock_flag);
|
_Bool locked = !atomic_flag_test_and_set(&i->sync_lock_flag);
|
||||||
|
# endif
|
||||||
if (locked) {
|
if (locked) {
|
||||||
if (!i->synced) {
|
if (!i->synced) {
|
||||||
if (i->loaded) {
|
if (i->loaded) {
|
||||||
@ -482,7 +511,11 @@ static void run(LV2_Handle instance, uint32_t sample_count) {
|
|||||||
|
|
||||||
# ifdef DATA_STATE_DSP_CUSTOM
|
# ifdef DATA_STATE_DSP_CUSTOM
|
||||||
if (locked)
|
if (locked)
|
||||||
|
# ifdef __cplusplus
|
||||||
|
i->sync_lock_flag.clear();
|
||||||
|
# else
|
||||||
atomic_flag_clear(&i->sync_lock_flag);
|
atomic_flag_clear(&i->sync_lock_flag);
|
||||||
|
# endif
|
||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -576,7 +609,7 @@ static LV2_State_Status state_restore(LV2_Handle instance, LV2_State_Retrieve_Fu
|
|||||||
}
|
}
|
||||||
size_t length;
|
size_t length;
|
||||||
uint32_t type, xflags; // jalv 1.6.6 crashes using NULL as per spec, so we have these two
|
uint32_t type, xflags; // jalv 1.6.6 crashes using NULL as per spec, so we have these two
|
||||||
const char * data = retrieve(handle, i->uri_state_data, &length, &type, &xflags);
|
const char * data = (const char *)retrieve(handle, i->uri_state_data, &length, &type, &xflags);
|
||||||
if (data == NULL) {
|
if (data == NULL) {
|
||||||
lv2_log_error(&i->logger, "Cannot restore state since property <%s> could not be retrieved\n", DATA_LV2_URI "#state_data");
|
lv2_log_error(&i->logger, "Cannot restore state since property <%s> could not be retrieved\n", DATA_LV2_URI "#state_data");
|
||||||
return LV2_STATE_ERR_NO_PROPERTY;
|
return LV2_STATE_ERR_NO_PROPERTY;
|
||||||
@ -706,7 +739,12 @@ static LV2UI_Handle ui_instantiate(const LV2UI_Descriptor * descriptor, const ch
|
|||||||
(void)descriptor;
|
(void)descriptor;
|
||||||
(void)plugin_uri;
|
(void)plugin_uri;
|
||||||
|
|
||||||
ui_instance *instance = malloc(sizeof(ui_instance));
|
// make C++ compilers happy
|
||||||
|
char has_parent;
|
||||||
|
void *parent;
|
||||||
|
plugin_ui_callbacks cbs;
|
||||||
|
|
||||||
|
ui_instance *instance = (ui_instance *)malloc(sizeof(ui_instance));
|
||||||
if (instance == NULL)
|
if (instance == NULL)
|
||||||
goto err_instance;
|
goto err_instance;
|
||||||
|
|
||||||
@ -714,8 +752,8 @@ static LV2UI_Handle ui_instantiate(const LV2UI_Descriptor * descriptor, const ch
|
|||||||
if (instance->bundle_path == NULL)
|
if (instance->bundle_path == NULL)
|
||||||
goto err_bundle_path;
|
goto err_bundle_path;
|
||||||
|
|
||||||
char has_parent = 0;
|
has_parent = 0;
|
||||||
void *parent = NULL;
|
parent = NULL;
|
||||||
# if DATA_PRODUCT_CONTROL_INPUTS_N > 0
|
# if DATA_PRODUCT_CONTROL_INPUTS_N > 0
|
||||||
instance->has_touch = 0;
|
instance->has_touch = 0;
|
||||||
# endif
|
# endif
|
||||||
@ -732,18 +770,17 @@ static LV2UI_Handle ui_instantiate(const LV2UI_Descriptor * descriptor, const ch
|
|||||||
# endif
|
# endif
|
||||||
}
|
}
|
||||||
|
|
||||||
plugin_ui_callbacks cbs = {
|
cbs.handle = (void *)instance;
|
||||||
/* .handle = */ (void *)instance,
|
cbs.format = "lv2";
|
||||||
/* .format = */ "lv2",
|
cbs.get_bindir = ui_get_bundle_path_cb;
|
||||||
/* .get_bindir = */ ui_get_bundle_path_cb,
|
cbs.get_datadir = ui_get_bundle_path_cb;
|
||||||
/* .get_datadir = */ ui_get_bundle_path_cb,
|
|
||||||
# if DATA_PRODUCT_CONTROL_INPUTS_N > 0
|
# if DATA_PRODUCT_CONTROL_INPUTS_N > 0
|
||||||
/* .set_parameter_begin = */ ui_set_parameter_begin_cb,
|
cbs.set_parameter_begin = ui_set_parameter_begin_cb;
|
||||||
/* .set_parameter = */ ui_set_parameter_cb,
|
cbs.set_parameter = ui_set_parameter_cb;
|
||||||
/* .set_parameter_end = */ ui_set_parameter_end_cb,
|
cbs.set_parameter_end = ui_set_parameter_end_cb;
|
||||||
# endif
|
# endif
|
||||||
# ifdef DATA_MESSAGING
|
# ifdef DATA_MESSAGING
|
||||||
/* .send_to_dsp = */ send_to_dsp
|
cbs.send_to_dsp = send_to_dsp;
|
||||||
# endif
|
# endif
|
||||||
};
|
};
|
||||||
# if DATA_PRODUCT_CONTROL_INPUTS_N > 0
|
# if DATA_PRODUCT_CONTROL_INPUTS_N > 0
|
||||||
|
@ -24,7 +24,7 @@ build/web/index.html: $(DATA_DIR)/src/index.html | build/web
|
|||||||
build/web/key.pem: build/web/cert.pem
|
build/web/key.pem: build/web/cert.pem
|
||||||
|
|
||||||
build/web/cert.pem: | build
|
build/web/cert.pem: | build
|
||||||
yes "" | openssl req -x509 -newkey rsa:2048 -keyout build/web/key.pem -out build/web/cert.pem -days 365 -nodes 2>/dev/null
|
openssl req -x509 -newkey rsa:2048 -keyout build/web/key.pem -out build/web/cert.pem -days 365 -nodes -subj "/C=US/ST=Denial/L=Springfield/O=Dis/CN=www.example.com" 2>/dev/null
|
||||||
|
|
||||||
strip-web-demo: build/web/index.html
|
strip-web-demo: build/web/index.html
|
||||||
$(eval TMP := $(shell mktemp /tmp/index.XXXXXX))
|
$(eval TMP := $(shell mktemp /tmp/index.XXXXXX))
|
||||||
|
@ -18,6 +18,8 @@
|
|||||||
# File author: Stefano D'Angelo
|
# File author: Stefano D'Angelo
|
||||||
#
|
#
|
||||||
|
|
||||||
|
SHELL := bash -o pipefail
|
||||||
|
|
||||||
TEMPLATE := web
|
TEMPLATE := web
|
||||||
|
|
||||||
include vars.mk
|
include vars.mk
|
||||||
|
@ -25,8 +25,8 @@
|
|||||||
typedef struct {
|
typedef struct {
|
||||||
void *widget;
|
void *widget;
|
||||||
|
|
||||||
vinci *vinci;
|
vinci *ui;
|
||||||
window *window;
|
window *w;
|
||||||
int param_down;
|
int param_down;
|
||||||
|
|
||||||
float gain;
|
float gain;
|
||||||
@ -70,16 +70,16 @@ static void draw_rect(window *w, uint32_t x, uint32_t y, uint32_t width, uint32_
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void draw_slider(plugin_ui *pui, int id, float value) {
|
static void draw_slider(plugin_ui *pui, int id, float value) {
|
||||||
const int w = window_get_width(pui->window);
|
const int w = window_get_width(pui->w);
|
||||||
const int h = window_get_height(pui->window);
|
const int h = window_get_height(pui->w);
|
||||||
draw_rect(pui->window, 0.1 * w, 0.15 * (id + 1) * h, 0.8 * w * value, 0.1 * h, 0x6789ab);
|
draw_rect(pui->w, 0.1 * w, 0.15 * (id + 1) * h, 0.8 * w * value, 0.1 * h, 0x6789ab);
|
||||||
draw_rect(pui->window, 0.1 * w + 0.8 * w * value, 0.15 * (id + 1) * h, 0.8 * w * (1.f - value), 0.1 * h, 0x1223bc);
|
draw_rect(pui->w, 0.1 * w + 0.8 * w * value, 0.15 * (id + 1) * h, 0.8 * w * (1.f - value), 0.1 * h, 0x1223bc);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void draw_button(plugin_ui *pui, int id, char value) {
|
static void draw_button(plugin_ui *pui, int id, char value) {
|
||||||
const int w = window_get_width(pui->window);
|
const int w = window_get_width(pui->w);
|
||||||
const int h = window_get_height(pui->window);
|
const int h = window_get_height(pui->w);
|
||||||
draw_rect(pui->window, 0.4 * w, 0.15 * (id + 1) * h, 0.2 * w, 0.1 * h, value ? 0x6789ab : 0x1223bc);
|
draw_rect(pui->w, 0.4 * w, 0.15 * (id + 1) * h, 0.2 * w, 0.1 * h, value ? 0x6789ab : 0x1223bc);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void on_close(window *w) {
|
static void on_close(window *w) {
|
||||||
@ -207,11 +207,11 @@ static plugin_ui *plugin_ui_create(char has_parent, void *parent, plugin_ui_call
|
|||||||
wcbs.on_window_resize = on_window_resize;
|
wcbs.on_window_resize = on_window_resize;
|
||||||
|
|
||||||
instance->param_down = -1;
|
instance->param_down = -1;
|
||||||
instance->vinci = vinci_new();
|
instance->ui = vinci_new();
|
||||||
instance->window = window_new(instance->vinci, has_parent ? parent : NULL, WIDTH, HEIGHT, &wcbs);
|
instance->w = window_new(instance->ui, has_parent ? parent : NULL, WIDTH, HEIGHT, &wcbs);
|
||||||
instance->widget = window_get_handle(instance->window);
|
instance->widget = window_get_handle(instance->w);
|
||||||
window_set_data(instance->window, (void*) instance);
|
window_set_data(instance->w, (void*) instance);
|
||||||
window_show(instance->window);
|
window_show(instance->w);
|
||||||
|
|
||||||
// just some valid values to allow drawing
|
// just some valid values to allow drawing
|
||||||
instance->gain = 0.f;
|
instance->gain = 0.f;
|
||||||
@ -220,20 +220,20 @@ static plugin_ui *plugin_ui_create(char has_parent, void *parent, plugin_ui_call
|
|||||||
instance->bypass = 0;
|
instance->bypass = 0;
|
||||||
instance->y_z1 = 0.f;
|
instance->y_z1 = 0.f;
|
||||||
|
|
||||||
on_window_resize(instance->window, window_get_width(instance->window), window_get_height(instance->window));
|
on_window_resize(instance->w, window_get_width(instance->w), window_get_height(instance->w));
|
||||||
|
|
||||||
instance->cbs = *cbs;
|
instance->cbs = *cbs;
|
||||||
return instance;
|
return instance;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void plugin_ui_free(plugin_ui *instance) {
|
static void plugin_ui_free(plugin_ui *instance) {
|
||||||
window_free(instance->window);
|
window_free(instance->w);
|
||||||
vinci_destroy(instance->vinci);
|
vinci_destroy(instance->ui);
|
||||||
free(instance);
|
free(instance);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void plugin_ui_idle(plugin_ui *instance) {
|
static void plugin_ui_idle(plugin_ui *instance) {
|
||||||
vinci_idle(instance->vinci);
|
vinci_idle(instance->ui);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void plugin_ui_set_parameter(plugin_ui *instance, size_t index, float value) {
|
static void plugin_ui_set_parameter(plugin_ui *instance, size_t index, float value) {
|
||||||
|
@ -2,7 +2,9 @@
|
|||||||
"product": {
|
"product": {
|
||||||
"name": "Tibia test product",
|
"name": "Tibia test product",
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"buildVersion": "0",
|
"buildVersion": 0,
|
||||||
|
"description": "A toy plugin to test Tibia",
|
||||||
|
"copyright": "Copyright © 2021-2025 Orastron Srl unipersonale",
|
||||||
"bundleName": "tibia-test",
|
"bundleName": "tibia-test",
|
||||||
"buses": [
|
"buses": [
|
||||||
{
|
{
|
||||||
@ -136,7 +138,8 @@
|
|||||||
],
|
],
|
||||||
"ui": {
|
"ui": {
|
||||||
"userResizable": true,
|
"userResizable": true,
|
||||||
"selfResizable": false
|
"selfResizable": false,
|
||||||
|
"highResolution": true
|
||||||
},
|
},
|
||||||
"messaging": {
|
"messaging": {
|
||||||
"maxSize": 10240
|
"maxSize": 10240
|
||||||
|
14
tibia
14
tibia
@ -115,21 +115,27 @@ var doT = require("dot");
|
|||||||
doT.templateSettings.strip = false;
|
doT.templateSettings.strip = false;
|
||||||
|
|
||||||
var api = {
|
var api = {
|
||||||
generateFileFromTemplateFile: function (templateFile, outFile, data) {
|
generateFileFromTemplateFile: function (templateFile, outFile, data, mode) {
|
||||||
if (!outputData)
|
if (!outputData)
|
||||||
return;
|
return;
|
||||||
var dir = outputDir + path.sep + path.dirname(outFile);
|
var dir = outputDir + path.sep + path.dirname(outFile);
|
||||||
fs.mkdirSync(dir, { recursive: true });
|
fs.mkdirSync(dir, { recursive: true });
|
||||||
var t = doT.template(fs.readFileSync(template + path.sep + templateFile, { encoding: "utf-8" }));
|
var t = doT.template(fs.readFileSync(template + path.sep + templateFile, { encoding: "utf-8" }));
|
||||||
fs.writeFileSync(outputDir + path.sep + outFile, t(data), { encoding: "utf-8" });
|
var outputFile = outputDir + path.sep + outFile;
|
||||||
|
fs.writeFileSync(outputFile, t(data), { encoding: "utf-8" });
|
||||||
|
if (mode !== undefined)
|
||||||
|
fs.chmodSync(outputFile, mode);
|
||||||
},
|
},
|
||||||
|
|
||||||
copyFile: function (inFile, outFile) {
|
copyFile: function (inFile, outFile, mode) {
|
||||||
if (!outputCommon)
|
if (!outputCommon)
|
||||||
return;
|
return;
|
||||||
var dir = outputDir + path.sep + path.dirname(outFile);
|
var dir = outputDir + path.sep + path.dirname(outFile);
|
||||||
fs.mkdirSync(dir, { recursive: true });
|
fs.mkdirSync(dir, { recursive: true });
|
||||||
fs.copyFileSync(template + path.sep + inFile, outputDir + path.sep + outFile);
|
var outputFile = outputDir + path.sep + outFile;
|
||||||
|
fs.copyFileSync(template + path.sep + inFile, outputFile);
|
||||||
|
if (mode !== undefined)
|
||||||
|
fs.chmodSync(outputFile, mode);
|
||||||
},
|
},
|
||||||
|
|
||||||
templateDir: template
|
templateDir: template
|
||||||
|
Loading…
Reference in New Issue
Block a user