diff --git a/lib/binding.ps1 b/lib/binding.ps1 index 99550c7..bd69faf 100644 --- a/lib/binding.ps1 +++ b/lib/binding.ps1 @@ -3,13 +3,13 @@ function Setup_DLL { $vb_path = Get_VBPath if ([string]::IsNullOrWhiteSpace($vb_path)) { - throw [VMRemoteErrors]::new("ERROR: Couldn't get Voicemeeter path") + throw [VMRemoteError]::new("couldn't get Voicemeeter path") } $dll = Join-Path -Path $vb_path -ChildPath ("VoicemeeterRemote" + ` (& { if ([Environment]::Is64BitOperatingSystem) { "64" } else { "" } }) + ` ".dll") } - catch [VMRemoteErrors] { + catch [VMRemoteError] { Write-Warning $_.Exception.ErrorMessage() return $false } diff --git a/lib/errors.ps1 b/lib/errors.ps1 index a3d659d..22b2658 100644 --- a/lib/errors.ps1 +++ b/lib/errors.ps1 @@ -1,7 +1,7 @@ -class VMRemoteErrors : Exception { +class VMRemoteError : Exception { [string]$msg - VMRemoteErrors ([string]$msg) { + VMRemoteError ([string]$msg) { $this.msg = $msg } @@ -10,12 +10,12 @@ class VMRemoteErrors : Exception { } } -class LoginError : VMRemoteErrors { +class LoginError : VMRemoteError { LoginError ([string]$msg) : base ([string]$msg) { } } -class CAPIError : VMRemoteErrors { +class CAPIError : VMRemoteError { [int]$retval [string]$caller @@ -25,6 +25,6 @@ class CAPIError : VMRemoteErrors { } [string] ErrorMessage () { - return "ERROR: CAPI return value: {0} in {1}" -f $this.retval, $this.caller + return "CAPI return value: {0} in {1}" -f $this.retval, $this.caller } } diff --git a/lib/kinds.ps1 b/lib/kinds.ps1 index b4c8bec..cd5efdb 100644 --- a/lib/kinds.ps1 +++ b/lib/kinds.ps1 @@ -28,6 +28,6 @@ $KindMap = @{ }; } -function GetKind ([string]$kind_id) { - $KindMap[$kind_id] +function GetKind ([string]$kindId) { + $KindMap[$kindId] }