mirror of
https://github.com/onyx-and-iris/voicemeeter.git
synced 2024-11-22 04:40:53 +00:00
command type added
This commit is contained in:
parent
d2ee55b712
commit
69b0f3cdbf
42
voicemeeter/command.go
Normal file
42
voicemeeter/command.go
Normal 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)
|
||||
}
|
Loading…
Reference in New Issue
Block a user