mirror of
https://github.com/cookiengineer/audacity
synced 2025-05-02 16:49:41 +02:00
Hopefully this will provide a decent workaround for bug 1045
Basically, an LV2 effect that contains port types that Audacity doesn't understand will be unavailable for use.
This commit is contained in:
parent
5bb3bb1f9e
commit
7071c9952c
@ -48,7 +48,7 @@
|
||||
#if defined(__WXGTK__)
|
||||
#if wxCHECK_VERSION(3, 0, 0)
|
||||
#include <gtk/gtk.h>
|
||||
#include <wx/win_gtk.h>
|
||||
#include "win_gtk.h"
|
||||
#else
|
||||
#include <wx/gtk/win_gtk.h>
|
||||
#include <gtk/gtk.h>
|
||||
@ -462,8 +462,21 @@ bool LV2Effect::SetHost(EffectHostInterface *host)
|
||||
{
|
||||
mHost = host;
|
||||
|
||||
// Allocate buffers for the port indices and the default control values
|
||||
int numPorts = lilv_plugin_get_num_ports(mPlug);
|
||||
|
||||
// Fail if we don't grok the port types
|
||||
for (int i = 0; i < numPorts; i++)
|
||||
{
|
||||
const LilvPort *port = lilv_plugin_get_port_by_index(mPlug, i);
|
||||
|
||||
if (!lilv_port_is_a(mPlug, port, gAudio) &&
|
||||
!lilv_port_is_a(mPlug, port, gControl))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// Allocate buffers for the port indices and the default control values
|
||||
float *minimumVals = new float [numPorts];
|
||||
float *maximumVals = new float [numPorts];
|
||||
float *defaultValues = new float [numPorts];
|
||||
|
Loading…
x
Reference in New Issue
Block a user