Compare commits

..

No commits in common. "b21a71471bce1517b7b448188b7d0ac5b881d560" and "2ad8118f2c5d4244fbe817e35a4f856dfe96cc63" have entirely different histories.

4 changed files with 6 additions and 31 deletions

View File

@ -9,20 +9,7 @@ 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
## [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.
- [x] Debug statements added to Getters, Setters in higher classes.
## [3.1.0]

View File

@ -542,15 +542,6 @@ Access to lower level polling functions are provided with these functions:
- `$vmr.PDirty`: Returns true if a parameter 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 using .\tests\pre-commit.ps1 which accepts the following parameters:

View File

@ -188,9 +188,6 @@ function Set_By_Script {
param(
[string]$script
)
if ($script.Length -gt 48000) {
throw [VMError]::new("Script size cannot be larger than 48kB")
}
$retval = [int][Voicemeeter.Remote]::VBVMR_SetParameters($script)
if ($retval -notin @(0)) {
throw [CAPIError]::new($retval, "VBVMR_SetParameters")

View File

@ -9,11 +9,11 @@ class LoginError : VMRemoteError {
}
class CAPIError : VMRemoteError {
[int]$code
[string]$function
[int]$retval
[string]$caller
CAPIError ([int]$code, [string]$function) : base ("$function returned $code") {
$this.code = $code
$this.function = $function
CAPIError ([int]$retval, [string]$caller) : base ("$caller returned $retval") {
$this.retval = $retval
$this.caller = $caller
}
}