-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathdevice.go
52 lines (44 loc) · 928 Bytes
/
device.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
package voicemeeter
import "fmt"
type devDesc struct {
Name, Type, Hwid string
}
type device struct {
}
func newDevice() *device {
return &device{}
}
// Ins returns the total number of physical input devices
func (d *device) Ins() int {
return int(getNumDevices("in"))
}
// Ins returns the total number of physical input devices
func (d *device) Outs() int {
return int(getNumDevices("out"))
}
func (d *device) Input(i int) devDesc {
n, t_, id, err := getDeviceDescription(i, "in")
if err != nil {
fmt.Println(err)
}
vals := map[uint64]string{
1: "mme",
3: "wdm",
4: "ks",
5: "asio",
}
return devDesc{Name: n, Type: vals[t_], Hwid: id}
}
func (d *device) Output(i int) devDesc {
n, t_, id, err := getDeviceDescription(i, "out")
if err != nil {
fmt.Println(err)
}
vals := map[uint64]string{
1: "mme",
3: "wdm",
4: "ks",
5: "asio",
}
return devDesc{Name: n, Type: vals[t_], Hwid: id}
}