1 var alpmp3_playtime
= 0;
12 function alpmp3_ajax_new_data(){
13 obj_bass
.firstChild
.nodeValue
= MP3Object
.alpmp3
.bass
;
14 obj_volume
.firstChild
.nodeValue
= MP3Object
.alpmp3
.volume
;
15 obj_state
.firstChild
.nodeValue
= MP3Object
.alpmp3
.type
;
16 obj_filename
.firstChild
.nodeValue
= MP3Object
.alpmp3
.filename
;
17 alpmp3_state
= MP3Object
.alpmp3
.state
;
18 if(Math
.abs(alpmp3_playtime
- MP3Object
.alpmp3
.playtime
) > 1){
19 alpmp3_playtime
= MP3Object
.alpmp3
.playtime
;
23 function alpmp3_update_data(url
){
25 var http_request
= new XMLHttpRequest();
26 http_request
.open("GET", url
, true);
27 http_request
.onreadystatechange = function () {
28 if (http_request
.readyState
== 4) {
29 if (http_request
.status
== 200) {
30 MP3Object
= eval("(" + http_request
.responseText
+ ")");
31 alpmp3_ajax_new_data();
33 alert("There was a problem with the URL.");
38 http_request
.send(null);
39 self
.setTimeout("alpmp3_update_data('mp3_json.cgi');", 4000);
42 function alpmp3_remote(cmd
){
46 if(MP3Object
.alpmp3
.volume
< 30){
47 MP3Object
.alpmp3
.volume
++;
49 doit
= "?vol=" + MP3Object
.alpmp3
.volume
;
52 if(MP3Object
.alpmp3
.volume
> 0){
53 MP3Object
.alpmp3
.volume
--;
55 doit
= "?vol=" + MP3Object
.alpmp3
.volume
;
58 if(MP3Object
.alpmp3
.bass
< 30){
59 MP3Object
.alpmp3
.bass
++;
61 doit
= "?bass=" + MP3Object
.alpmp3
.bass
;
64 if(MP3Object
.alpmp3
.volume
< 30){
65 MP3Object
.alpmp3
.bass
--;
67 doit
= "?bass=" + MP3Object
.alpmp3
.bass
;
83 var http_request2
= new XMLHttpRequest();
84 http_request2
.open("GET", 'mp3_cmd.cgi'+doit
, true);
85 http_request2
.onreadystatechange = function () {
86 if (http_request2
.readyState
== 4) {
87 if (http_request2
.status
== 200) {
88 alpmp3_ajax_new_data();
90 alert("There was a problem with the URL.");
95 http_request2
.send(null);
100 function alpmp3_timeout(){
102 alert(alpmp3_playtime
);
105 function alpmp3_playtime_update(){
106 self
.setTimeout("alpmp3_playtime_update()", 1000);
107 if(alpmp3_state
> 0){
112 var s
= alpmp3_playtime
;
123 ptime
= ((m
< 10) ? "0" : "") + m
+ ":" + ((s
< 10) ? "0" : "") + s
;
125 ptime
= ((h
< 10) ? "0" : "") + h
+ ":" + ptime
;
127 obj_playtime
.firstChild
.nodeValue
= ptime
;
130 function alpmp3_setup($ip
){
132 obj_volume
= document
.getElementById("alpmp3_volume");
133 obj_bass
= document
.getElementById("alpmp3_bass");
134 obj_state
= document
.getElementById("alpmp3_state");
135 obj_filename
= document
.getElementById("alpmp3_filename");
136 obj_playtime
= document
.getElementById("alpmp3_playtime");
139 self
.setTimeout("alpmp3_update_data('mp3_json.cgi');", 4000);
140 self
.setTimeout("alpmp3_playtime_update()", 1000);
This page took 0.054385 seconds and 5 git commands to generate.