mirror of
https://github.com/onyx-and-iris/voicemeeter-api-powershell.git
synced 2026-04-18 05:23:32 +00:00
Initial commit
Initial commit Added readme
This commit is contained in:
67
lib/bus.ps1
Normal file
67
lib/bus.ps1
Normal file
@@ -0,0 +1,67 @@
|
||||
class Bus {
|
||||
[int32]$id
|
||||
|
||||
# Constructor
|
||||
Bus ([Int]$id)
|
||||
{
|
||||
$this.id = $id
|
||||
}
|
||||
|
||||
[void] Setter($cmd, $set) {
|
||||
Param_Set -PARAM $cmd -VALUE $set
|
||||
}
|
||||
|
||||
[int] Getter($cmd) {
|
||||
return Param_Get -PARAM $cmd
|
||||
}
|
||||
|
||||
[string] cmd ($arg) {
|
||||
return "Bus[" + $this.id + "].$arg"
|
||||
}
|
||||
|
||||
hidden $_mono = $($this | Add-Member ScriptProperty 'mono' `
|
||||
{
|
||||
# get
|
||||
$this.Getter($this.cmd('Mono'))
|
||||
}`
|
||||
{
|
||||
# set
|
||||
param ( [Single]$arg )
|
||||
$this._mono = $this.Setter($this.cmd('Mono'), $arg)
|
||||
}
|
||||
)
|
||||
|
||||
hidden $_mute = $($this | Add-Member ScriptProperty 'mute' `
|
||||
{
|
||||
# get
|
||||
$this.Getter($this.cmd('Mute'))
|
||||
}`
|
||||
{
|
||||
# set
|
||||
param ( [Single]$arg )
|
||||
$this._mute = $this.Setter($this.cmd('Mute'), $arg)
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
Function Buses {
|
||||
[System.Collections.ArrayList]$bus = @()
|
||||
0..$($layout.Bus-1) | ForEach-Object {
|
||||
[void]$bus.Add([Bus]::new($_))
|
||||
}
|
||||
$bus
|
||||
}
|
||||
|
||||
if ($MyInvocation.InvocationName -ne '.')
|
||||
{
|
||||
Login
|
||||
|
||||
$bus = Buses
|
||||
|
||||
$bus[0].mono = 1
|
||||
$bus[0].mono
|
||||
$bus[0].mono = 0
|
||||
$bus[0].mono
|
||||
|
||||
Logout
|
||||
}
|
||||
Reference in New Issue
Block a user