2022-06-25 23:12:02 +01:00
|
|
|
. $PSScriptRoot\kinds.ps1
|
2021-04-28 17:38:36 +01:00
|
|
|
. $PSScriptRoot\base.ps1
|
|
|
|
|
|
|
|
class Remote {
|
2022-06-25 23:12:02 +01:00
|
|
|
[Hashtable]$kind
|
2021-04-28 17:38:36 +01:00
|
|
|
[System.Collections.ArrayList]$strip
|
|
|
|
[System.Collections.ArrayList]$bus
|
2022-01-19 21:55:10 +00:00
|
|
|
[System.Collections.ArrayList]$button
|
2022-01-06 15:28:43 +00:00
|
|
|
[PSCustomObject]$vban
|
2022-01-24 20:01:12 +00:00
|
|
|
[Object]$command
|
2022-03-08 22:54:34 +00:00
|
|
|
[Object]$recorder
|
2022-01-24 20:01:12 +00:00
|
|
|
[Object]$profiles
|
2021-04-28 17:38:36 +01:00
|
|
|
|
|
|
|
# Constructor
|
2022-06-25 23:12:02 +01:00
|
|
|
Remote ([String]$kind_id) {
|
|
|
|
$this.kind = GetKind($kind_id)
|
2021-04-29 20:23:02 +01:00
|
|
|
$this.Setup()
|
2021-04-28 17:38:36 +01:00
|
|
|
}
|
|
|
|
|
2021-04-30 17:07:09 +01:00
|
|
|
[void] Setup() {
|
2022-10-27 21:20:03 +01:00
|
|
|
if (!(Setup_DLL)) {
|
|
|
|
Exit
|
2021-05-04 17:29:38 +01:00
|
|
|
}
|
2022-10-27 21:20:03 +01:00
|
|
|
Login -KIND $this.kind.name
|
|
|
|
$this.profiles = Get_Profiles($this.kind.name)
|
|
|
|
$this.strip = Make_Strips($this)
|
|
|
|
$this.bus = Make_Buses($this)
|
|
|
|
$this.button = Make_Buttons
|
|
|
|
$this.vban = Make_Vban($this)
|
|
|
|
$this.command = Make_Command
|
|
|
|
$this.recorder = Make_Recorder($this)
|
|
|
|
}
|
|
|
|
|
|
|
|
[string] ToString() {
|
|
|
|
return "Voicemeeter " + $this.kind.name.substring(0,1).toupper() + $this.kind.name.substring(1)
|
2021-04-28 17:38:36 +01:00
|
|
|
}
|
|
|
|
|
2021-04-30 17:07:09 +01:00
|
|
|
[void] Logout() {
|
2021-04-28 17:38:36 +01:00
|
|
|
Logout
|
|
|
|
}
|
2022-01-19 21:55:10 +00:00
|
|
|
|
2022-10-27 21:20:03 +01:00
|
|
|
[void] GetType() {
|
|
|
|
VmType
|
|
|
|
}
|
|
|
|
|
|
|
|
[String] GetVersion() {
|
|
|
|
return Version
|
|
|
|
}
|
|
|
|
|
2022-01-24 20:01:12 +00:00
|
|
|
[void] Set_Profile([String]$config) {
|
|
|
|
Set_Profile -DATA $this.profiles -CONF $config
|
|
|
|
}
|
|
|
|
|
2022-01-19 21:55:10 +00:00
|
|
|
[Single] Getter([String]$param) {
|
|
|
|
return Param_Get -PARAM $param
|
|
|
|
}
|
|
|
|
|
|
|
|
[String] Getter_String([String]$param) {
|
|
|
|
return Param_Get -PARAM $param -IS_STRING $true
|
|
|
|
}
|
|
|
|
|
|
|
|
[void] Setter([String]$param, [Object]$value) {
|
|
|
|
Param_Set -PARAM $param -VALUE $value
|
|
|
|
}
|
2021-04-30 17:07:09 +01:00
|
|
|
|
2021-04-30 16:47:15 +01:00
|
|
|
[void] Set_Multi([HashTable]$hash) {
|
|
|
|
Param_Set_Multi -HASH $hash
|
|
|
|
}
|
2022-01-19 21:55:10 +00:00
|
|
|
|
2022-10-27 21:20:03 +01:00
|
|
|
[void] SendText([String]$script) {
|
|
|
|
Set_By_Script -SCRIPT $script
|
|
|
|
}
|
|
|
|
|
2022-01-19 21:55:10 +00:00
|
|
|
[void] PDirty() { P_Dirty }
|
|
|
|
|
|
|
|
[void] MDirty() { M_Dirty }
|
2021-04-28 17:38:36 +01:00
|
|
|
}
|
2021-04-30 17:07:09 +01:00
|
|
|
|
|
|
|
Function Get-RemoteBasic {
|
|
|
|
return [Remote]::new('basic')
|
|
|
|
}
|
|
|
|
|
|
|
|
Function Get-RemoteBanana {
|
|
|
|
return [Remote]::new('banana')
|
|
|
|
}
|
|
|
|
|
|
|
|
Function Get-RemotePotato {
|
|
|
|
return [Remote]::new('potato')
|
|
|
|
}
|
|
|
|
|
|
|
|
Export-ModuleMember -Function Get-RemoteBasic, Get-RemoteBanana, Get-RemotePotato
|