diff --git a/lib/Voicemeeter.psm1 b/lib/Voicemeeter.psm1 index d132c4e..3165c0d 100644 --- a/lib/Voicemeeter.psm1 +++ b/lib/Voicemeeter.psm1 @@ -40,6 +40,15 @@ class Remote { Logout } + [Remote] RunVoicemeeter([String]$kindId) { + RunVm -kindId $kindId + return Make_Remote -kindId $kindId + } + + [void] RunApplication([String]$appId) { + RunApp -appId $appId + } + [string] GetType() { return VmType } @@ -159,6 +168,26 @@ class RemotePotato : Remote { } } +function Make_Remote { + param( + [String]$kindId + ) + switch ($kindId) { + 'basic' { + [RemoteBasic]::new() + } + 'banana' { + [RemoteBanana]::new() + } + 'potato' { + [RemotePotato]::new() + } + default { + throw [VMRemoteError]::new("Unknown Voicemeeter kind `"$kindId`"") + } + } +} + Function Get-RemoteBasic { [RemoteBasic]::new().Login() }