inital commit
This commit is contained in:
commit
a60b1b13b2
78 files changed
+13166
No files matched your search
@@ -0,0 +1,42 @@
|
||||
param(
|
||||
[string]$ObsSource = "D:\dsh-build\obs-studio-33",
|
||||
[string]$ObsLibs = "D:\dsh-build\obs-libs",
|
||||
[string]$QtRoot = "D:\Qt\6.10.3\msvc2022_64",
|
||||
[string]$VsPath = "D:\VS\BuildTools",
|
||||
[string]$BuildDir = ""
|
||||
)
|
||||
|
||||
$ErrorActionPreference = "Stop"
|
||||
|
||||
$root = (Resolve-Path (Join-Path $PSScriptRoot "..")).Path
|
||||
if ([string]::IsNullOrEmpty($BuildDir)) {
|
||||
$BuildDir = Join-Path $root "build"
|
||||
}
|
||||
|
||||
$vcvars = Join-Path $VsPath "VC\Auxiliary\Build\vcvars64.bat"
|
||||
if (-not (Test-Path $vcvars)) {
|
||||
throw "vcvars64.bat not found at '$vcvars'. Set -VsPath to your Visual Studio Build Tools installation."
|
||||
}
|
||||
if (-not (Test-Path (Join-Path $QtRoot "lib\cmake\Qt6\Qt6Config.cmake"))) {
|
||||
throw "Qt6 CMake package not found under '$QtRoot'. Set -QtRoot to your Qt 6 MSVC 2022 x64 installation."
|
||||
}
|
||||
if (-not (Test-Path (Join-Path $ObsSource "libobs\obs.h"))) {
|
||||
throw "obs-studio headers not found under '$ObsSource'. Set -ObsSource to an obs-studio source tree matching the installed OBS version."
|
||||
}
|
||||
if (-not (Test-Path (Join-Path $ObsLibs "obs.lib"))) {
|
||||
throw "obs.lib not found in '$ObsLibs'. Run scripts/gen-obs-libs.ps1 first."
|
||||
}
|
||||
|
||||
$cmd = ('call "{0}" >nul && cmake -S "{1}" -B "{2}" -G Ninja -DCMAKE_BUILD_TYPE=Release ' +
|
||||
'-DCMAKE_PREFIX_PATH="{3}" -DOBS_SOURCE_DIR="{4}" -DOBS_LIB_DIR="{5}" && cmake --build "{2}" --parallel') -f `
|
||||
$vcvars, $root, $BuildDir, $QtRoot, $ObsSource, $ObsLibs
|
||||
|
||||
Write-Host $cmd
|
||||
cmd.exe /c $cmd
|
||||
if ($LASTEXITCODE -ne 0) {
|
||||
throw "Build failed with exit code $LASTEXITCODE"
|
||||
}
|
||||
|
||||
$dll = Join-Path $BuildDir "bin\audio-waveform-dock.dll"
|
||||
Write-Host ""
|
||||
Write-Host "Built: $dll"
|
||||
@@ -0,0 +1,26 @@
|
||||
param(
|
||||
[string]$ObsPath = "C:\Program Files\obs-studio",
|
||||
[string]$OutDir = "D:\dsh-build\obs-libs",
|
||||
[string]$VsPath = "D:\VS\BuildTools"
|
||||
)
|
||||
|
||||
$ErrorActionPreference = "Stop"
|
||||
|
||||
$root = (Resolve-Path (Join-Path $PSScriptRoot "..")).Path
|
||||
$vcvars = Join-Path $VsPath "VC\Auxiliary\Build\vcvars64.bat"
|
||||
$obsBin = Join-Path $ObsPath "bin\64bit"
|
||||
|
||||
if (-not (Test-Path $vcvars)) { throw "vcvars64.bat not found: $vcvars" }
|
||||
if (-not (Test-Path (Join-Path $obsBin "obs.dll"))) { throw "obs.dll not found in $obsBin" }
|
||||
|
||||
New-Item -ItemType Directory -Force $OutDir | Out-Null
|
||||
|
||||
python (Join-Path $root "tools\gen_obs_def.py") (Join-Path $obsBin "obs.dll") (Join-Path $OutDir "obs.def")
|
||||
python (Join-Path $root "tools\gen_obs_def.py") (Join-Path $obsBin "obs-frontend-api.dll") (Join-Path $OutDir "obs-frontend-api.def")
|
||||
|
||||
$cmd = 'call "{0}" >nul && cd /d "{1}" && lib /def:obs.def /machine:x64 /out:obs.lib && lib /def:obs-frontend-api.def /machine:x64 /out:obs-frontend-api.lib' -f `
|
||||
$vcvars, $OutDir
|
||||
cmd.exe /c $cmd
|
||||
if ($LASTEXITCODE -ne 0) { throw "Import library generation failed" }
|
||||
|
||||
Write-Host "Generated: $OutDir\obs.lib, $OutDir\obs-frontend-api.lib"
|
||||
@@ -0,0 +1,36 @@
|
||||
param(
|
||||
[string]$ObsPath = "C:\Program Files\obs-studio",
|
||||
[string]$Dll = "",
|
||||
[string]$DataDir = ""
|
||||
)
|
||||
|
||||
$ErrorActionPreference = "Stop"
|
||||
|
||||
$root = (Resolve-Path (Join-Path $PSScriptRoot "..")).Path
|
||||
if ([string]::IsNullOrEmpty($Dll)) { $Dll = Join-Path $root "build\bin\audio-waveform-dock.dll" }
|
||||
if ([string]::IsNullOrEmpty($DataDir)) { $DataDir = Join-Path $root "data" }
|
||||
|
||||
if (-not (Test-Path $Dll)) {
|
||||
throw "Plugin DLL not found: $Dll (run scripts/build.ps1 first)"
|
||||
}
|
||||
if (-not (Test-Path (Join-Path $ObsPath "obs64.exe")) -and -not (Test-Path (Join-Path $ObsPath "bin\64bit\obs64.exe"))) {
|
||||
throw "OBS not found at '$ObsPath'"
|
||||
}
|
||||
if (Get-Process obs64 -ErrorAction SilentlyContinue) {
|
||||
throw "OBS is running. Please close OBS before installing the plugin."
|
||||
}
|
||||
|
||||
$pluginDir = Join-Path $ObsPath "obs-plugins\64bit"
|
||||
$dataTarget = Join-Path $ObsPath "data\obs-plugins\audio-waveform-dock"
|
||||
$localeTarget = Join-Path $dataTarget "locale"
|
||||
|
||||
New-Item -ItemType Directory -Force $pluginDir | Out-Null
|
||||
New-Item -ItemType Directory -Force $localeTarget | Out-Null
|
||||
|
||||
Copy-Item $Dll (Join-Path $pluginDir "audio-waveform-dock.dll") -Force
|
||||
Copy-Item (Join-Path $DataDir "locale\*.ini") $localeTarget -Force
|
||||
|
||||
Write-Host "Installed to $ObsPath"
|
||||
Write-Host " $pluginDir\audio-waveform-dock.dll"
|
||||
Write-Host " $dataTarget\locale\*.ini"
|
||||
Write-Host "Start OBS and look for the '音频波形监视 / Audio Waveform Monitor' dock."
|
||||
@@ -0,0 +1,21 @@
|
||||
param(
|
||||
[string]$ObsPath = "C:\Program Files\obs-studio"
|
||||
)
|
||||
|
||||
$ErrorActionPreference = "Stop"
|
||||
|
||||
if (Get-Process obs64 -ErrorAction SilentlyContinue) {
|
||||
throw "OBS is running. Please close OBS before uninstalling the plugin."
|
||||
}
|
||||
|
||||
$dllPath = Join-Path $ObsPath "obs-plugins\64bit\audio-waveform-dock.dll"
|
||||
$dataPath = Join-Path $ObsPath "data\obs-plugins\audio-waveform-dock"
|
||||
|
||||
foreach ($path in @($dllPath, $dataPath)) {
|
||||
if (Test-Path $path) {
|
||||
Remove-Item $path -Recurse -Force
|
||||
Write-Host "Removed $path"
|
||||
}
|
||||
}
|
||||
|
||||
Write-Host "Uninstalled audio-waveform-dock."
|
||||
Reference in new issue
Block a user