Browse Source

Fix exported LV2 plugins under windows, they actually load now :)

tags/v1.9.11
falkTX 6 years ago
parent
commit
15820b1658
3 changed files with 26 additions and 3 deletions
  1. +16
    -2
      source/bridges-plugin/CarlaBridgeSingleLV2.cpp
  2. +3
    -1
      source/modules/water/files/File.cpp
  3. +7
    -0
      source/modules/water/water.cpp

+ 16
- 2
source/bridges-plugin/CarlaBridgeSingleLV2.cpp View File

@@ -664,7 +664,7 @@ static const void* lv2ui_extension_data(const char* uri)
CARLA_EXPORT
const LV2_Descriptor* lv2_descriptor(uint32_t index)
{
carla_stdout("lv2_descriptor(%i)", index);
carla_debug("lv2_descriptor(%i)", index);

if (index != 0)
return nullptr;
@@ -675,9 +675,16 @@ const LV2_Descriptor* lv2_descriptor(uint32_t index)
{
using namespace water;
const File file(File::getSpecialLocation(File::currentExecutableFile).withFileExtension("ttl"));
#ifdef CARLA_OS_WIN
ret = String("file:///" + file.getFullPathName()).toRawUTF8();
ret.replace('\\','/');
#else
ret = String("file://" + file.getFullPathName()).toRawUTF8();
#endif
}

carla_stdout("lv2_descriptor(%i) has URI '%s'", index, ret.buffer());

static const LV2_Descriptor desc = {
/* URI */ ret.buffer(),
/* instantiate */ lv2_instantiate,
@@ -695,7 +702,7 @@ const LV2_Descriptor* lv2_descriptor(uint32_t index)
CARLA_EXPORT
const LV2UI_Descriptor* lv2ui_descriptor(uint32_t index)
{
carla_stdout("lv2ui_descriptor(%i)", index);
carla_debug("lv2ui_descriptor(%i)", index);

static CarlaString ret;

@@ -703,9 +710,16 @@ const LV2UI_Descriptor* lv2ui_descriptor(uint32_t index)
{
using namespace water;
const File file(File::getSpecialLocation(File::currentExecutableFile).getSiblingFile("ext-ui"));
#ifdef CARLA_OS_WIN
ret = String("file:///" + file.getFullPathName()).toRawUTF8();
ret.replace('\\','/');
#else
ret = String("file://" + file.getFullPathName()).toRawUTF8();
#endif
}

carla_stdout("lv2ui_descriptor(%i) has URI '%s'", index, ret.buffer());

static const LV2UI_Descriptor lv2UiExtDesc = {
/* URI */ ret.buffer(),
/* instantiate */ lv2ui_instantiate,


+ 3
- 1
source/modules/water/files/File.cpp View File

@@ -1096,7 +1096,9 @@ File File::getSpecialLocation (const SpecialLocationType type)
switch (type)
{
case userHomeDirectory: csidlType = CSIDL_PROFILE; break;
case userHomeDirectory:
csidlType = CSIDL_PROFILE;
break;
case tempDirectory:
{


+ 7
- 0
source/modules/water/water.cpp View File

@@ -32,6 +32,13 @@ HINSTANCE water_getCurrentModuleInstanceHandle() noexcept
return currentModuleHandle;
}
CARLA_EXPORT
BOOL WINAPI DllMain(HINSTANCE hInst, DWORD, LPVOID)
{
currentModuleHandle = hInst;
return 1;
}
#endif
}


Loading…
Cancel
Save