-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathchannel.go
86 lines (75 loc) · 1.8 KB
/
channel.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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
package pixoo64
import "strconv"
type Channel struct {
client *Client
}
func (c *Channel) ActivateVisualizer(eqPosition int) error {
var jsonData = []byte(` {
"Command":"Channel/SetEqPosition",
"EqPosition": ` + strconv.FormatInt(int64(eqPosition), 10) + `
}`)
_, err := c.client.Post(jsonData)
if err != nil {
return err
}
return nil
}
type CloudIndex int
const (
RecommendCloudIndex CloudIndex = 0
FavouriteCloudIndex CloudIndex = 1
SubscribeArtistCloudIndex CloudIndex = 2
AlbumCloudIndex CloudIndex = 3
)
func (c *Channel) ActivateCloudIndex(index CloudIndex) error {
var jsonData = []byte(` {
"Command":"Channel/CloudIndex",
"Index": ` + strconv.FormatInt(int64(index), 10) + `
}`)
_, err := c.client.Post(jsonData)
if err != nil {
return err
}
return nil
}
func (c *Channel) ActivateCustomPage(index int) error {
var jsonData = []byte(` {
"Command":"Channel/SetCustomPageIndex",
"CustomPageIndex": ` + strconv.FormatInt(int64(index), 10) + `
}`)
_, err := c.client.Post(jsonData)
if err != nil {
return err
}
return nil
}
type Index int
const (
FacesIndex Index = 0
CloudChannelIndex Index = 1
VisualizerIndex Index = 2
CustomIndex Index = 3
BlackScreenIndex Index = 4
)
func (c *Channel) ActivateSetIndex(index Index) error {
var jsonData = []byte(` {
"Command":"Channel/SetIndex",
"SelectIndex": ` + strconv.FormatInt(int64(index), 10) + `
}`)
_, err := c.client.Post(jsonData)
if err != nil {
return err
}
return nil
}
func (c *Channel) SetClock(id int) error {
var jsonData = []byte(` {
"Command":"Channel/SetClockSelectId",
"ClockId": ` + strconv.FormatInt(int64(id), 10) + `
}`)
_, err := c.client.Post(jsonData)
if err != nil {
return err
}
return nil
}