Skip to content

Commit

Permalink
More compiler warning fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
falkTX committed Jan 3, 2022
1 parent 4a4f545 commit d8521ef
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 12 deletions.
30 changes: 19 additions & 11 deletions distrho/src/DistrhoPluginVST3.cpp
Expand Up @@ -1312,7 +1312,7 @@ class PluginVst3
const v3_param_id rindex = v3_cpp_obj(queue)->get_param_id(queue);
DISTRHO_SAFE_ASSERT_UINT_BREAK(rindex < fVst3ParameterCount, rindex);

#ifdef DPF_VST3_HAS_INTERNAL_PARAMETERS
#if DPF_VST3_HAS_INTERNAL_PARAMETERS
if (rindex < kVst3InternalParameterCount)
continue;
#endif
Expand All @@ -1331,15 +1331,15 @@ class PluginVst3
}
}

#if DISTRHO_PLUGIN_WANT_MIDI_INPUT
#if DISTRHO_PLUGIN_WANT_MIDI_INPUT
fPlugin.run(inputs, outputs, data->nframes, fMidiEvents, midiEventCount);
#else
#else
fPlugin.run(inputs, outputs, data->nframes);
#endif
#endif

#if DISTRHO_PLUGIN_WANT_MIDI_OUTPUT
#if DISTRHO_PLUGIN_WANT_MIDI_OUTPUT
fHostEventOutputHandle = nullptr;
#endif
#endif

// if there are any parameter changes after frame 0, set them here
if (v3_param_changes** const inparamsptr = data->input_params)
Expand All @@ -1355,7 +1355,7 @@ class PluginVst3
const v3_param_id rindex = v3_cpp_obj(queue)->get_param_id(queue);
DISTRHO_SAFE_ASSERT_UINT_BREAK(rindex < fVst3ParameterCount, rindex);

#ifdef DPF_VST3_HAS_INTERNAL_PARAMETERS
#if DPF_VST3_HAS_INTERNAL_PARAMETERS
if (rindex < kVst3InternalParameterCount)
continue;
#endif
Expand Down Expand Up @@ -1718,7 +1718,11 @@ class PluginVst3
{
#if DISTRHO_PLUGIN_WANT_MIDI_INPUT
// TODO something to do here?
if (rindex >= kVst3InternalParameterMidiCC_start && rindex <= kVst3InternalParameterMidiCC_end)
if (
#if !DPF_VST3_PURE_MIDI_INTERNAL_PARAMETERS
rindex >= kVst3InternalParameterMidiCC_start &&
#endif
rindex <= kVst3InternalParameterMidiCC_end)
return 0.0;
#endif

Expand Down Expand Up @@ -1752,11 +1756,15 @@ class PluginVst3

#if DISTRHO_PLUGIN_WANT_MIDI_INPUT
// TODO something to do here?
if (rindex >= kVst3InternalParameterMidiCC_start && rindex <= kVst3InternalParameterMidiCC_end)
if (
#if !DPF_VST3_PURE_MIDI_INTERNAL_PARAMETERS
rindex >= kVst3InternalParameterMidiCC_start &&
#endif
rindex <= kVst3InternalParameterMidiCC_end)
return V3_INVALID_ARG;
#endif

#ifdef DPF_VST3_HAS_INTERNAL_PARAMETERS
#if DPF_VST3_HAS_INTERNAL_PARAMETERS && !DPF_VST3_PURE_MIDI_INTERNAL_PARAMETERS
if (rindex < kVst3InternalParameterBaseCount)
{
fCachedParameterValues[rindex] = normalizedParameterToPlain(rindex, normalized);
Expand Down Expand Up @@ -1812,7 +1820,7 @@ class PluginVst3
#endif
return V3_OK;

#ifndef DPF_VST3_HAS_INTERNAL_PARAMETERS
#if !DPF_VST3_HAS_INTERNAL_PARAMETERS
// unused
(void)rindex;
#endif
Expand Down
11 changes: 10 additions & 1 deletion distrho/src/DistrhoPluginVST3.hpp
Expand Up @@ -84,7 +84,16 @@ enum Vst3InternalParameters {
};

#if DPF_VST3_USES_SEPARATE_CONTROLLER || DISTRHO_PLUGIN_WANT_LATENCY || DISTRHO_PLUGIN_WANT_PROGRAMS || DISTRHO_PLUGIN_WANT_MIDI_INPUT
# define DPF_VST3_HAS_INTERNAL_PARAMETERS
# define DPF_VST3_HAS_INTERNAL_PARAMETERS 1
#else
# define DPF_VST3_HAS_INTERNAL_PARAMETERS 0
#endif

#if DPF_VST3_HAS_INTERNAL_PARAMETERS && DISTRHO_PLUGIN_WANT_MIDI_INPUT && \
!(DPF_VST3_USES_SEPARATE_CONTROLLER || DISTRHO_PLUGIN_WANT_LATENCY || DISTRHO_PLUGIN_WANT_PROGRAMS)
# define DPF_VST3_PURE_MIDI_INTERNAL_PARAMETERS 1
#else
# define DPF_VST3_PURE_MIDI_INTERNAL_PARAMETERS 0
#endif

// --------------------------------------------------------------------------------------------------------------------
Expand Down

0 comments on commit d8521ef

Please sign in to comment.