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
86 changes: 86 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
# https://forum.juce.com/t/automatic-juce-like-code-formatting-with-clang-format/31624/20
---
AccessModifierOffset: -4
AlignAfterOpenBracket: DontAlign
AlignConsecutiveAssignments: false
AlignConsecutiveDeclarations: false
AlignEscapedNewlines: Left
AlignOperands: Align
AlignTrailingComments: false
AllowAllParametersOfDeclarationOnNextLine: false
AllowShortBlocksOnASingleLine: Never
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: All
AllowShortIfStatementsOnASingleLine: Never
AllowShortLambdasOnASingleLine: All
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterDefinitionReturnType: None
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: false
AlwaysBreakTemplateDeclarations: Yes
BinPackArguments: false
BinPackParameters: false
BreakAfterJavaFieldAnnotations: false
BreakBeforeBinaryOperators: NonAssignment
BreakBeforeBraces: Custom
BraceWrapping:
AfterClass: true
AfterCaseLabel: true
AfterFunction: true
AfterNamespace: true
AfterStruct: true
BeforeElse: true
AfterControlStatement: Always
BeforeLambdaBody: false
BreakBeforeTernaryOperators: true
BreakConstructorInitializersBeforeComma: false
BreakStringLiterals: false
ColumnLimit: 0
ConstructorInitializerAllOnOneLineOrOnePerLine: true
ConstructorInitializerIndentWidth: 4
ContinuationIndentWidth: 4
Cpp11BracedListStyle: false
DerivePointerAlignment: false
DisableFormat: false
ExperimentalAutoDetectBinPacking: false
IndentCaseLabels: true
IndentPPDirectives: BeforeHash
IndentWidth: 4
IndentWrappedFunctionNames: true
KeepEmptyLinesAtTheStartOfBlocks: false
Language: Cpp
MaxEmptyLinesToKeep: 1
FixNamespaceComments: false
NamespaceIndentation: All
PointerAlignment: Left
ReflowComments: false
SortIncludes: true
SpaceAfterCStyleCast: true
SpaceAfterLogicalNot: false
SpaceBeforeAssignmentOperators: true
SpaceBeforeCpp11BracedList: true
SpaceBeforeParens: NonEmptyParentheses
SpaceInEmptyParentheses: false
SpaceBeforeInheritanceColon: true
SpacesInAngles: false
SpacesInCStyleCastParentheses: false
SpacesInContainerLiterals: true
SpacesInParentheses: false
SpacesInSquareBrackets: false
Standard: "c++20"
TabWidth: 4
UseTab: Never
UseCRLF: false
---
Language: ObjC
BasedOnStyle: Chromium
BreakBeforeBraces: Allman
ColumnLimit: 0
IndentWidth: 4
KeepEmptyLinesAtTheStartOfBlocks: false
ObjCSpaceAfterProperty: true
ObjCSpaceBeforeProtocolList: true
PointerAlignment: Left
SpacesBeforeTrailingComments: 1
TabWidth: 4
UseTab: Never
40 changes: 40 additions & 0 deletions .clang-tidy
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
---
# Clang-Tidy configuration for JUCE audio plugin development.
#
# Focus: real-time safety, modernization, thread safety, common bugs.
# Avoids checks that conflict with JUCE conventions.

Checks: >
-*,
bugprone-*,
-bugprone-easily-swappable-parameters,
-bugprone-narrowing-conversions,
cppcoreguidelines-avoid-non-const-global-variables,
cppcoreguidelines-init-variables,
cppcoreguidelines-slicing,
misc-redundant-expression,
misc-unused-using-decls,
modernize-use-auto,
modernize-use-nullptr,
modernize-use-override,
modernize-use-using,
modernize-loop-convert,
performance-*,
-performance-no-int-to-ptr,
readability-braces-around-statements,
readability-const-return-type,
readability-container-size-empty,
readability-implicit-bool-conversion,
readability-redundant-smartptr-get,

WarningsAsErrors: ''

HeaderFilterRegex: 'source/.*'

CheckOptions:
- key: modernize-use-auto.MinTypeNameLength
value: '5'
- key: readability-braces-around-statements.ShortStatementLines
value: '1'
- key: performance-move-const-arg.CheckTriviallyCopyableMove
value: 'false'
160 changes: 160 additions & 0 deletions .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,160 @@
name: Build & Test

on:
push:
branches: [main]
pull_request:
branches: [main]

env:
BUILD_TYPE: Release
CMAKE_BUILD_PARALLEL_LEVEL: 4

defaults:
run:
shell: bash

jobs:
build:
name: ${{ matrix.name }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- name: Linux
os: ubuntu-22.04
- name: macOS
os: macos-14
- name: Windows
os: windows-latest

steps:
- name: Checkout code
uses: actions/checkout@v5
with:
submodules: recursive
token: ${{ (secrets.PAT != '' && secrets.PAT) || github.token }}

- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: latest

- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: "1.26.x"
cache: false

- name: Install Linux dependencies
if: runner.os == 'Linux'
run: |
sudo apt-get update && sudo apt-get install -y \
libasound2-dev libx11-dev libxinerama-dev libxext-dev \
libfreetype6-dev libwebkit2gtk-4.0-dev libglu1-mesa-dev \
libxcursor-dev libxrandr-dev libxcomposite-dev libxrender-dev \
libcurl4-openssl-dev

- name: Build wavgang-bridge
run: |
cd bridge
go build -o wavgang-bridge .

# JUCE FindWebView2.cmake only searches a NuGet packages folder; GH Windows images don't have it.
- name: Fetch WebView2 NuGet package for JUCE
if: runner.os == 'Windows'
shell: pwsh
run: |
$ver = "1.0.3485.44"
$root = Join-Path $env:RUNNER_TEMP "webview2-nuget"
$pkgDir = Join-Path $root "Microsoft.Web.WebView2.$ver"
New-Item -ItemType Directory -Force -Path $pkgDir | Out-Null
$zip = Join-Path $env:RUNNER_TEMP "Microsoft.Web.WebView2.$ver.nupkg"
Invoke-WebRequest -Uri "https://www.nuget.org/api/v2/package/Microsoft.Web.WebView2/$ver" -OutFile $zip
Expand-Archive -Path $zip -DestinationPath $pkgDir -Force
Add-Content -Path $env:GITHUB_ENV -Value "JUCE_WEBVIEW2_PACKAGE_LOCATION=$root"

- name: Configure
shell: bash
run: |
cmake_args=(-B build -DCMAKE_BUILD_TYPE="${{ env.BUILD_TYPE }}")
if [[ -n "${JUCE_WEBVIEW2_PACKAGE_LOCATION:-}" ]]; then
cmake_args+=("-DJUCE_WEBVIEW2_PACKAGE_LOCATION=${JUCE_WEBVIEW2_PACKAGE_LOCATION}")
fi
cmake "${cmake_args[@]}"

- name: Build
run: cmake --build build --config ${{ env.BUILD_TYPE }}

- name: Test
working-directory: build
run: ctest --output-on-failure -C ${{ env.BUILD_TYPE }}

- name: Upload build artifacts
if: always()
uses: actions/upload-artifact@v4
with:
name: build-${{ matrix.name }}
path: |
build/**/*.vst3
build/**/*.component
build/**/*.clap
bridge/wavgang-bridge
if-no-files-found: ignore

- name: Upload AGPL packaging hints
if: always()
uses: actions/upload-artifact@v4
with:
name: agpl-packaging-${{ matrix.name }}
path: |
packaging/agpl/**
bridge/LICENSE
docs/BRIDGE_API.md
if-no-files-found: ignore

format-check:
name: Format Check
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v5

- name: Check clang-format
run: |
find source tests benchmarks -name '*.cpp' -o -name '*.h' | \
xargs clang-format --dry-run --Werror 2>&1 || \
(echo "::error::Code formatting issues found. Run 'clang-format -i' on the files above." && exit 1)

sanitizer:
name: ASan + UBSan
runs-on: ubuntu-22.04
steps:
- name: Checkout code
uses: actions/checkout@v5
with:
submodules: recursive
token: ${{ (secrets.PAT != '' && secrets.PAT) || github.token }}

- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: latest

- name: Install Linux dependencies
run: |
sudo apt-get update && sudo apt-get install -y \
libasound2-dev libx11-dev libxinerama-dev libxext-dev \
libfreetype6-dev libwebkit2gtk-4.0-dev libglu1-mesa-dev \
libxcursor-dev libxrandr-dev libxcomposite-dev libxrender-dev \
libcurl4-openssl-dev

- name: Configure with ASan
run: cmake -B build -DCMAKE_BUILD_TYPE=Debug -DWITH_ADDRESS_SANITIZER=ON

- name: Build
run: cmake --build build

- name: Test under ASan
working-directory: build
run: ctest --output-on-failure
50 changes: 50 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# CMake
CMakeLists.txt.user
CMakeCache.txt
CMakeFiles
CMakeScripts
Makefile
cmake_install.cmake
install_manifest.txt
compile_commands.json
CTestTestfile.cmake
_deps
**/.DS_Store

# Build directories
/build
Builds/*
!Builds/.gitkeep
Install/*
Testing

# IDE
.idea
.vscode
*.swp
*.swo
*~

# CMake build variants
cmake-build-debug
cmake-build-release
cmake-build-relwithdebinfo

# Packaging output
packaging/Output/*

# Generated binary data
/assets/BinaryData/moonbase_api_config.json

# Asset source files (not needed in build)
/assets/blender_assets/**
/assets/*.psd
/assets/Advertising

# Web UI toolchain
ui/node_modules/
ui/dist/

# Go bridge binary
bridge/wavgang-bridge
bridge/wavgang-bridge.exe
38 changes: 38 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
[submodule "JUCE"]
path = JUCE
url = https://github.com/juce-framework/JUCE/
branch = develop
ignore = dirty
[submodule "cmake"]
path = cmake
url = https://github.com/SeamusMullan/cmake-includes.git
branch = main
ignore = dirty
[submodule "modules/melatonin_inspector"]
path = modules/melatonin_inspector
url = https://github.com/sudara/melatonin_inspector.git
branch = main
ignore = dirty
[submodule "modules/clap-juce-extensions"]
path = modules/clap-juce-extensions
url = https://github.com/SeamusMullan/clap-juce-extensions.git
branch = main
ignore = dirty
[submodule "modules/moonbase_JUCEClient"]
path = modules/moonbase_JUCEClient
url = https://github.com/Moonbase-sh/moonbase_JUCEClient
branch = main
ignore = dirty
[submodule "modules/DirektDSP_GUI"]
path = modules/DirektDSP_GUI
url = https://github.com/DirektDSP/DirektDSP_GUI.git
[submodule "modules/cycfi_q"]
path = modules/cycfi_q
url = https://github.com/cycfi/q.git
[submodule "modules/cycfi_infra"]
path = modules/cycfi_infra
url = https://github.com/cycfi/infra.git
[submodule "third_party/friendnet"]
path = third_party/friendnet
url = https://github.com/DirektDSP/FriendNet.git
branch = master
Loading
Loading