Browse Source

Make temper work as linux-embed plugin

Signed-off-by: falkTX <falktx@falktx.com>
tags/2020-07-14
falkTX 5 years ago
parent
commit
88ffab3994
4 changed files with 26 additions and 10 deletions
  1. +1
    -0
      ports/Makefile
  2. +13
    -3
      ports/temper/LV2/premake.lua
  3. +10
    -7
      ports/temper/source/PluginProcessor.cpp
  4. +2
    -0
      ports/temper/source/PluginProcessor.h

+ 1
- 0
ports/Makefile View File

@@ -37,6 +37,7 @@ ifeq ($(LINUX_EMBED),true)
$(MAKE) -C tal-reverb-2/LV2
$(MAKE) -C tal-reverb-3/LV2
$(MAKE) -C tal-vocoder-2/LV2
$(MAKE) -C temper/LV2
$(MAKE) -C vex/LV2
$(MAKE) -C wolpertinger/LV2
else


+ 13
- 3
ports/temper/LV2/premake.lua View File

@@ -3,17 +3,27 @@ dofile("../../../scripts/make-project.lua")
package = make_juce_lv2_project("Temper")
if (os.getenv("LINUX_EMBED")) then
package.files = {
matchfiles (
"../source/FaustUIBridge.cpp",
"../source/BinaryData.cpp",
"../source/PluginProcessor.cpp",
"../../../libs/juce-plugin/JucePluginMain.cpp"
)
}
else
if (windows) then
-- TODO
package.linkoptions = { package.linkoptions, "-lopengl32" }
elseif (macosx) then
-- TODO
package.linkoptions = { package.linkoptions, "-framework OpenGL" }
else
package.linkoptions = { package.linkoptions, "`pkg-config --libs gl`" }
end
package.files = {
matchfiles (
"../source/*.cpp",
"../../../libs/juce-plugin/JucePluginMain.cpp"
)
}
end

+ 10
- 7
ports/temper/source/PluginProcessor.cpp View File

@@ -9,7 +9,9 @@
*/
#include "PluginProcessor.h"
#if ! JUCE_AUDIOPROCESSOR_NO_GUI
#include "PluginEditor.h"
#endif
#include "TemperDsp.hpp"
const int kOversampleFactor = 3;
@@ -30,7 +32,6 @@ m_params (*this, nullptr)
: m_params (*this, nullptr)
#endif
{
m_restriction = new RestrictionProcessor();
m_bridge = new FaustUIBridge(m_params);
m_lastKnownSampleRate = 0.0;
m_currentProgram = -1;
@@ -160,7 +161,6 @@ void TemperAudioProcessor::prepareToPlay (double sampleRate, int samplesPerBlock
m_dsps.getUnchecked(i)->instanceConstants(sampleRate * pow(2, kOversampleFactor));
m_oversampler->initProcessing(static_cast<size_t> (samplesPerBlock));
m_restriction->prepareToPlay(samplesPerBlock, sampleRate);
m_lastKnownSampleRate = sampleRate;
setLatencySamples(static_cast<int>(m_oversampler->getLatencyInSamples()));
@@ -201,7 +201,9 @@ void TemperAudioProcessor::processBlock (AudioSampleBuffer& buffer, MidiBuffer&
const int totalNumInputChannels = getTotalNumInputChannels();
const int totalNumOutputChannels = getTotalNumOutputChannels();
#if ! JUCE_AUDIOPROCESSOR_NO_GUI
TemperAudioProcessorEditor* editor = static_cast<TemperAudioProcessorEditor*>(getActiveEditor());
#endif
// In case we have more outputs than inputs, this code clears any output
// channels that didn't contain input data, (because these aren't
@@ -212,9 +214,11 @@ void TemperAudioProcessor::processBlock (AudioSampleBuffer& buffer, MidiBuffer&
for (int i = totalNumInputChannels; i < totalNumOutputChannels; ++i)
buffer.clear (i, 0, buffer.getNumSamples());
#if ! JUCE_AUDIOPROCESSOR_NO_GUI
// Push input buffer into the Pre spectroscope component.
if (editor)
editor->m_vizPre->pushBuffer(buffer);
#endif
// Now the guts of the processing; oversampling and applying the Faust dsp module.
const int numInputChannels = buffer.getNumChannels();
@@ -239,16 +243,14 @@ void TemperAudioProcessor::processBlock (AudioSampleBuffer& buffer, MidiBuffer&
m_oversampler->processSamplesDown(block);
#ifdef TEMPER_DEMO_BUILD
// After the Faust processing, add the demo restriction to the output stream
m_restriction->processBlock(buffer);
#endif
#if ! JUCE_AUDIOPROCESSOR_NO_GUI
// Push resulting buffer into the Post spectroscope component.
if (editor)
editor->m_vizPost->pushBuffer(buffer);
#endif
}
#if ! JUCE_AUDIOPROCESSOR_NO_GUI
//==============================================================================
bool TemperAudioProcessor::hasEditor() const
{
@@ -259,6 +261,7 @@ AudioProcessorEditor* TemperAudioProcessor::createEditor()
{
return new TemperAudioProcessorEditor (*this, m_params);
}
#endif
//==============================================================================
void TemperAudioProcessor::getStateInformation (MemoryBlock& destData)


+ 2
- 0
ports/temper/source/PluginProcessor.h View File

@@ -38,9 +38,11 @@ public:
void processBlock (AudioSampleBuffer&, MidiBuffer&) override;
#if ! JUCE_AUDIOPROCESSOR_NO_GUI
//==============================================================================
AudioProcessorEditor* createEditor() override;
bool hasEditor() const override;
#endif
//==============================================================================
const String getName() const override;


Loading…
Cancel
Save