Browse Source

Misc changes

tags/1.9.4
falkTX 11 years ago
parent
commit
9ea9083a19
4 changed files with 33 additions and 40 deletions
  1. +1
    -1
      source/carla_shared.py
  2. +24
    -30
      source/discovery/carla-discovery.cpp
  3. +8
    -0
      source/utils/CarlaLv2Utils.hpp
  4. +0
    -9
      source/utils/CarlaUtils.hpp

+ 1
- 1
source/carla_shared.py View File

@@ -1001,7 +1001,7 @@ def runCarlaDiscovery(itype, stype, filename, tool, isWine=False):

if prop == "name":
pinfo['name'] = value if value else fakeLabel
elif prop == "label":
elif prop in ("label", "uri"):
pinfo['label'] = value if value else fakeLabel
elif prop == "maker":
pinfo['maker'] = value


+ 24
- 30
source/discovery/carla-discovery.cpp View File

@@ -111,7 +111,7 @@ intptr_t vstHostCanDo(const char* const feature)
if (std::strcmp(feature, "acceptIOChanges") == 0)
return 1;
if (std::strcmp(feature, "sizeWindow") == 0)
return 1;
return -1;
if (std::strcmp(feature, "offline") == 0)
return -1;
if (std::strcmp(feature, "openFileSelector") == 0)
@@ -251,7 +251,7 @@ intptr_t VSTCALLBACK vstHostCallback(AEffect* const effect, const int32_t opcode
break;

default:
carla_debug("vstHostCallback(%p, %s, %i, " P_INTPTR ", %p, %f)", effect, vstMasterOpcode2str(opcode), index, value, ptr, opt);
carla_stdout("vstHostCallback(%p, %s, %i, " P_INTPTR ", %p, %f)", effect, vstMasterOpcode2str(opcode), index, value, ptr, opt);
break;
}

@@ -857,9 +857,9 @@ void do_lv2_check(const char* const bundle, const bool init)
for (int i=0; i < URIs.count(); i++)
{
const LV2_RDF_Descriptor* const rdfDescriptor = lv2_rdf_new(URIs.at(i).toUtf8().constData());
CARLA_ASSERT(rdfDescriptor && rdfDescriptor->URI);
CARLA_ASSERT(rdfDescriptor != nullptr && rdfDescriptor->URI != nullptr);

if (! (rdfDescriptor && rdfDescriptor->URI))
if (rdfDescriptor == nullptr || rdfDescriptor->URI == nullptr)
{
DISCOVERY_OUT("error", "Failed to find LV2 plugin '" << URIs.at(i).toUtf8().constData() << "'");
continue;
@@ -868,25 +868,27 @@ void do_lv2_check(const char* const bundle, const bool init)
if (init)
{
// test if DLL is loadable, twice
bool isLoadable = true;
void* const libHandle1 = lib_open(rdfDescriptor->Binary);

for (int j=0; j < 2; j++)
if (libHandle1 == nullptr)
{
void* const libHandle = lib_open(rdfDescriptor->Binary);
print_lib_error(rdfDescriptor->Binary);
delete rdfDescriptor;
continue;
}

if (! libHandle)
{
isLoadable = false;
print_lib_error(rdfDescriptor->Binary);
delete rdfDescriptor;
break;
}
lib_close(libHandle1);

lib_close(libHandle);
}
void* const libHandle2 = lib_open(rdfDescriptor->Binary);

if (! isLoadable)
if (libHandle2 == nullptr)
{
print_lib_error(rdfDescriptor->Binary);
delete rdfDescriptor;
continue;
}

lib_close(libHandle2);
}

// test if we support all required ports and features
@@ -1011,12 +1013,12 @@ void do_lv2_check(const char* const bundle, const bool init)
hints |= PLUGIN_HAS_GUI;

DISCOVERY_OUT("init", "-----------");
DISCOVERY_OUT("label", rdfDescriptor->URI);
if (rdfDescriptor->Name)
DISCOVERY_OUT("uri", rdfDescriptor->URI);
if (rdfDescriptor->Name != nullptr)
DISCOVERY_OUT("name", rdfDescriptor->Name);
if (rdfDescriptor->Author)
if (rdfDescriptor->Author != nullptr)
DISCOVERY_OUT("maker", rdfDescriptor->Author);
if (rdfDescriptor->License)
if (rdfDescriptor->License != nullptr)
DISCOVERY_OUT("copyright", rdfDescriptor->License);
DISCOVERY_OUT("unique_id", rdfDescriptor->UniqueID);
DISCOVERY_OUT("hints", hints);
@@ -1154,12 +1156,6 @@ void do_vst_check(void* const libHandle, const bool init)
effect->dispatcher(effect, effSetSampleRate, 0, 0, nullptr, kSampleRate);
effect->dispatcher(effect, effSetProcessPrecision, 0, kVstProcessPrecision32, nullptr, 0.0f);

effect->dispatcher(effect, effStopProcess, 0, 0, nullptr, 0.0f);
effect->dispatcher(effect, effMainsChanged, 0, 0, nullptr, 0.0f);

if (gVstNeedsIdle)
effect->dispatcher(effect, effIdle, 0, 0, nullptr, 0.0f);

effect->dispatcher(effect, effMainsChanged, 0, 1, nullptr, 0.0f);
effect->dispatcher(effect, effStartProcess, 0, 0, nullptr, 0.0f);

@@ -1192,16 +1188,14 @@ void do_vst_check(void* const libHandle, const bool init)
intptr_t reserved;
VstEvent* data[2];

#ifndef QTCREATOR_TEST
VstEventsFixed()
: numEvents(0),
reserved(0),
data{0} {}
#endif
} events;

VstMidiEvent midiEvents[2];
carla_zeroMem(midiEvents, sizeof(VstMidiEvent)*2);
carla_zeroStruct<VstMidiEvent>(midiEvents, 2);

midiEvents[0].type = kVstMidiType;
midiEvents[0].byteSize = sizeof(VstMidiEvent);


+ 8
- 0
source/utils/CarlaLv2Utils.hpp View File

@@ -1170,6 +1170,10 @@ bool is_lv2_port_supported(const LV2_Property types)
static inline
bool is_lv2_feature_supported(const LV2_URI uri)
{
CARLA_ASSERT(uri != nullptr);

if (uri == nullptr)
return false;
if (std::strcmp(uri, LV2_CORE__hardRTCapable) == 0)
return true;
if (std::strcmp(uri, LV2_CORE__inPlaceBroken) == 0)
@@ -1215,6 +1219,10 @@ bool is_lv2_feature_supported(const LV2_URI uri)
static inline
bool is_lv2_ui_feature_supported(const LV2_URI uri)
{
CARLA_ASSERT(uri != nullptr);

if (uri == nullptr)
return false;
if (is_lv2_feature_supported(uri))
return true;
if (std::strcmp(uri, LV2_DATA_ACCESS_URI) == 0)


+ 0
- 9
source/utils/CarlaUtils.hpp View File

@@ -354,15 +354,6 @@ void carla_zeroStruct(T& structure)
std::memset(&structure, 0, sizeof(T));
}

template <typename T>
static inline
void carla_zeroStruct(T& structure, const size_t count)
{
CARLA_ASSERT(count > 1);

std::memset(&structure, 0, sizeof(T)*count);
}

template <typename T>
static inline
void carla_zeroStruct(T* const structure, const size_t count)


Loading…
Cancel
Save