Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions complete/CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,14 @@
"CMAKE_BUILD_TYPE": "Release"
}
},
{
"name": "release-with-tests",
"binaryDir": "cmake-release-build-with-tests",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Release",
"BUILD_TESTS": "ON"
}
},
{
"name": "release-with-debug-info",
"binaryDir": "cmake-release-with-debug-info-build",
Expand Down Expand Up @@ -98,6 +106,11 @@
"configurePreset": "release",
"configuration": "Release"
},
{
"name": "release-with-tests",
"configurePreset": "release-with-tests",
"configuration": "Release"
},
{
"name": "release-with-debug-info",
"configurePreset": "release-with-debug-info",
Expand Down Expand Up @@ -135,6 +148,11 @@
"inherits": "default-with-tests",
"configurePreset": "default-with-tests"
},
{
"name": "release-with-tests",
"inherits": "default-with-tests",
"configurePreset": "release-with-tests"
},
{
"name": "ninja-debug",
"inherits": "default-with-tests",
Expand Down
5 changes: 5 additions & 0 deletions complete/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,11 @@ target_compile_definitions(TremoloCoursePluginTest
PRIVATE
JUCE_WEB_BROWSER=0
JUCE_USE_CURL=0
# We need to re-export these definitions to the test project, because the tremolo_plugin module
# does not define them
JucePlugin_Manufacturer="$<TARGET_PROPERTY:TremoloCoursePlugin,JUCE_COMPANY_NAME>"
JucePlugin_Name="$<TARGET_PROPERTY:TremoloCoursePlugin,JUCE_PLUGIN_NAME>"
JucePlugin_VersionString="$<TARGET_PROPERTY:TremoloCoursePlugin,JUCE_VERSION>"
)

# Thanks to the fact that we link against the gtest_main library, we don't have to write the main function ourselves.
Expand Down
39 changes: 39 additions & 0 deletions complete/tremolo_plugin/include/Tremolo/AboutComponent.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#pragma once

namespace tremolo {
class AboutComponent : public juce::Component {
public:
AboutComponent() {
popup.setAllowedPlacement(juce::BubbleComponent::BubblePlacement::below);
popup.setAlwaysOnTop(true);

// since the popup is displayed outside the editor window,
// we have to add it to the desktop
popup.addToDesktop(0);

text.setColour(
CustomLookAndFeel::getColor(CustomLookAndFeel::Colors::paleBlue));
text.setJustification(juce::Justification::centred);
}

void paint(juce::Graphics& g) override {
g.setColour(juce::Colour{0xFF315160});
constexpr auto thickness = 2.f;
g.drawEllipse(getLocalBounds().toFloat().reduced(thickness), thickness);
g.setFont(CustomLookAndFeel::getSideLabelsFont());
g.drawFittedText("i", getLocalBounds(), juce::Justification::centred, 1);
}

void mouseDown(const juce::MouseEvent&) override {
if (!popup.isVisible()) {
popup.showAt(this, text, 0, true);
}
}

private:
juce::BubbleMessageComponent popup;
juce::AttributedString text{JucePlugin_Manufacturer
"\n" JucePlugin_Name "\n" __DATE__ " " __TIME__
" v" JucePlugin_VersionString};
};
} // namespace tremolo
1 change: 1 addition & 0 deletions complete/tremolo_plugin/include/Tremolo/PluginEditor.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ class PluginEditor : public juce::AudioProcessorEditor {
juce::ButtonParameterAttachment bypassAttachment;

LfoVisualizer lfoVisualizer;
AboutComponent about;

CustomLookAndFeel lookAndFeel;

Expand Down
6 changes: 6 additions & 0 deletions complete/tremolo_plugin/source/PluginEditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ PluginEditor::PluginEditor(PluginProcessor& p)
lfoVisualizer.setBackgroundColor(juce::Colours::transparentBlack);
addAndMakeVisible(lfoVisualizer);

addAndMakeVisible(about);

setLookAndFeel(&lookAndFeel);

// Make sure that before the constructor has finished, you've set the
Expand Down Expand Up @@ -121,5 +123,9 @@ void PluginEditor::resized() {
bypassLabelBounds.removeFromLeft(396);

bypassLabel.setBounds(bypassLabelBounds);

constexpr auto aboutSize = 20;
about.setBounds(
getLocalBounds().removeFromRight(aboutSize).removeFromTop(aboutSize));
}
} // namespace tremolo
1 change: 1 addition & 0 deletions complete/tremolo_plugin/tremolo_plugin.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,5 @@ END_JUCE_MODULE_DECLARATION
#include "include/Tremolo/Tremolo.h"
#include "include/Tremolo/BypassTransitionSmoother.h"
#include "include/Tremolo/PluginProcessor.h"
#include "include/Tremolo/AboutComponent.h"
#include "include/Tremolo/PluginEditor.h"
5 changes: 5 additions & 0 deletions todo/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,11 @@ target_compile_definitions(TremoloCoursePluginTest
PRIVATE
JUCE_WEB_BROWSER=0
JUCE_USE_CURL=0
# We need to re-export these definitions to the test project, because the tremolo_plugin module
# does not define them
JucePlugin_Manufacturer="$<TARGET_PROPERTY:TremoloCoursePlugin,JUCE_COMPANY_NAME>"
JucePlugin_Name="$<TARGET_PROPERTY:TremoloCoursePlugin,JUCE_PLUGIN_NAME>"
JucePlugin_VersionString="$<TARGET_PROPERTY:TremoloCoursePlugin,JUCE_VERSION>"
)

# Thanks to the fact that we link against the gtest_main library, we don't have to write the main function ourselves.
Expand Down