-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstatus.php
154 lines (127 loc) · 3.22 KB
/
status.php
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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
<?php
class status {
private $volume;
private $repeat;
private $random;
private $single;
private $consume;
private $playlist;
private $playlistLength;
private $state;
private $song;
private $songID;
private $nextSong;
private $nextSongID;
private $time;
private $elapsed;
private $duration;
private $bitrate;
private $xfade;
private $mixRampDB;
private $mixRampDelay;
private $audio;
private $updatingDB;
private $error;
private function setValue($value) {
if (strcmp("", $value) == 0) return;
$key = explode(':', $value)[0];
$val = explode(' ', $value)[1];
switch ($key) {
case 'volume': $this->volume =$val; break;
case 'repeat': $this->repeat =$val; break;
case 'random': $this->random =$val; break;
case 'single': $this->single =$val; break;
case 'consume': $this->consume =$val; break;
case 'playlist': $this->playlist =$val; break;
case 'playlistlength': $this->playlistLength =$val; break;
case 'state': $this->state =$val; break;
case 'song': $this->song =$val; break;
case 'songid': $this->songID =$val; break;
case 'nextsong': $this->nextSong =$val; break;
case 'nextsongid': $this->nextSongID =$val; break;
case 'time': $this->time =$val; break;
case 'elapsed': $this->elapsed =$val; break;
case 'duration': $this->duration =$val; break;
case 'bitrate': $this->bitrate =$val; break;
case 'xfade': $this->xfade =$val; break;
case 'mixrampdb': $this->mixRampDB =$val; break;
case 'audio': $this->audio =$val; break;
case 'updatingdb': $this->updatingDB =$val; break;
case 'error': $this->error =$val; break;
default: break;
}
}
function __construct($statusString) {
$elements = explode(chr(10), $statusString);
foreach ($elements AS $value) {
$this->setValue($value);
}
}
function getVolume() {
return $this->volume;
}
function getRepeat() {
return $this->repeat;
}
function getRandom() {
return $this->random;
}
function getSingle() {
return $this->single;
}
function getConsume() {
return $this->consume;
}
function getPlaylist() {
return $this->playlist;
}
function getPlaylistLength() {
return $this->playlistLength;
}
function getState() {
return $this->state;
}
function getSong() {
return $this->song;
}
function getSongID() {
return $this->songID;
}
function getNextSong() {
return $this->nextSong;
}
function getNextSongID() {
return $this->nextSongID;
}
function getTime() {
return $this->time;
}
function getElapsed() {
return $this->elapsed;
}
function getDuration() {
return $this->duration;
}
function getBitrate() {
return $this->bitrate;
}
function getXfade() {
return $this->xfade;
}
function getMixRampDB() {
return $this->mixRampDB;
}
function getMixRampDelay() {
return $this->mixRampDelay;
}
function getAudio() {
return $this->audio;
}
function getUpdatingDB() {
return $this->updatingDB;
}
function getError() {
return $this->error;
}
}
?>