mirror of
https://github.com/onyx-and-iris/voicemeeter-api-powershell.git
synced 2025-04-11 08:03:51 +01:00
Compare commits
4 Commits
2ad8118f2c
...
b21a71471b
Author | SHA1 | Date | |
---|---|---|---|
b21a71471b | |||
43367525c5 | |||
d0fbd6deef | |||
1df92afcfe |
15
CHANGELOG.md
15
CHANGELOG.md
@ -9,7 +9,20 @@ Before any major/minor/patch is released all test units will be run to verify th
|
|||||||
|
|
||||||
## [Unreleased] These changes have not been added to PSGallery yet
|
## [Unreleased] These changes have not been added to PSGallery yet
|
||||||
|
|
||||||
- [x] Debug statements added to Getters, Setters in higher classes.
|
## [3.2.0]
|
||||||
|
|
||||||
|
### Added
|
||||||
|
|
||||||
|
- Debug statements added to Getters, Setters in higher classes.
|
||||||
|
- RunVoicemeeter function added to base.ps1. Accepts kind name as parameter.
|
||||||
|
- Errors section to README.
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
- All CAPIErrors are now exposed to the consumer.
|
||||||
|
- The function name and error code can be retrieved using [CAPIError].function and [CAPIError].code
|
||||||
|
- Set_By_Script now throws [VMError] if script length exceeds 48kB.
|
||||||
|
- parameter range checks in Vban class.
|
||||||
|
|
||||||
## [3.1.0]
|
## [3.1.0]
|
||||||
|
|
||||||
|
@ -542,6 +542,15 @@ Access to lower level polling functions are provided with these functions:
|
|||||||
- `$vmr.PDirty`: Returns true if a parameter has been updated.
|
- `$vmr.PDirty`: Returns true if a parameter has been updated.
|
||||||
- `$vmr.MDirty`: Returns true if a macrobutton has been updated.
|
- `$vmr.MDirty`: Returns true if a macrobutton has been updated.
|
||||||
|
|
||||||
|
### Errors
|
||||||
|
|
||||||
|
- `VMRemoteError`: Base custom error class.
|
||||||
|
- `LoginError`: Raised when a login error occurs.
|
||||||
|
- `CAPIError`: Raised when a C-API function returns an error code.
|
||||||
|
- The following class properties are available:
|
||||||
|
- `function`: The name of the C-API function that returned the error code.
|
||||||
|
- `code`: The error code.
|
||||||
|
|
||||||
### Run tests
|
### Run tests
|
||||||
|
|
||||||
Run tests using .\tests\pre-commit.ps1 which accepts the following parameters:
|
Run tests using .\tests\pre-commit.ps1 which accepts the following parameters:
|
||||||
|
@ -188,6 +188,9 @@ function Set_By_Script {
|
|||||||
param(
|
param(
|
||||||
[string]$script
|
[string]$script
|
||||||
)
|
)
|
||||||
|
if ($script.Length -gt 48000) {
|
||||||
|
throw [VMError]::new("Script size cannot be larger than 48kB")
|
||||||
|
}
|
||||||
$retval = [int][Voicemeeter.Remote]::VBVMR_SetParameters($script)
|
$retval = [int][Voicemeeter.Remote]::VBVMR_SetParameters($script)
|
||||||
if ($retval -notin @(0)) {
|
if ($retval -notin @(0)) {
|
||||||
throw [CAPIError]::new($retval, "VBVMR_SetParameters")
|
throw [CAPIError]::new($retval, "VBVMR_SetParameters")
|
||||||
|
@ -9,11 +9,11 @@ class LoginError : VMRemoteError {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class CAPIError : VMRemoteError {
|
class CAPIError : VMRemoteError {
|
||||||
[int]$retval
|
[int]$code
|
||||||
[string]$caller
|
[string]$function
|
||||||
|
|
||||||
CAPIError ([int]$retval, [string]$caller) : base ("$caller returned $retval") {
|
CAPIError ([int]$code, [string]$function) : base ("$function returned $code") {
|
||||||
$this.retval = $retval
|
$this.code = $code
|
||||||
$this.caller = $caller
|
$this.function = $function
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user