Skip to content

Commit

Permalink
Merge branch 'master' into plugin-store
Browse files Browse the repository at this point in the history
  • Loading branch information
falkTX committed Oct 31, 2023
2 parents 9d48763 + 824e73a commit f6b4faa
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 1 deletion.
2 changes: 1 addition & 1 deletion utils/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ else
JACK_LIBS = $(shell pkg-config --libs jack)
endif

LILV_CFLAGS = $(shell pkg-config --cflags lilv-0)
LILV_CFLAGS = $(shell pkg-config --cflags lilv-0) -Wno-parentheses
LILV_LIBS = $(shell pkg-config --libs lilv-0)

all: build
Expand Down
45 changes: 45 additions & 0 deletions utils/utils_lilv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4582,6 +4582,10 @@ const PedalboardInfo_Mini* const* get_all_pedalboards(const int ptype)
if (ptype == kPedalboardInfoFactoryOnly && FACTORYINFO != nullptr)
return FACTORYINFO;

#ifndef LILV_OPTION_LV2_PATH
char* const oldlv2path = getenv_strdup_or_null("LV2_PATH");
#endif

const char* pedalboard_lv2_path;
switch (ptype)
{
Expand All @@ -4604,12 +4608,28 @@ const PedalboardInfo_Mini* const* get_all_pedalboards(const int ptype)

LilvWorld* const w = lilv_world_new();

#ifdef LILV_OPTION_LV2_PATH
LilvNode* const lv2path = lilv_new_string(w, pedalboard_lv2_path);
lilv_world_set_option(w, LILV_OPTION_LV2_PATH, lv2path);
lilv_free(lv2path);
#else
setenv("LV2_PATH", pedalboard_lv2_path, 1);
#endif

lilv_world_load_all(w);

#ifndef LILV_OPTION_LV2_PATH
if (oldlv2path != nullptr)
{
setenv("LV2_PATH", oldlv2path, 1);
free(oldlv2path);
}
else
{
unsetenv("LV2_PATH");
}
#endif

LilvNode* const versiontypenode = lilv_new_uri(w, LILV_NS_MODPEDAL "version");
LilvNode* const rdftypenode = lilv_new_uri(w, LILV_NS_RDF "type");
LilvNode* const ingenblocknode = lilv_new_uri(w, LILV_NS_INGEN "block");
Expand Down Expand Up @@ -4665,12 +4685,29 @@ const char* const* get_broken_pedalboards(void)
{
LilvWorld* const w = lilv_world_new();

#ifdef LILV_OPTION_LV2_PATH
LilvNode* const lv2path = lilv_new_string(w, _get_lv2_pedalboards_path());
lilv_world_set_option(w, LILV_OPTION_LV2_PATH, lv2path);
lilv_free(lv2path);
#else
char* const oldlv2path = getenv_strdup_or_null("LV2_PATH");
setenv("LV2_PATH", _get_lv2_pedalboards_path(), 1);
#endif

lilv_world_load_all(w);

#ifndef LILV_OPTION_LV2_PATH
if (oldlv2path != nullptr)
{
setenv("LV2_PATH", oldlv2path, 1);
free(oldlv2path);
}
else
{
unsetenv("LV2_PATH");
}
#endif

LilvNode* const ingenblocknode = lilv_new_uri(w, LILV_NS_INGEN "block");
LilvNode* const lv2protonode = lilv_new_uri(w, LILV_NS_LV2 "prototype");
const LilvPlugins* const plugins = lilv_world_get_all_plugins(w);
Expand Down Expand Up @@ -5809,11 +5846,19 @@ const StatePortValue* get_state_port_values(const char* const state)

LilvWorld* const w = W;

#ifdef _WIN32
putenv("LILV_STATE_SKIP_PROPERTIES=2");
#else
setenv("LILV_STATE_SKIP_PROPERTIES", "2", 1);
#endif

LilvState* const lstate = lilv_state_new_from_string(w, &uridMap, state);

#ifdef _WIN32
putenv("LILV_STATE_SKIP_PROPERTIES=");
#else
unsetenv("LILV_STATE_SKIP_PROPERTIES");
#endif

if (lstate != nullptr)
{
Expand Down

0 comments on commit f6b4faa

Please sign in to comment.