Skip to content

Commit 2180e2d

Browse files
committed
Added Vanilla as the most minimal example
1 parent a89d418 commit 2180e2d

7 files changed

Lines changed: 136 additions & 0 deletions

File tree

Examples/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,4 +80,5 @@ add_subdirectory(EqualizerExample)
8080
add_subdirectory(ExtendingExample)
8181
add_subdirectory(FoleysSynth)
8282
add_subdirectory(SignalGenerator)
83+
add_subdirectory(Vanilla)
8384
add_subdirectory(PlayerExample)

Examples/Vanilla/CMakeLists.txt

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
cmake_minimum_required(VERSION 3.13.0)
2+
3+
project("Vanilla" VERSION ${FGM_VERSION})
4+
5+
set(${PROJECT_NAME}_sources
6+
Source/PluginProcessor.cpp
7+
Source/PluginProcessor.h)
8+
9+
# add the plugin targets
10+
juce_add_plugin(${PROJECT_NAME}
11+
VERSION "${version}"
12+
COMPANY_NAME "Foleys Finest Audio"
13+
PLUGIN_MANUFACTURER_CODE "FFAU"
14+
PLUGIN_CODE "PgmV"
15+
IS_SYNTH yes
16+
FORMATS ${FORMATS}
17+
VST3_CATEGORIES "Fx" "Analyser" "EQ"
18+
AAX_CATEGORY "AAX_ePlugInCategory_SWGenerators"
19+
AU_MAIN_TYPE "kAudioUnitType_Generator"
20+
COMPANY_WEBSITE "https://foleysfinest.com"
21+
COMPANY_EMAIL "[email protected]"
22+
BUNDLE_ID "com.foleysfinest.Vanilla"
23+
PLUGIN_NAME "PGM-Vanilla"
24+
PRODUCT_NAME "PGM-Vanilla"
25+
NEEDS_WEB_BROWSER FALSE
26+
NEEDS_CURL FALSE)
27+
28+
juce_add_binary_data(${PROJECT_NAME}_data
29+
SOURCES
30+
Resources/magic.xml)
31+
32+
juce_generate_juce_header (${PROJECT_NAME})
33+
34+
target_sources(${PROJECT_NAME}
35+
PRIVATE
36+
${${PROJECT_NAME}_sources})
37+
38+
# add required flags
39+
target_link_libraries(${PROJECT_NAME}
40+
PRIVATE
41+
${project_sources}
42+
${PROJECT_NAME}_data
43+
foleys_gui_magic
44+
juce::juce_audio_basics
45+
juce::juce_audio_plugin_client
46+
juce::juce_audio_processors
47+
juce::juce_audio_utils
48+
juce::juce_dsp
49+
juce::juce_cryptography
50+
juce::juce_gui_extra
51+
juce::juce_recommended_warning_flags
52+
juce::juce_recommended_config_flags
53+
juce::juce_recommended_lto_flags)
54+
55+
target_compile_definitions(${PROJECT_NAME}
56+
PUBLIC
57+
# switch the following off in the product to hide editor
58+
FOLEYS_SHOW_GUI_EDITOR_PALLETTE=0
59+
FOLEYS_SAVE_EDITED_GUI_IN_PLUGIN_STATE=0
60+
JUCE_VST3_CAN_REPLACE_VST2=0
61+
JUCE_USE_CURL=0
62+
JUCE_WEB_BROWSER=0)
63+
64+
# foreach(FORMAT ${FORMATS})
65+
# get_target_property(ARTEFACTS_DIR ${PROJECT_NAME}_${FORMAT} LIBRARY_OUTPUT_DIRECTORY)
66+
# add_custom_command(TARGET ${PROJECT_NAME}_${FORMAT} POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy_directory ${ARTEFACTS_DIR} ${COPY_FOLDER})
67+
# endforeach()
68+
69+
__pgm_internal_add_pluginval_tests (${PROJECT_NAME})
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
3+
<magic>
4+
<Styles>
5+
<Style name="default">
6+
<Nodes/>
7+
<Classes>
8+
<group border="2" flex-direction="column" padding="1"/>
9+
</Classes>
10+
<Types>
11+
<Slider border="0"/>
12+
<ToggleButton border="0" max-height="50" caption-size="0"/>
13+
<TextButton border="0" max-height="50" caption-size="0"/>
14+
<ComboBox border="0" max-height="50" caption-size="0"/>
15+
<Plot border="0" margin="0" padding="0" background-color="00000000"/>
16+
</Types>
17+
<Palettes>
18+
<default/>
19+
</Palettes>
20+
</Style>
21+
</Styles>
22+
<View id="root" flex-direction="column" resizable="1" resize-corner="1">
23+
<Label text="Hello Gui-Magic!" label-text="ffff0000"/>
24+
</View>
25+
</magic>
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
2+
#include "PluginProcessor.h"
3+
4+
5+
6+
VanillaAudioProcessor::VanillaAudioProcessor() : foleys::MagicProcessor(juce::AudioProcessor::BusesProperties()
7+
.withOutput ("Output", juce::AudioChannelSet::stereo(), true))
8+
{}
9+
10+
11+
//==============================================================================
12+
// This creates new instances of the plugin..
13+
juce::AudioProcessor* JUCE_CALLTYPE createPluginFilter()
14+
{
15+
return new VanillaAudioProcessor();
16+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
2+
#pragma once
3+
4+
#include <foleys_gui_magic/foleys_gui_magic.h>
5+
6+
class VanillaAudioProcessor : public foleys::MagicProcessor
7+
{
8+
public:
9+
VanillaAudioProcessor();
10+
11+
void prepareToPlay ([[maybe_unused]]double sampleRate, [[maybe_unused]]int expectedNumSamples) override {}
12+
void processBlock (juce::AudioBuffer<float>&, juce::MidiBuffer&) override {}
13+
void releaseResources() override {}
14+
15+
double getTailLengthSeconds() const override { return 0.0; }
16+
17+
private:
18+
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(VanillaAudioProcessor)
19+
};

modules/foleys_gui_magic/State/foleys_MagicProcessorState.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,11 @@ MagicProcessorState::MagicProcessorState (juce::AudioProcessor& processorToUse)
4141
{
4242
}
4343

44+
MagicProcessorState::~MagicProcessorState()
45+
{
46+
stopTimer();
47+
}
48+
4449
juce::StringArray MagicProcessorState::getParameterNames() const
4550
{
4651
return parameters.getParameterNames();

modules/foleys_gui_magic/State/foleys_MagicProcessorState.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ class MagicProcessorState : public MagicGUIState,
5353
processor and it's internals.
5454
*/
5555
MagicProcessorState (juce::AudioProcessor& processorToUse);
56+
~MagicProcessorState() override;
5657

5758
/**
5859
Returns the IDs of AudioProcessorParameters for selection

0 commit comments

Comments
 (0)