#include <JuceHeader.h>
class HelloWorldEditor : public juce::AudioProcessorEditor
{
public:
HelloWorldEditor (HelloWorldProcessor& p)
: AudioProcessorEditor (p), processor (p)
{
addAndMakeVisible (webBrowserComponent);
webBrowserComponent.goToURL ("https://google.com");
setSize (700, 700);
}
~HelloWorldEditor() override {}
void paint (juce::Graphics& g) override
{
g.fillAll (juce::Colours::black);
g.setColour (juce::Colours::white);
g.setFont (20.0f);
g.drawText ("Hello World?!!!!!!!", getLocalBounds(),
juce::Justification::centred, true);
}
void resized () override
{
webBrowserComponent.setBounds (getLocalBounds ());
}
private:
HelloWorldProcessor& processor;
juce::WebBrowserComponent webBrowserComponent
{
juce::WebBrowserComponent::Options {}
.withBackend (juce::WebBrowserComponent::Options::Backend::webview2)
.withWinWebView2Options(juce::WebBrowserComponent::Options::WinWebView2{})
};
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (HelloWorldEditor)
};
cmake_minimum_required(VERSION 3.22)
project(AUDIO_PLUGIN_EXAMPLE VERSION 0.0.1)
set(PRODUCT_NAME "HelloWorld")
include(FetchContent)
FetchContent_Declare(
JUCE
GIT_REPOSITORY https://github.com/juce-framework/JUCE.git
GIT_TAG master
)
FetchContent_MakeAvailable(JUCE)
juce_add_plugin(${PRODUCT_NAME}
BUNDLE_ID "dev.helloworld.plugin"
COMPANY_NAME "HelloWorld"
IS_SYNTH TRUE
NEEDS_MIDI_INPUT TRUE
NEEDS_MIDI_OUTPUT TRUE
AU_MAIN_TYPE kAudioUnitType_MIDIProcessor
COPY_PLUGIN_AFTER_BUILD TRUE
PLUGIN_MANUFACTURER_CODE hlwr
PLUGIN_CODE Hlwr
FORMATS AU VST3
PRODUCT_NAME ${PRODUCT_NAME}
NEEDS_WEB_BROWSER TRUE
NEEDS_WEBVIEW2 TRUE
)
juce_generate_juce_header(${PRODUCT_NAME})
target_sources(${PRODUCT_NAME} PRIVATE main.cpp)
target_compile_definitions(${PRODUCT_NAME}
PUBLIC
JUCE_WEB_BROWSER=1
JUCE_USE_WIN_WEBVIEW2_WITH_STATIC_LINKING=1
JUCE_USE_CURL=0
JUCE_VST3_CAN_REPLACE_VST2=0)
target_link_libraries(${PRODUCT_NAME}
PRIVATE
juce::juce_audio_utils
PUBLIC
juce::juce_recommended_config_flags
juce::juce_recommended_lto_flags
juce::juce_recommended_warning_flags)
#build.yml
name: Build VST3 on Windows
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
build-windows:
runs-on: windows-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Install WebView2 - Register package source
shell: pwsh
run: |
Register-PackageSource -ProviderName NuGet -Name nugetRepository -Location https://www.nuget.org/api/v2 -Force
- name: Install WebView2 - Install package
shell: pwsh
run: |**strong text**
Install-Package Microsoft.Web.WebView2 -Scope CurrentUser -RequiredVersion 1.0.1901.177 -Source nugetRepository -Force
- name: Configure CMake
run: cmake -B build -S . -A x64 -G "Visual Studio 17 2022"
- name: Build project
run: cmake --build build --config Release
- name: Upload built VST3
uses: actions/upload-artifact@v3
with:
name: vst3-files
path: build/**/*.vst3
I wrote a simple Hello World plugin as above and am building it for Windows via GitHub Actions.
I tried loading the built VST3 on Windows 10 in various DAWs, and the results were as follows:
Ableton Live 11: Displays with WebView, but the text appears extremely blurry, almost like a blur effect.
FL Studio: The plugin doesn’t get scanned at all.
Reaper: Displays using IE instead of WebView2.
Bitwig: Displays using IE instead of WebView2.
I have no idea what the issue is. If there is a problem with my code, please let me know. When I used the Cmajor plugin, I confirmed that all WebViews (Choc) opened properly, and the VST3 scan worked without any issues.
Additionally, setting it up on Windows is too complicated, and I wish there were proper documentation explaining this clearly.
