Browse Source

Allow LADSPA/DSSI label to be null, pick first valid plugin

This is very useful for carla-single
tags/1.9.7b
falkTX 7 years ago
parent
commit
b2f0614fe0
2 changed files with 10 additions and 16 deletions
  1. +5
    -8
      source/backend/plugin/CarlaPluginDSSI.cpp
  2. +5
    -8
      source/backend/plugin/CarlaPluginLADSPA.cpp

+ 5
- 8
source/backend/plugin/CarlaPluginDSSI.cpp View File

@@ -1,6 +1,6 @@
/*
* Carla Plugin, DSSI implementation
* Copyright (C) 2011-2016 Filipe Coelho <falktx@falktx.com>
* Copyright (C) 2011-2017 Filipe Coelho <falktx@falktx.com>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
@@ -2456,12 +2456,6 @@ public:
return false;
}

if (label == nullptr || label[0] == '\0')
{
pData->engine->setLastError("null label");
return false;
}

// ---------------------------------------------------------------
// open DLL

@@ -2485,6 +2479,9 @@ public:
// ---------------------------------------------------------------
// get descriptor that matches label

// if label is null, get first valid plugin
const bool nullLabel = (label == nullptr || label[0] == '\0');

for (ulong d=0;; ++d)
{
try {
@@ -2523,7 +2520,7 @@ public:
break;
}

if (std::strcmp(fDescriptor->Label, label) == 0)
if (nullLabel || std::strcmp(fDescriptor->Label, label) == 0)
break;
}



+ 5
- 8
source/backend/plugin/CarlaPluginLADSPA.cpp View File

@@ -1,6 +1,6 @@
/*
* Carla Plugin, LADSPA implementation
* Copyright (C) 2011-2016 Filipe Coelho <falktx@falktx.com>
* Copyright (C) 2011-2017 Filipe Coelho <falktx@falktx.com>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
@@ -1545,12 +1545,6 @@ public:
return false;
}

if (label == nullptr || label[0] == '\0')
{
pData->engine->setLastError("null label");
return false;
}

// ---------------------------------------------------------------
// open DLL

@@ -1574,6 +1568,9 @@ public:
// ---------------------------------------------------------------
// get descriptor that matches label

// if label is null, get first valid plugin
const bool nullLabel = (label == nullptr || label[0] == '\0');

for (ulong d=0;; ++d)
{
try {
@@ -1601,7 +1598,7 @@ public:
break;
}

if (std::strcmp(fDescriptor->Label, label) == 0)
if (nullLabel || std::strcmp(fDescriptor->Label, label) == 0)
break;
}



Loading…
Cancel
Save