├── .clang-format ├── .github ├── FUNDING.yml ├── actions │ ├── build-plugin │ │ └── action.yml │ └── package-plugin │ │ └── action.yml ├── scripts │ ├── .Aptfile │ ├── .Brewfile │ ├── .Wingetfile │ ├── .build.zsh │ ├── .package.zsh │ ├── Build-Windows.ps1 │ ├── Package-Windows.ps1 │ ├── build-linux.sh │ ├── build-linux.zsh │ ├── build-macos.zsh │ ├── check-changes.sh │ ├── check-cmake.sh │ ├── check-format.sh │ ├── package-linux.sh │ ├── package-linux.zsh │ ├── package-macos.zsh │ ├── utils.pwsh │ │ ├── Check-Git.ps1 │ │ ├── Ensure-Location.ps1 │ │ ├── Expand-ArchiveExt.ps1 │ │ ├── Install-BuildDependencies.ps1 │ │ ├── Invoke-External.ps1 │ │ ├── Invoke-GitCheckout.ps1 │ │ ├── Logger.ps1 │ │ ├── Setup-Host.ps1 │ │ └── Setup-Obs.ps1 │ └── utils.zsh │ │ ├── check_linux │ │ ├── check_macos │ │ ├── check_packages │ │ ├── log_debug │ │ ├── log_error │ │ ├── log_info │ │ ├── log_output │ │ ├── log_status │ │ ├── log_warning │ │ ├── mkcd │ │ ├── read_codesign │ │ ├── read_codesign_installer │ │ ├── read_codesign_pass │ │ ├── read_codesign_user │ │ ├── set_loglevel │ │ ├── setup_ccache │ │ ├── setup_linux │ │ ├── setup_macos │ │ └── setup_obs └── workflows │ └── build.yml ├── .gitignore ├── CMakeLists.txt ├── LICENSE ├── README.md ├── audio-control.cpp ├── audio-control.hpp ├── audio-monitor-dock.cpp ├── audio-monitor-dock.hpp ├── audio-monitor-filter.c ├── audio-monitor-filter.h ├── audio-monitor-mac.c ├── audio-monitor-mac.h ├── audio-monitor-null.c ├── audio-monitor-null.h ├── audio-monitor-pulse.c ├── audio-monitor-pulse.h ├── audio-monitor-win.c ├── audio-monitor-win.h ├── audio-output-control.cpp ├── audio-output-control.hpp ├── buildspec.json ├── cmake ├── Bundle │ └── macos │ │ ├── Plugin-Info.plist.in │ │ ├── entitlements.plist │ │ └── installer-macos.pkgproj.in └── ObsPluginHelpers.cmake ├── data └── locale │ ├── en-US.ini │ ├── es-ES.ini │ ├── fr-FR.ini │ ├── ja-JP.ini │ └── pt-BR.ini ├── installer.iss.in ├── media ├── icon.ico ├── logo.png └── screenshot.png ├── resource.rc.in ├── utils.cpp ├── utils.hpp ├── version.h.in ├── volume-meter.cpp └── volume-meter.hpp /.clang-format: -------------------------------------------------------------------------------- 1 | BasedOnStyle: InheritParentConfig 2 | ColumnLimit: 132 -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | github: exeldro 2 | custom: "https://www.paypal.me/exeldro" 3 | patreon: exeldro -------------------------------------------------------------------------------- /.github/actions/build-plugin/action.yml: -------------------------------------------------------------------------------- 1 | name: 'Setup and build plugin' 2 | description: 'Builds the plugin for specified architecture and build config.' 3 | inputs: 4 | target: 5 | description: 'Build target for dependencies' 6 | required: true 7 | config: 8 | description: 'Build configuration' 9 | required: false 10 | default: 'Release' 11 | codesign: 12 | description: 'Enable codesigning (macOS only)' 13 | required: false 14 | default: 'false' 15 | codesignIdent: 16 | description: 'Developer ID for application codesigning (macOS only)' 17 | required: false 18 | default: '-' 19 | visualStudio: 20 | description: 'Visual Studio version (Windows only)' 21 | required: false 22 | default: 'Visual Studio 16 2019' 23 | workingDirectory: 24 | description: 'Working directory for packaging' 25 | required: false 26 | default: ${{ github.workspace }} 27 | runs: 28 | using: 'composite' 29 | steps: 30 | - name: Run macOS Build 31 | if: ${{ runner.os == 'macOS' }} 32 | shell: zsh {0} 33 | env: 34 | CODESIGN_IDENT: ${{ inputs.codesignIdent }} 35 | run: | 36 | build_args=( 37 | -c ${{ inputs.config }} 38 | -t macos-${{ inputs.target }} 39 | ) 40 | 41 | if [[ '${{ inputs.codesign }}' == 'true' ]] build_args+=(-s) 42 | if (( ${+CI} && ${+RUNNER_DEBUG} )) build_args+=(--debug) 43 | 44 | ${{ inputs.workingDirectory }}/.github/scripts/build-macos.zsh ${build_args} 45 | 46 | - name: Run Linux Build 47 | if: ${{ runner.os == 'Linux' }} 48 | shell: bash 49 | run: | 50 | build_args=( 51 | -c ${{ inputs.config }} 52 | -t linux-${{ inputs.target }} 53 | ) 54 | 55 | if [[ -n "${CI}" && -n "${RUNNER_DEBUG}" ]]; then 56 | build_args+=(--debug) 57 | fi 58 | 59 | ${{ inputs.workingDirectory }}/.github/scripts/build-linux.sh "${build_args[@]}" 60 | 61 | - name: Run Windows Build 62 | if: ${{ runner.os == 'Windows' }} 63 | shell: pwsh 64 | run: | 65 | $BuildArgs = @{ 66 | Target = '${{ inputs.target }}' 67 | Configuration = '${{ inputs.config }}' 68 | CMakeGenerator = '${{ inputs.visualStudio }}' 69 | } 70 | 71 | if ( ( Test-Path env:CI ) -and ( Test-Path env:RUNNER_DEBUG ) ) { 72 | $BuildArgs += @{ 73 | Debug = $true 74 | } 75 | } 76 | 77 | ${{ inputs.workingDirectory }}/.github/scripts/Build-Windows.ps1 @BuildArgs 78 | -------------------------------------------------------------------------------- /.github/actions/package-plugin/action.yml: -------------------------------------------------------------------------------- 1 | name: 'Package plugin' 2 | description: 'Packages the plugin for specified architecture and build config.' 3 | inputs: 4 | target: 5 | description: 'Build target for dependencies' 6 | required: true 7 | config: 8 | description: 'Build configuration' 9 | required: false 10 | default: 'Release' 11 | codesign: 12 | description: 'Enable codesigning (macOS only)' 13 | required: false 14 | default: 'false' 15 | notarize: 16 | description: 'Enable notarization (macOS only)' 17 | required: false 18 | default: 'false' 19 | codesignIdent: 20 | description: 'Developer ID for application codesigning (macOS only)' 21 | required: false 22 | default: '-' 23 | installerIdent: 24 | description: 'Developer ID for installer package codesigning (macOS only)' 25 | required: false 26 | default: '' 27 | codesignUser: 28 | description: 'Apple ID username for notarization (macOS only)' 29 | required: false 30 | default: '' 31 | codesignPass: 32 | description: 'Apple ID password for notarization (macOS only)' 33 | required: false 34 | default: '' 35 | createInstaller: 36 | description: 'Create InnoSetup installer (Windows only)' 37 | required: false 38 | default: 'false' 39 | workingDirectory: 40 | description: 'Working directory for packaging' 41 | required: false 42 | default: ${{ github.workspace }} 43 | runs: 44 | using: 'composite' 45 | steps: 46 | - name: Run macOS packaging 47 | if: ${{ runner.os == 'macOS' }} 48 | shell: zsh {0} 49 | env: 50 | CODESIGN_IDENT: ${{ inputs.codesignIdent }} 51 | CODESIGN_IDENT_INSTALLER: ${{ inputs.installerIdent }} 52 | CODESIGN_IDENT_USER: ${{ inputs.codesignUser }} 53 | CODESIGN_IDENT_PASS: ${{ inputs.codesignPass }} 54 | run: | 55 | package_args=( 56 | -c ${{ inputs.config }} 57 | -t macos-${{ inputs.target }} 58 | ) 59 | 60 | if [[ '${{ inputs.codesign }}' == 'true' ]] package_args+=(-s) 61 | if [[ '${{ inputs.notarize }}' == 'true' ]] package_args+=(-n) 62 | if (( ${+CI} && ${+RUNNER_DEBUG} )) build_args+=(--debug) 63 | 64 | ${{ inputs.workingDirectory }}/.github/scripts/package-macos.zsh ${package_args} 65 | 66 | - name: Run Linux packaging 67 | if: ${{ runner.os == 'Linux' }} 68 | shell: bash 69 | run: | 70 | package_args=( 71 | -c ${{ inputs.config }} 72 | -t linux-${{ inputs.target }} 73 | ) 74 | if [[ -n "${CI}" && -n "${RUNNER_DEBUG}" ]]; then 75 | build_args+=(--debug) 76 | fi 77 | 78 | ${{ inputs.workingDirectory }}/.github/scripts/package-linux.sh "${package_args[@]}" 79 | 80 | - name: Run Windows packaging 81 | if: ${{ runner.os == 'Windows' }} 82 | shell: pwsh 83 | run: | 84 | $PackageArgs = @{ 85 | Target = '${{ inputs.target }}' 86 | Configuration = '${{ inputs.config }}' 87 | } 88 | 89 | if ( '${{ inputs.createInstaller }}' -eq 'true' ) { 90 | $PackageArgs += @{BuildInstaller = $true} 91 | } 92 | 93 | if ( ( Test-Path env:CI ) -and ( Test-Path env:RUNNER_DEBUG ) ) { 94 | $BuildArgs += @{ 95 | Debug = $true 96 | } 97 | } 98 | 99 | ${{ inputs.workingDirectory }}/.github/scripts/Package-Windows.ps1 @PackageArgs 100 | -------------------------------------------------------------------------------- /.github/scripts/.Aptfile: -------------------------------------------------------------------------------- 1 | package 'cmake' 2 | package 'ccache' 3 | package 'curl' 4 | package 'git' 5 | package 'jq' 6 | package 'ninja-build', bin: 'ninja' 7 | package 'pkg-config' 8 | package 'clang' 9 | package 'clang-format-13' 10 | -------------------------------------------------------------------------------- /.github/scripts/.Brewfile: -------------------------------------------------------------------------------- 1 | brew "ccache" 2 | brew "coreutils" 3 | brew "cmake" 4 | brew "git" 5 | brew "jq" 6 | brew "ninja" 7 | -------------------------------------------------------------------------------- /.github/scripts/.Wingetfile: -------------------------------------------------------------------------------- 1 | package '7zip.7zip', path: '7-zip', bin: '7z' 2 | package 'cmake', path: 'Cmake\bin', bin: 'cmake' 3 | package 'innosetup', path: 'Inno Setup 6', bin: 'iscc' 4 | -------------------------------------------------------------------------------- /.github/scripts/.build.zsh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | builtin emulate -L zsh 4 | setopt EXTENDED_GLOB 5 | setopt PUSHD_SILENT 6 | setopt ERR_EXIT 7 | setopt ERR_RETURN 8 | setopt NO_UNSET 9 | setopt PIPE_FAIL 10 | setopt NO_AUTO_PUSHD 11 | setopt NO_PUSHD_IGNORE_DUPS 12 | setopt FUNCTION_ARGZERO 13 | 14 | ## Enable for script debugging 15 | # setopt WARN_CREATE_GLOBAL 16 | # setopt WARN_NESTED_VAR 17 | # setopt XTRACE 18 | 19 | autoload -Uz is-at-least && if ! is-at-least 5.2; then 20 | print -u2 -PR "%F{1}${funcstack[1]##*/}:%f Running on Zsh version %B${ZSH_VERSION}%b, but Zsh %B5.2%b is the minimum supported version. Upgrade Zsh to fix this issue." 21 | exit 1 22 | fi 23 | 24 | _trap_error() { 25 | print -u2 -PR '%F{1} ✖︎ script execution error%f' 26 | print -PR -e " 27 | Callstack: 28 | ${(j:\n :)funcfiletrace} 29 | " 30 | exit 2 31 | } 32 | 33 | build() { 34 | if (( ! ${+SCRIPT_HOME} )) typeset -g SCRIPT_HOME=${ZSH_ARGZERO:A:h} 35 | local host_os=${${(s:-:)ZSH_ARGZERO:t:r}[2]} 36 | local target="${host_os}-${CPUTYPE}" 37 | local project_root=${SCRIPT_HOME:A:h:h} 38 | local buildspec_file="${project_root}/buildspec.json" 39 | 40 | trap '_trap_error' ZERR 41 | 42 | fpath=("${SCRIPT_HOME}/utils.zsh" ${fpath}) 43 | autoload -Uz log_info log_error log_output set_loglevel check_${host_os} setup_${host_os} setup_obs setup_ccache 44 | 45 | if [[ ! -r ${buildspec_file} ]] { 46 | log_error \ 47 | 'No buildspec.json found. Please create a build specification for your project.' \ 48 | 'A buildspec.json.template file is provided in the repository to get you started.' 49 | return 2 50 | } 51 | 52 | typeset -g -a skips=() 53 | local -i _verbosity=1 54 | local -r _version='1.0.0' 55 | local -r -a _valid_targets=( 56 | macos-x86_64 57 | macos-arm64 58 | macos-universal 59 | linux-x86_64 60 | ) 61 | local -r -a _valid_configs=(Debug RelWithDebInfo Release MinSizeRel) 62 | if [[ ${host_os} == 'macos' ]] { 63 | local -r -a _valid_generators=(Xcode Ninja 'Unix Makefiles') 64 | local generator="${${CI:+Ninja}:-Xcode}" 65 | } else { 66 | local -r -a _valid_generators=(Ninja 'Unix Makefiles') 67 | local generator='Ninja' 68 | } 69 | local -r _usage=" 70 | Usage: %B${functrace[1]%:*}%b