mirror of
https://github.com/onyx-and-iris/voicemeeter-api-powershell.git
synced 2026-04-18 05:23:32 +00:00
decouple device
- basic A2 device supported - asio only added to bus[0].device
This commit is contained in:
72
lib/bus.ps1
72
lib/bus.ps1
@@ -101,75 +101,13 @@ class PhysicalBus : Bus {
|
||||
}
|
||||
}
|
||||
|
||||
class BusDevice : IRemote {
|
||||
BusDevice ([int]$index, [Object]$remote) : base ($index, $remote) {
|
||||
}
|
||||
|
||||
[string] identifier () {
|
||||
return 'Bus[' + $this.index + '].Device'
|
||||
}
|
||||
|
||||
hidden $_name = $($this | Add-Member ScriptProperty 'name' `
|
||||
{
|
||||
$this.Getter_String('name')
|
||||
} `
|
||||
{
|
||||
return Write-Warning ("ERROR: $($this.identifier()).name is read only")
|
||||
}
|
||||
)
|
||||
|
||||
hidden $_sr = $($this | Add-Member ScriptProperty 'sr' `
|
||||
{
|
||||
$this.Getter('sr')
|
||||
} `
|
||||
{
|
||||
return Write-Warning ("ERROR: $($this.identifier()).sr is read only")
|
||||
}
|
||||
)
|
||||
|
||||
hidden $_wdm = $($this | Add-Member ScriptProperty 'wdm' `
|
||||
{
|
||||
return Write-Warning ("ERROR: $($this.identifier()).wdm is write only")
|
||||
} `
|
||||
{
|
||||
param($arg)
|
||||
return $this.Setter('wdm', $arg)
|
||||
}
|
||||
)
|
||||
|
||||
hidden $_ks = $($this | Add-Member ScriptProperty 'ks' `
|
||||
{
|
||||
return Write-Warning ("ERROR: $($this.identifier()).ks is write only")
|
||||
} `
|
||||
{
|
||||
param($arg)
|
||||
return $this.Setter('ks', $arg)
|
||||
}
|
||||
)
|
||||
|
||||
hidden $_mme = $($this | Add-Member ScriptProperty 'mme' `
|
||||
{
|
||||
return Write-Warning ("ERROR: $($this.identifier()).mme is write only")
|
||||
} `
|
||||
{
|
||||
param($arg)
|
||||
return $this.Setter('mme', $arg)
|
||||
}
|
||||
)
|
||||
|
||||
hidden $_asio = $($this | Add-Member ScriptProperty 'asio' `
|
||||
{
|
||||
return Write-Warning ("ERROR: $($this.identifier()).asio is write only")
|
||||
} `
|
||||
{
|
||||
param($arg)
|
||||
return $this.Setter('asio', $arg)
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
class VirtualBus : Bus {
|
||||
[Object]$device
|
||||
|
||||
VirtualBus ([int]$index, [Object]$remote) : base ($index, $remote) {
|
||||
if ($this.remote.kind.name -eq 'basic') {
|
||||
$this.device = [BusDevice]::new($index, $remote)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user