Skip to content

Commit

Permalink
feat: Moving Build Files Into /Build ( Fixes #166, Fixes #167 )
Browse files Browse the repository at this point in the history
Also scoping import to /Commands
  • Loading branch information
James Brundage committed Jan 28, 2024
1 parent 23ced31 commit 33de4cc
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 4 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "obs-shaderfilter"]
path = obs-shaderfilter
url = https://github.com/exeldro/obs-shaderfilter.git
57 changes: 54 additions & 3 deletions obs-powershell.build.ps1 → Build/obs-powershell.build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ $maxRangeRestriction = "\<=\s{0,}(?<max>[\d\.-]+)"
$obsFunctions = @()
# and files we build.
$filesBuilt = @()

Push-Location ($PSScriptRoot | Split-Path)
# And determine where we want to store them
$commandsPath = Join-Path $PSScriptRoot Commands
$commandsPath = Join-Path $pwd Commands
$requestsPath = Join-Path $commandsPath Requests

# (create the directory if it didn't already exist)
Expand All @@ -64,6 +64,55 @@ $PostProcess = @{
}
}

$AdditionalParameter = @{
"Set-OBSVideoSettings" = {
param(
[ValidateScript({
$resolutionPresets = "4K", "1080p","720p"
if ($_ -notin $resolutionPresets -and
$_ -notmatch "\d+x\d+") {
throw "Resolution must be '$($resolutionPresets -join "','")' or WidthxHeight"
}
})]
$Resolution
)
}
}

$PreProcess = @{
"Set-OBSVideoSettings" = {
if ($Resolution) {
$resolutionPresets = "4K", "1080p","720p"
$width, $height =
switch ($resolution) {
4K {
3840
2160
}
1080p {
1920
1080
}
720p {
1280
720
}
default {
$_ -split 'x'
}
}

$BaseWidth = $OutputWidth =
$PSBoundParameters["BaseWidth"] = $PSBoundParameters["OutputWidth"] =
$width

$BaseHeight = $OutputHeight =
$PSBoundParameters["BaseHeight"] = $PSBoundParameters["OutputHeight"] =
$height
}
}
}

# Declare the process block for all commands now
$obsFunctionProcessBlock = {

Expand Down Expand Up @@ -351,4 +400,6 @@ $filesBuilt |
Add-Member NoteProperty OBSRequestInfo $file.obsRequestInfo -Force -PassThru |
Add-Member NoteProperty Contents $file.Contents -Force -PassThru
}
}
}

Pop-Location
3 changes: 2 additions & 1 deletion obs-powershell.ps.psm1
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
[Include('*-*.ps1')]$PSScriptRoot
$CommandsPath = (Join-Path $PSScriptRoot "Commands")
[Include('*-*.ps1')]$CommandsPath

$MyInvocation.MyCommand.ScriptBlock.Module.OnRemove = {
Get-OBSEffect | Stop-OBSEffect
Expand Down
1 change: 1 addition & 0 deletions obs-shaderfilter
Submodule obs-shaderfilter added at f81763

0 comments on commit 33de4cc

Please sign in to comment.