Skip to content

Commit 1b80dd9

Browse files
Merge pull request #56 from StartAutomating/obs-powershell-updates
obs-powershell 0.1.4
2 parents 120027d + 010f796 commit 1b80dd9

File tree

158 files changed

+1289
-11
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

158 files changed

+1289
-11
lines changed

CHANGELOG.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
## obs-powershell 0.1.4:
2+
3+
* Adding Add-OBSColorSource (Fixes #51)
4+
* Save-OBSSourceScreenShot:
5+
* Attaching .InputName, .SourceName, .ImageWidth, .ImageHeight to output (Fixes #50)
6+
* Now returns a file (Fixes #49)
7+
* -Path parameters now attempt to resolve to an absolute path (Fixes #48)
8+
* All scene items can now:
9+
* Blend() / get .BlendMode (Fixes #53)
10+
* FitToScreen() (Fixes #46)
11+
* Crop() (Fixes #57)
12+
* Rotate() (Fixes #35)
13+
* Color Sources can now .SetColor (Fixes #55)
14+
15+
---
16+
117
## obs-powershell 0.1.3:
218

319
* Requiring ThreadJob Module (Thanks @nyanhp!) (Fixes #36)

Commands/Receive-OBS.ps1

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ function Receive-OBS
7979
if ($PSCmdlet.ParameterSetName -eq 'WaitForResponse') {
8080
$myRequestId = $payloadObject.d.requestID
8181
$myRequestType = $payloadObject.d.requestType
82-
if (-not $myRequestId -or -not $myRequestType) {
82+
if (-not $myRequestId) {
8383
Write-Error "No .RequestID to wait for"
8484
return
8585
}
@@ -123,9 +123,19 @@ function Receive-OBS
123123
}
124124

125125
# Otherwise, create a new PSObject out of the response
126-
$responseObject = [PSObject]::new($responseObject)
127-
# and decorate it with the command name and OBS.requestype.response
128-
$responseObject.pstypenames.add("$myCmd")
126+
$responseObject = [PSObject]::new($responseObject)
127+
128+
# If the response is not a string
129+
if ($responseObject -isnot [string]) {
130+
# clear the typename.
131+
$responseObject.pstypenames.clear()
132+
}
133+
134+
if ($responseObject.inputKind) {
135+
$responseObject.pstypenames.add("OBS.Input.$($responseObject.inputKind -replace '_', '.')")
136+
}
137+
# Decorate the response with the command name and OBS.requestype.response
138+
$responseObject.pstypenames.add("$myCmd")
129139
$responseObject.pstypenames.add("OBS.$myRequestType.Response")
130140

131141
# Now, walk thru all properties in our input payload

Commands/Requests/Add-OBSInput.ps1

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,10 @@ process {
9494
if ($paramCopy[$attr.Name] -is [switch]) {
9595
$paramCopy[$attr.Name] = [bool]$paramCopy[$attr.Name]
9696
}
97+
if ($attr.Name -like '*path') {
98+
$paramCopy[$attr.Name] =
99+
"$($ExecutionContext.SessionState.Path.GetUnresolvedProviderPathFromPSPath($paramCopy[$attr.Name]))"
100+
}
97101
continue nextParam
98102
}
99103
}

Commands/Requests/Add-OBSProfile.ps1

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,10 @@ process {
7373
if ($paramCopy[$attr.Name] -is [switch]) {
7474
$paramCopy[$attr.Name] = [bool]$paramCopy[$attr.Name]
7575
}
76+
if ($attr.Name -like '*path') {
77+
$paramCopy[$attr.Name] =
78+
"$($ExecutionContext.SessionState.Path.GetUnresolvedProviderPathFromPSPath($paramCopy[$attr.Name]))"
79+
}
7680
continue nextParam
7781
}
7882
}

Commands/Requests/Add-OBSScene.ps1

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,10 @@ process {
7373
if ($paramCopy[$attr.Name] -is [switch]) {
7474
$paramCopy[$attr.Name] = [bool]$paramCopy[$attr.Name]
7575
}
76+
if ($attr.Name -like '*path') {
77+
$paramCopy[$attr.Name] =
78+
"$($ExecutionContext.SessionState.Path.GetUnresolvedProviderPathFromPSPath($paramCopy[$attr.Name]))"
79+
}
7680
continue nextParam
7781
}
7882
}

Commands/Requests/Add-OBSSceneCollection.ps1

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,10 @@ process {
7575
if ($paramCopy[$attr.Name] -is [switch]) {
7676
$paramCopy[$attr.Name] = [bool]$paramCopy[$attr.Name]
7777
}
78+
if ($attr.Name -like '*path') {
79+
$paramCopy[$attr.Name] =
80+
"$($ExecutionContext.SessionState.Path.GetUnresolvedProviderPathFromPSPath($paramCopy[$attr.Name]))"
81+
}
7882
continue nextParam
7983
}
8084
}

Commands/Requests/Add-OBSSceneItem.ps1

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,10 @@ process {
8787
if ($paramCopy[$attr.Name] -is [switch]) {
8888
$paramCopy[$attr.Name] = [bool]$paramCopy[$attr.Name]
8989
}
90+
if ($attr.Name -like '*path') {
91+
$paramCopy[$attr.Name] =
92+
"$($ExecutionContext.SessionState.Path.GetUnresolvedProviderPathFromPSPath($paramCopy[$attr.Name]))"
93+
}
9094
continue nextParam
9195
}
9296
}

Commands/Requests/Add-OBSSourceFilter.ps1

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,10 @@ process {
8888
if ($paramCopy[$attr.Name] -is [switch]) {
8989
$paramCopy[$attr.Name] = [bool]$paramCopy[$attr.Name]
9090
}
91+
if ($attr.Name -like '*path') {
92+
$paramCopy[$attr.Name] =
93+
"$($ExecutionContext.SessionState.Path.GetUnresolvedProviderPathFromPSPath($paramCopy[$attr.Name]))"
94+
}
9195
continue nextParam
9296
}
9397
}

Commands/Requests/Copy-OBSSceneItem.ps1

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,10 @@ process {
8787
if ($paramCopy[$attr.Name] -is [switch]) {
8888
$paramCopy[$attr.Name] = [bool]$paramCopy[$attr.Name]
8989
}
90+
if ($attr.Name -like '*path') {
91+
$paramCopy[$attr.Name] =
92+
"$($ExecutionContext.SessionState.Path.GetUnresolvedProviderPathFromPSPath($paramCopy[$attr.Name]))"
93+
}
9094
continue nextParam
9195
}
9296
}

Commands/Requests/Get-OBSCurrentPreviewScene.ps1

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,10 @@ process {
7373
if ($paramCopy[$attr.Name] -is [switch]) {
7474
$paramCopy[$attr.Name] = [bool]$paramCopy[$attr.Name]
7575
}
76+
if ($attr.Name -like '*path') {
77+
$paramCopy[$attr.Name] =
78+
"$($ExecutionContext.SessionState.Path.GetUnresolvedProviderPathFromPSPath($paramCopy[$attr.Name]))"
79+
}
7680
continue nextParam
7781
}
7882
}

0 commit comments

Comments
 (0)