command type added

This commit is contained in:
onyx-and-iris 2022-06-23 14:05:49 +01:00
parent d2ee55b712
commit 69b0f3cdbf

42
voicemeeter/command.go Normal file
View File

@ -0,0 +1,42 @@
package voicemeeter
import "fmt"
type command struct {
identifier string
}
func newCommand() *command {
return &command{"command"}
}
func (c *command) setter(p string, v float32) {
param := fmt.Sprintf("%s.%s", c.identifier, p)
setParameterFloat(param, v)
}
func (c *command) Show() {
c.setter("Show", 1)
}
func (c *command) Hide() {
c.setter("Show", 0)
}
func (c *command) Shutdown() {
c.setter("Shutdown", 1)
}
func (c *command) Restart() {
c.setter("Restart", 1)
}
func (c *command) Lock(val bool) {
var value float32
if val {
value = 1
} else {
value = 0
}
c.setter("Lock", value)
}