Skip to content

Commit

Permalink
Added Vanilla as the most minimal example
Browse files Browse the repository at this point in the history
  • Loading branch information
ffAudio committed Jul 27, 2023
1 parent a89d418 commit 2180e2d
Show file tree
Hide file tree
Showing 7 changed files with 136 additions and 0 deletions.
1 change: 1 addition & 0 deletions Examples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -80,4 +80,5 @@ add_subdirectory(EqualizerExample)
add_subdirectory(ExtendingExample)
add_subdirectory(FoleysSynth)
add_subdirectory(SignalGenerator)
add_subdirectory(Vanilla)
add_subdirectory(PlayerExample)
69 changes: 69 additions & 0 deletions Examples/Vanilla/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
cmake_minimum_required(VERSION 3.13.0)

project("Vanilla" VERSION ${FGM_VERSION})

set(${PROJECT_NAME}_sources
Source/PluginProcessor.cpp
Source/PluginProcessor.h)

# add the plugin targets
juce_add_plugin(${PROJECT_NAME}
VERSION "${version}"
COMPANY_NAME "Foleys Finest Audio"
PLUGIN_MANUFACTURER_CODE "FFAU"
PLUGIN_CODE "PgmV"
IS_SYNTH yes
FORMATS ${FORMATS}
VST3_CATEGORIES "Fx" "Analyser" "EQ"
AAX_CATEGORY "AAX_ePlugInCategory_SWGenerators"
AU_MAIN_TYPE "kAudioUnitType_Generator"
COMPANY_WEBSITE "https://foleysfinest.com"
COMPANY_EMAIL "info@foleysfinest.com"
BUNDLE_ID "com.foleysfinest.Vanilla"
PLUGIN_NAME "PGM-Vanilla"
PRODUCT_NAME "PGM-Vanilla"
NEEDS_WEB_BROWSER FALSE
NEEDS_CURL FALSE)

juce_add_binary_data(${PROJECT_NAME}_data
SOURCES
Resources/magic.xml)

juce_generate_juce_header (${PROJECT_NAME})

target_sources(${PROJECT_NAME}
PRIVATE
${${PROJECT_NAME}_sources})

# add required flags
target_link_libraries(${PROJECT_NAME}
PRIVATE
${project_sources}
${PROJECT_NAME}_data
foleys_gui_magic
juce::juce_audio_basics
juce::juce_audio_plugin_client
juce::juce_audio_processors
juce::juce_audio_utils
juce::juce_dsp
juce::juce_cryptography
juce::juce_gui_extra
juce::juce_recommended_warning_flags
juce::juce_recommended_config_flags
juce::juce_recommended_lto_flags)

target_compile_definitions(${PROJECT_NAME}
PUBLIC
# switch the following off in the product to hide editor
FOLEYS_SHOW_GUI_EDITOR_PALLETTE=0
FOLEYS_SAVE_EDITED_GUI_IN_PLUGIN_STATE=0
JUCE_VST3_CAN_REPLACE_VST2=0
JUCE_USE_CURL=0
JUCE_WEB_BROWSER=0)

# foreach(FORMAT ${FORMATS})
# get_target_property(ARTEFACTS_DIR ${PROJECT_NAME}_${FORMAT} LIBRARY_OUTPUT_DIRECTORY)
# add_custom_command(TARGET ${PROJECT_NAME}_${FORMAT} POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy_directory ${ARTEFACTS_DIR} ${COPY_FOLDER})
# endforeach()

__pgm_internal_add_pluginval_tests (${PROJECT_NAME})
25 changes: 25 additions & 0 deletions Examples/Vanilla/Resources/magic.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>

<magic>
<Styles>
<Style name="default">
<Nodes/>
<Classes>
<group border="2" flex-direction="column" padding="1"/>
</Classes>
<Types>
<Slider border="0"/>
<ToggleButton border="0" max-height="50" caption-size="0"/>
<TextButton border="0" max-height="50" caption-size="0"/>
<ComboBox border="0" max-height="50" caption-size="0"/>
<Plot border="0" margin="0" padding="0" background-color="00000000"/>
</Types>
<Palettes>
<default/>
</Palettes>
</Style>
</Styles>
<View id="root" flex-direction="column" resizable="1" resize-corner="1">
<Label text="Hello Gui-Magic!" label-text="ffff0000"/>
</View>
</magic>
16 changes: 16 additions & 0 deletions Examples/Vanilla/Source/PluginProcessor.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@

#include "PluginProcessor.h"



VanillaAudioProcessor::VanillaAudioProcessor() : foleys::MagicProcessor(juce::AudioProcessor::BusesProperties()
.withOutput ("Output", juce::AudioChannelSet::stereo(), true))
{}


//==============================================================================
// This creates new instances of the plugin..
juce::AudioProcessor* JUCE_CALLTYPE createPluginFilter()
{
return new VanillaAudioProcessor();
}
19 changes: 19 additions & 0 deletions Examples/Vanilla/Source/PluginProcessor.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@

#pragma once

#include <foleys_gui_magic/foleys_gui_magic.h>

class VanillaAudioProcessor : public foleys::MagicProcessor
{
public:
VanillaAudioProcessor();

void prepareToPlay ([[maybe_unused]]double sampleRate, [[maybe_unused]]int expectedNumSamples) override {}
void processBlock (juce::AudioBuffer<float>&, juce::MidiBuffer&) override {}
void releaseResources() override {}

double getTailLengthSeconds() const override { return 0.0; }

private:
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(VanillaAudioProcessor)
};
5 changes: 5 additions & 0 deletions modules/foleys_gui_magic/State/foleys_MagicProcessorState.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@ MagicProcessorState::MagicProcessorState (juce::AudioProcessor& processorToUse)
{
}

MagicProcessorState::~MagicProcessorState()
{
stopTimer();
}

juce::StringArray MagicProcessorState::getParameterNames() const
{
return parameters.getParameterNames();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ class MagicProcessorState : public MagicGUIState,
processor and it's internals.
*/
MagicProcessorState (juce::AudioProcessor& processorToUse);
~MagicProcessorState() override;

/**
Returns the IDs of AudioProcessorParameters for selection
Expand Down

0 comments on commit 2180e2d

Please sign in to comment.