Browse Source

Continue

tags/1.9.4
falkTX 12 years ago
parent
commit
ecd29e9c60
2 changed files with 25 additions and 42 deletions
  1. +6
    -0
      source/libs/distrho/src/DistrhoDefines.h
  2. +19
    -42
      source/libs/distrho/src/DistrhoPluginLADSPA+DSSI.cpp

+ 6
- 0
source/libs/distrho/src/DistrhoDefines.h View File

@@ -57,6 +57,12 @@
# endif # endif
#endif #endif


#if defined(__GNUC__) && defined(__GXX_EXPERIMENTAL_CXX0X__)
# if (__GNUC__ * 100 + __GNUC_MINOR__) < 407
# define override // gcc4.7+ only
# endif
#endif

#if defined(WIN32) || defined(_WIN32) || defined(__WIN32__) #if defined(WIN32) || defined(_WIN32) || defined(__WIN32__)
# define DISTRHO_PLUGIN_EXPORT extern "C" __declspec (dllexport) # define DISTRHO_PLUGIN_EXPORT extern "C" __declspec (dllexport)
# define DISTRHO_OS_WINDOWS 1 # define DISTRHO_OS_WINDOWS 1


+ 19
- 42
source/libs/distrho/src/DistrhoPluginLADSPA+DSSI.cpp View File

@@ -102,7 +102,7 @@ public:
} }
#endif #endif


#if defined(DISTRHO_PLUGIN_TARGET_DSSI) && DISTRHO_PLUGIN_HAS_UI
#if DISTRHO_PLUGIN_WANT_SAMPLE_RATE
if (port == index++) if (port == index++)
{ {
portSampleRate = dataLocation; portSampleRate = dataLocation;
@@ -308,7 +308,7 @@ private:
#if DISTRHO_PLUGIN_WANT_LATENCY #if DISTRHO_PLUGIN_WANT_LATENCY
LADSPA_DataPtr portLatency; LADSPA_DataPtr portLatency;
#endif #endif
#if defined(DISTRHO_PLUGIN_TARGET_DSSI) && DISTRHO_PLUGIN_HAS_UI
#if DISTRHO_PLUGIN_WANT_SAMPLE_RATE
LADSPA_DataPtr portSampleRate; LADSPA_DataPtr portSampleRate;
#endif #endif


@@ -322,18 +322,18 @@ private:
{ {
lastControlValues[i] = plugin.parameterValue(i); lastControlValues[i] = plugin.parameterValue(i);


if (portControls[i])
if (portControls[i] != nullptr)
*portControls[i] = lastControlValues[i]; *portControls[i] = lastControlValues[i];
} }
} }


#if DISTRHO_PLUGIN_WANT_LATENCY #if DISTRHO_PLUGIN_WANT_LATENCY
if (portLatency)
if (portLatency != nullptr)
*portLatency = plugin.latency(); *portLatency = plugin.latency();
#endif #endif


#if defined(DISTRHO_PLUGIN_TARGET_DSSI) && DISTRHO_PLUGIN_HAS_UI
if (portSampleRate)
#if DISTRHO_PLUGIN_WANT_SAMPLE_RATE
if (portSampleRate != nullptr)
*portSampleRate = lastSampleRate; *portSampleRate = lastSampleRate;
#endif #endif
} }
@@ -350,86 +350,63 @@ static LADSPA_Handle ladspa_instantiate(const LADSPA_Descriptor*, unsigned long
return new PluginLadspaDssi(sampleRate); return new PluginLadspaDssi(sampleRate);
} }


#define instancePtr ((PluginLadspaDssi*)instance)

static void ladspa_connect_port(LADSPA_Handle instance, unsigned long port, LADSPA_Data* dataLocation) static void ladspa_connect_port(LADSPA_Handle instance, unsigned long port, LADSPA_Data* dataLocation)
{ {
PluginLadspaDssi* plugin = (PluginLadspaDssi*)instance;
assert(plugin);

plugin->ladspa_connect_port(port, dataLocation);
instancePtr->ladspa_connect_port(port, dataLocation);
} }


static void ladspa_activate(LADSPA_Handle instance) static void ladspa_activate(LADSPA_Handle instance)
{ {
PluginLadspaDssi* plugin = (PluginLadspaDssi*)instance;
assert(plugin);

plugin->ladspa_activate();
instancePtr->ladspa_activate();
} }


static void ladspa_run(LADSPA_Handle instance, unsigned long sampleCount) static void ladspa_run(LADSPA_Handle instance, unsigned long sampleCount)
{ {
PluginLadspaDssi* plugin = (PluginLadspaDssi*)instance;
assert(plugin);

plugin->ladspa_run(sampleCount);
instancePtr->ladspa_run(sampleCount);
} }


static void ladspa_deactivate(LADSPA_Handle instance) static void ladspa_deactivate(LADSPA_Handle instance)
{ {
PluginLadspaDssi* plugin = (PluginLadspaDssi*)instance;
assert(plugin);

plugin->ladspa_deactivate();
instancePtr->ladspa_deactivate();
} }


static void ladspa_cleanup(LADSPA_Handle instance) static void ladspa_cleanup(LADSPA_Handle instance)
{ {
PluginLadspaDssi* plugin = (PluginLadspaDssi*)instance;
assert(plugin);

delete plugin;
delete instancePtr;
} }


#ifdef DISTRHO_PLUGIN_TARGET_DSSI #ifdef DISTRHO_PLUGIN_TARGET_DSSI
# if DISTRHO_PLUGIN_WANT_STATE # if DISTRHO_PLUGIN_WANT_STATE
static char* dssi_configure(LADSPA_Handle instance, const char* key, const char* value) static char* dssi_configure(LADSPA_Handle instance, const char* key, const char* value)
{ {
PluginLadspaDssi* plugin = (PluginLadspaDssi*)instance;
assert(plugin);

return plugin->dssi_configure(key, value);
return instancePtr->dssi_configure(key, value);
} }
# endif # endif


# if DISTRHO_PLUGIN_WANT_PROGRAMS # if DISTRHO_PLUGIN_WANT_PROGRAMS
static const DSSI_Program_Descriptor* dssi_get_program(LADSPA_Handle instance, unsigned long index) static const DSSI_Program_Descriptor* dssi_get_program(LADSPA_Handle instance, unsigned long index)
{ {
PluginLadspaDssi* plugin = (PluginLadspaDssi*)instance;
assert(plugin);

return plugin->dssi_get_program(index);
return instancePtr->dssi_get_program(index);
} }


static void dssi_select_program(LADSPA_Handle instance, unsigned long bank, unsigned long program) static void dssi_select_program(LADSPA_Handle instance, unsigned long bank, unsigned long program)
{ {
PluginLadspaDssi* plugin = (PluginLadspaDssi*)instance;
assert(plugin);

plugin->dssi_select_program(bank, program);
instancePtr->dssi_select_program(bank, program);
} }
# endif # endif


# if DISTRHO_PLUGIN_IS_SYNTH # if DISTRHO_PLUGIN_IS_SYNTH
static void dssi_run_synth(LADSPA_Handle instance, unsigned long sampleCount, snd_seq_event_t* events, unsigned long eventCount) static void dssi_run_synth(LADSPA_Handle instance, unsigned long sampleCount, snd_seq_event_t* events, unsigned long eventCount)
{ {
PluginLadspaDssi* plugin = (PluginLadspaDssi*)instance;
assert(plugin);

plugin->dssi_run_synth(sampleCount, events, eventCount);
instancePtr->dssi_run_synth(sampleCount, events, eventCount);
} }
# endif # endif
#endif #endif


#undef instancePtr

// ------------------------------------------------- // -------------------------------------------------


static LADSPA_Descriptor sLadspaDescriptor = { static LADSPA_Descriptor sLadspaDescriptor = {


Loading…
Cancel
Save