-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstructs.go
More file actions
84 lines (80 loc) · 2.98 KB
/
structs.go
File metadata and controls
84 lines (80 loc) · 2.98 KB
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
package main
import (
"encoding/xml"
)
// StateXML represents the structure of the BluOS /Status response XML
type StateXML struct {
Text string `xml:",chardata"`
Etag string `xml:"etag,attr"`
Actions struct {
Text string `xml:",chardata"`
Action []struct {
Text string `xml:",chardata"`
Name string `xml:"name,attr"`
URL string `xml:"url,attr"`
Icon string `xml:"icon,attr"`
State string `xml:"state,attr"`
AttrText string `xml:"text,attr"`
Type string `xml:"type,attr"`
} `xml:"action"`
} `xml:"actions,omitempty"`
Album string `xml:"album,omitempty"`
Artist string `xml:"artist,omitempty"`
CanMovePlayback string `xml:"canMovePlayback"`
CanSeek string `xml:"canSeek"`
CurrentImage string `xml:"currentImage"`
Cursor string `xml:"cursor"`
Db string `xml:"db"`
Image string `xml:"image"`
Indexing string `xml:"indexing"`
Mid string `xml:"mid"`
Mode string `xml:"mode"`
Mute string `xml:"mute"`
Name string `xml:"name,omitempty"`
Pid string `xml:"pid"`
PresetID string `xml:"preset_id"`
Prid string `xml:"prid"`
Quality string `xml:"quality"`
Repeat string `xml:"repeat"`
Service string `xml:"service"`
ServiceIcon string `xml:"serviceIcon"`
ServiceName string `xml:"serviceName"`
Shuffle string `xml:"shuffle"`
Sid string `xml:"sid"`
Sleep string `xml:"sleep"`
Song string `xml:"song"`
State string `xml:"state"`
StreamFormat string `xml:"streamFormat"`
StreamUrl string `xml:"streamUrl"`
SyncStat string `xml:"syncStat"`
Title1 string `xml:"title1"`
Title2 string `xml:"title2"`
Title3 string `xml:"title3"`
Totlen string `xml:"totlen,omitempty"`
Volume string `xml:"volume"`
Secs string `xml:"secs"`
}
// Presets represents the structure of the BluOS /Presets response XML
type Presets struct {
XMLName xml.Name `xml:"presets"`
Text string `xml:",chardata"`
Prid string `xml:"prid,attr"`
Preset []struct {
Text string `xml:",chardata"`
URL string `xml:"url,attr"`
ID string `xml:"id,attr"`
Name string `xml:"name,attr"`
Image string `xml:"image,attr"`
} `xml:"preset"`
}
// VolumeStatus represents the structure of the BluOS /Volume response XML
type VolumeStatus struct {
XMLName xml.Name `xml:"volume"`
Db float64 `xml:"db,attr"` // Volume level in dB
Mute int `xml:"mute,attr"` // 1 if muted, 0 if not
MuteDb *float64 `xml:"muteDb,attr"` // Volume level in dB before mute
MuteVolume *int `xml:"muteVolume,attr"` // Volume level before mute
OffsetDb float64 `xml:"offsetDb,attr"` // Volume offset in dB
Etag string `xml:"etag,attr"` // Entity tag for caching
Level int `xml:",chardata"` // Current volume level (0-100)
}