Browse Source

Fix previous commit, only use 1 audio port in clap for now

pull/321/merge
falkTX 2 years ago
parent
commit
fe9b6c233d
3 changed files with 16 additions and 17 deletions
  1. +4
    -4
      cmake/DPF-plugin.cmake
  2. +11
    -12
      distrho/src/DistrhoPluginCLAP.cpp
  3. +1
    -1
      distrho/src/DistrhoPluginVST3.cpp

+ 4
- 4
cmake/DPF-plugin.cmake View File

@@ -336,9 +336,9 @@ function(dpf__build_vst2 NAME DGL_LIBRARY)
OUTPUT_NAME "${NAME}"
SUFFIX "")
set(INFO_PLIST_PROJECT_NAME "${NAME}")
configure_file("${DPF_ROOT_DIR}/utils/plugin.vst/Contents/Info.plist"
configure_file("${DPF_ROOT_DIR}/utils/plugin.bundle/Contents/Info.plist"
"${PROJECT_BINARY_DIR}/bin/${NAME}.vst/Contents/Info.plist" @ONLY)
file(COPY "${DPF_ROOT_DIR}/utils/plugin.vst/Contents/PkgInfo"
file(COPY "${DPF_ROOT_DIR}/utils/plugin.bundle/Contents/PkgInfo"
DESTINATION "${PROJECT_BINARY_DIR}/bin/${NAME}.vst/Contents")
endif()
endfunction()
@@ -425,9 +425,9 @@ function(dpf__build_vst3 NAME DGL_LIBRARY)
if(APPLE)
# Uses the same macOS bundle template as VST2
set(INFO_PLIST_PROJECT_NAME "${NAME}")
configure_file("${DPF_ROOT_DIR}/utils/plugin.vst/Contents/Info.plist"
configure_file("${DPF_ROOT_DIR}/utils/plugin.bundle/Contents/Info.plist"
"${PROJECT_BINARY_DIR}/bin/${NAME}.vst3/Contents/Info.plist" @ONLY)
file(COPY "${DPF_ROOT_DIR}/utils/plugin.vst/Contents/PkgInfo"
file(COPY "${DPF_ROOT_DIR}/utils/plugin.bundle/Contents/PkgInfo"
DESTINATION "${PROJECT_BINARY_DIR}/bin/${NAME}.vst3/Contents")
endif()
endfunction()


+ 11
- 12
distrho/src/DistrhoPluginCLAP.cpp View File

@@ -177,17 +177,17 @@ public:

if (const uint32_t frames = process->frames_count)
{
DISTRHO_SAFE_ASSERT_UINT2_RETURN(process->audio_inputs_count == DISTRHO_PLUGIN_NUM_INPUTS,
process->audio_inputs_count, DISTRHO_PLUGIN_NUM_INPUTS, false);
DISTRHO_SAFE_ASSERT_UINT2_RETURN(process->audio_outputs_count == DISTRHO_PLUGIN_NUM_OUTPUTS,
process->audio_outputs_count, DISTRHO_PLUGIN_NUM_OUTPUTS, false);

// TODO multi-port bus stuff
DISTRHO_SAFE_ASSERT_UINT_RETURN(process->audio_inputs_count == 0 || process->audio_inputs_count == 1,
process->audio_inputs_count, false);
DISTRHO_SAFE_ASSERT_UINT_RETURN(process->audio_outputs_count == 0 || process->audio_outputs_count == 1,
process->audio_outputs_count, false);

const float** inputs = process->audio_inputs != nullptr
? const_cast<const float**>(process->audio_inputs->data32)
? const_cast<const float**>(process->audio_inputs[0].data32)
: nullptr;
/**/ float** outputs = process->audio_outputs != nullptr
? process->audio_inputs->data32
? process->audio_outputs[0].data32
: nullptr;

fOutputEvents = process->out_events;
@@ -266,7 +266,7 @@ static ScopedPointer<PluginExporter> sPlugin;

static uint32_t clap_plugin_audio_ports_count(const clap_plugin_t*, const bool is_input)
{
return is_input ? DISTRHO_PLUGIN_NUM_INPUTS : DISTRHO_PLUGIN_NUM_OUTPUTS;
return (is_input ? DISTRHO_PLUGIN_NUM_INPUTS : DISTRHO_PLUGIN_NUM_OUTPUTS) != 0 ? 1 : 0;
}

static bool clap_plugin_audio_ports_get(const clap_plugin_t*,
@@ -277,6 +277,7 @@ static bool clap_plugin_audio_ports_get(const clap_plugin_t*,
const uint32_t maxPortCount = is_input ? DISTRHO_PLUGIN_NUM_INPUTS : DISTRHO_PLUGIN_NUM_OUTPUTS;
DISTRHO_SAFE_ASSERT_UINT2_RETURN(index < maxPortCount, index, maxPortCount, false);

// TODO use groups
AudioPortWithBusId& audioPort(sPlugin->getAudioPort(is_input, index));

info->id = index;
@@ -290,10 +291,8 @@ static bool clap_plugin_audio_ports_get(const clap_plugin_t*,
// info->port_type = audioPort.hints & kAudioPortIsCV ? CLAP_PORT_CV : nullptr;
info->port_type = nullptr;

info->in_place_pair = index < (is_input ? DISTRHO_PLUGIN_NUM_OUTPUTS : DISTRHO_PLUGIN_NUM_INPUTS)
? index
: CLAP_INVALID_ID;
info->in_place_pair = DISTRHO_PLUGIN_NUM_INPUTS == DISTRHO_PLUGIN_NUM_OUTPUTS ? index : CLAP_INVALID_ID;

return true;
}



+ 1
- 1
distrho/src/DistrhoPluginVST3.cpp View File

@@ -4952,7 +4952,7 @@ bool EXITFNNAME(void);

bool EXITFNNAME(void)
{
sPlugin = nullptr;
DISTRHO_NAMESPACE::sPlugin = nullptr;
return true;
}



Loading…
Cancel
Save