Continue battling juce and cmake, add needed stubs
Signed-off-by: falkTX <falktx@falktx.com>
This commit is contained in:
parent
859a2fbf9b
commit
c8dea01ab9
4 changed files with 190 additions and 11 deletions
2
dpf
2
dpf
|
|
@ -1 +1 @@
|
||||||
Subproject commit 2208680d20cca0360d38043d65f050a51d2c5a02
|
Subproject commit c6c6900b8743550da7eb4f0f61a28ee85ac80966
|
||||||
|
|
@ -13,17 +13,29 @@ juce_add_plugin(CardinalFX
|
||||||
EDITOR_WANTS_KEYBOARD_FOCUS TRUE
|
EDITOR_WANTS_KEYBOARD_FOCUS TRUE
|
||||||
PLUGIN_MANUFACTURER_CODE Dstr
|
PLUGIN_MANUFACTURER_CODE Dstr
|
||||||
PLUGIN_CODE dCnF
|
PLUGIN_CODE dCnF
|
||||||
FORMATS AU
|
FORMATS VST3 AU
|
||||||
PRODUCT_NAME "CardinalFX")
|
PRODUCT_NAME "CardinalFX")
|
||||||
|
|
||||||
target_sources(CardinalFX
|
target_sources(CardinalFX
|
||||||
PRIVATE
|
PRIVATE
|
||||||
Source/CardinalWrapper.cpp)
|
CardinalWrapper.cpp)
|
||||||
|
|
||||||
|
target_include_directories(CardinalFX
|
||||||
|
PRIVATE
|
||||||
|
.
|
||||||
|
../dpf/distrho)
|
||||||
|
|
||||||
target_compile_definitions(CardinalFX
|
target_compile_definitions(CardinalFX
|
||||||
PUBLIC
|
PUBLIC
|
||||||
|
JUCE_USE_CURL=0
|
||||||
JUCE_WEB_BROWSER=0)
|
JUCE_WEB_BROWSER=0)
|
||||||
|
|
||||||
|
target_link_options(CardinalFX
|
||||||
|
PRIVATE
|
||||||
|
"-l/Shared/Personal/FOSS/GIT/DISTRHO/DISTRHO_Cardinal/bin/CardinalFX.so"
|
||||||
|
"-Wl,-rpath,."
|
||||||
|
)
|
||||||
|
|
||||||
target_link_libraries(CardinalFX
|
target_link_libraries(CardinalFX
|
||||||
PRIVATE
|
PRIVATE
|
||||||
juce::juce_audio_utils
|
juce::juce_audio_utils
|
||||||
|
|
|
||||||
|
|
@ -17,27 +17,194 @@
|
||||||
|
|
||||||
#include <juce_audio_processors/juce_audio_processors.h>
|
#include <juce_audio_processors/juce_audio_processors.h>
|
||||||
|
|
||||||
|
#include "DistrhoPlugin.hpp"
|
||||||
|
#include "DistrhoUI.hpp"
|
||||||
|
|
||||||
|
DISTRHO_PLUGIN_EXPORT DISTRHO_NAMESPACE::Plugin* createSharedPlugin();
|
||||||
|
#define createPlugin ::createSharedPlugin
|
||||||
|
#include "src/DistrhoPluginInternal.hpp"
|
||||||
|
|
||||||
|
START_NAMESPACE_DISTRHO
|
||||||
|
|
||||||
|
// -----------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
class ParameterForDPF : public juce::AudioProcessorParameter
|
||||||
|
{
|
||||||
|
PluginExporter& plugin;
|
||||||
|
const uint index;
|
||||||
|
|
||||||
|
public:
|
||||||
|
ParameterForDPF(PluginExporter& plugin_, const uint index_)
|
||||||
|
: plugin(plugin_),
|
||||||
|
index(index_) {}
|
||||||
|
|
||||||
|
protected:
|
||||||
|
float getValue() const override
|
||||||
|
{
|
||||||
|
return plugin.getParameterRanges(index).getNormalizedValue(plugin.getParameterValue(index));
|
||||||
|
}
|
||||||
|
|
||||||
|
void setValue(const float newValue) override
|
||||||
|
{
|
||||||
|
plugin.setParameterValue(index, plugin.getParameterRanges(index).getUnnormalizedValue(newValue));
|
||||||
|
}
|
||||||
|
|
||||||
|
float getDefaultValue() const override
|
||||||
|
{
|
||||||
|
return plugin.getParameterDefault(index);
|
||||||
|
}
|
||||||
|
|
||||||
|
juce::String getName(int) const override
|
||||||
|
{
|
||||||
|
return plugin.getParameterName(index).buffer();
|
||||||
|
}
|
||||||
|
|
||||||
|
juce::String getLabel() const override
|
||||||
|
{
|
||||||
|
return plugin.getParameterUnit(index).buffer();
|
||||||
|
}
|
||||||
|
|
||||||
|
float getValueForText(const juce::String& text) const override
|
||||||
|
{
|
||||||
|
return 0.0f;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// -----------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
class CardinalWrapperProcessor : public juce::AudioProcessor
|
class CardinalWrapperProcessor : public juce::AudioProcessor
|
||||||
{
|
{
|
||||||
|
PluginExporter plugin;
|
||||||
|
|
||||||
|
static bool writeMidiCb(void* ptr, const MidiEvent& midiEvent)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
static bool requestParameterValueChangeCb(void* ptr, uint32_t index, float value)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
CardinalWrapperProcessor()
|
CardinalWrapperProcessor()
|
||||||
{}
|
: plugin(this, writeMidiCb, requestParameterValueChangeCb)
|
||||||
|
{
|
||||||
|
for (uint i=0; i<plugin.getParameterCount(); ++i)
|
||||||
|
addParameter(new ParameterForDPF(plugin, i));
|
||||||
|
}
|
||||||
|
|
||||||
~CardinalWrapperProcessor() override
|
~CardinalWrapperProcessor() override
|
||||||
{}
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
const juce::String getName() const override
|
||||||
|
{
|
||||||
|
return plugin.getName();
|
||||||
|
}
|
||||||
|
|
||||||
|
juce::StringArray getAlternateDisplayNames() const override
|
||||||
|
{
|
||||||
|
return juce::StringArray(plugin.getLabel());
|
||||||
|
}
|
||||||
|
|
||||||
void prepareToPlay(double sampleRate, int samplesPerBlock) override
|
void prepareToPlay(double sampleRate, int samplesPerBlock) override
|
||||||
{}
|
{
|
||||||
|
plugin.deactivateIfNeeded();
|
||||||
|
plugin.setSampleRate(sampleRate);
|
||||||
|
plugin.setBufferSize(samplesPerBlock);
|
||||||
|
plugin.activate();
|
||||||
|
}
|
||||||
|
|
||||||
void releaseResources() override
|
void releaseResources() override
|
||||||
{}
|
{
|
||||||
|
plugin.deactivateIfNeeded();
|
||||||
|
}
|
||||||
|
|
||||||
|
void processBlock(juce::AudioBuffer<float>& buffer, juce::MidiBuffer& midiMessages) override
|
||||||
|
{
|
||||||
|
midiMessages.clear();
|
||||||
|
// AudioPlayHead* getPlayHead()
|
||||||
|
}
|
||||||
|
|
||||||
|
double getTailLengthSeconds() const override
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool acceptsMidi() const override
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool producesMidi() const override
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
juce::AudioProcessorEditor* createEditor() override;
|
||||||
|
|
||||||
|
bool hasEditor() const override
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
int getNumPrograms() override
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
int getCurrentProgram() override
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
void setCurrentProgram(int) override
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
const juce::String getProgramName(int) override
|
||||||
|
{
|
||||||
|
return {};
|
||||||
|
}
|
||||||
|
|
||||||
|
void changeProgramName(int, const juce::String&) override
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
void getStateInformation(juce::MemoryBlock& destData) override
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
void setStateInformation(const void* data, int sizeInBytes) override
|
||||||
|
{
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
class CardinalWrapperEditor : public juce::AudioProcessorEditor
|
class CardinalWrapperEditor : public juce::AudioProcessorEditor
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
CardinalWrapperEditor(CardinalWrapperProcessor&)
|
CardinalWrapperEditor(CardinalWrapperProcessor& processor)
|
||||||
|
: juce::AudioProcessorEditor(processor)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
~CardinalWrapperEditor() override
|
~CardinalWrapperEditor() override
|
||||||
{}
|
{}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// -----------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
END_NAMESPACE_DISTRHO
|
||||||
|
|
||||||
|
// -----------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
juce::AudioProcessor* createPluginFilter()
|
||||||
|
{
|
||||||
|
return new DISTRHO_NAMESPACE::CardinalWrapperProcessor;
|
||||||
|
}
|
||||||
|
|
||||||
|
// -----------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
#define DISTRHO_IS_STANDALONE 0
|
||||||
|
#include "src/DistrhoPlugin.cpp"
|
||||||
|
#include "src/DistrhoUtils.cpp"
|
||||||
|
|
|
||||||
|
|
@ -234,7 +234,7 @@ BUILD_CXX_FLAGS += -DCARDINAL_PLUGIN_PREFIX='"$(PREFIX)"'
|
||||||
|
|
||||||
ifeq ($(NAME),CardinalFX)
|
ifeq ($(NAME),CardinalFX)
|
||||||
|
|
||||||
all: jack vst2 lv2 resources
|
all: jack vst2 lv2 shared resources
|
||||||
|
|
||||||
CORE_RESOURCES = $(filter-out icon.png,$(subst ../Rack/res/,,$(wildcard ../Rack/res/*))) template.vcv
|
CORE_RESOURCES = $(filter-out icon.png,$(subst ../Rack/res/,,$(wildcard ../Rack/res/*))) template.vcv
|
||||||
|
|
||||||
|
|
@ -251,7 +251,7 @@ else # CardinalFX
|
||||||
ifeq ($(NAME),Cardinal)
|
ifeq ($(NAME),Cardinal)
|
||||||
all: jack lv2 vst3 resources
|
all: jack lv2 vst3 resources
|
||||||
else
|
else
|
||||||
all: jack lv2 vst2 vst3 resources
|
all: jack lv2 vst2 vst3 shared resources
|
||||||
endif
|
endif
|
||||||
|
|
||||||
PLUGIN_RESOURCES += $(TARGET_DIR)/$(NAME).lv2/resources
|
PLUGIN_RESOURCES += $(TARGET_DIR)/$(NAME).lv2/resources
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue