-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathssComnPR.php
More file actions
87 lines (80 loc) · 2.94 KB
/
ssComnPR.php
File metadata and controls
87 lines (80 loc) · 2.94 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
85
86
87
<!--
ssCommon.php
part of Quinn Ebert's "Pioneer Rebel" software project
PURPOSE:
Common server-side code utilities used by the various
interfaces in the PioneerRebel Project.
-->
<?php
/*
CONFIGURATION:
Set the IP or hostname of your VSX-102x-K below, indicate if you want the
alert to successful command send dialog to appear, and enjoy!
*/
// Network address where your VSX-102x-K can be reached:
if ( ! isset($pioneer) ) $pioneer = '192.168.1.17';
// ^ Let $pioneer be overridden by external apps (like Zedom8or/"Z8"):
if (isset($_GET['pioneer'])) $pioneer = $_GET['pioneer'];
// Set this to indicate if you want an alert message to show up confirming
// the command was sent to the VSX-1022-K unit:
//
// POSSIBLE SETTINGS:
// true : confirmation alert will display
// false : confirmation alert won't display
$confirm = true;
// Bring in the new, manageable common server-side functions lib:
require_once dirname(__FILE__).'/genFuncs.php';
if (isset($_GET['z8cmd'])&&isset($_GET['z8dev'])) {
header('Content-Type: text/xml');
die(z8_exec_devctl_cmd($_GET['z8dev'],$_GET['z8cmd']));
}
/*
** Everything below here is considered outdated but it all still works (for now anyways...)
*/
// Handling code for Ajax button requests:
if (isset($_GET['volDn'])) {
require_once(dirname(__FILE__).'/PioneerRebel/pioneer.lib.php');
header('Content-Type: text/xml');
pvRebel_setVolDec($pioneer);
die("<pioneer_rebel>\n <status>OK</status>\n</pioneer_rebel>\n");
}
if (isset($_GET['volUp'])) {
require_once(dirname(__FILE__).'/PioneerRebel/pioneer.lib.php');
header('Content-Type: text/xml');
pvRebel_setVolInc($pioneer);
die("<pioneer_rebel>\n <status>OK</status>\n</pioneer_rebel>\n");
}
if (isset($_GET['volLv'])) {
require_once(dirname(__FILE__).'/PioneerRebel/pioneer.lib.php');
header('Content-Type: text/xml');
pvRebel_setVolSet($pioneer,intval($_GET['Lv']));
die("<pioneer_rebel>\n <status>OK</status>\n</pioneer_rebel>\n");
}
if (isset($_GET['input'])) {
require_once(dirname(__FILE__).'/PioneerRebel/pioneer.lib.php');
header('Content-Type: text/xml');
pvRebel_setSource($pioneer,$_GET['input']);
die("<pioneer_rebel>\n <status>OK</status>\n</pioneer_rebel>\n");
}
if (isset($_GET['power'])) {
/*...*/
//FIXME: for Quinn mainly...
ob_start();
system("irsend SEND_START 'vsdlpprj' 'KEY_POWER'");
// The PJD7820HD seems to do best with a .25 second powerkey pulse from LIRC
usleep(250000);
system("irsend SEND_STOP 'vsdlpprj' 'KEY_POWER'");
ob_end_clean();
/*...*/
require_once(dirname(__FILE__).'/PioneerRebel/pioneer.lib.php');
header('Content-Type: text/xml');
pvRebel_setPower($pioneer,intval($_GET['power']));
die("<pioneer_rebel>\n <status>OK</status>\n</pioneer_rebel>\n");
}
if (isset($_GET['muted'])) {
require_once(dirname(__FILE__).'/PioneerRebel/pioneer.lib.php');
header('Content-Type: text/xml');
pvRebel_setMuting($pioneer,intval($_GET['muted']));
die("<pioneer_rebel>\n <status>OK</status>\n</pioneer_rebel>\n");
}
?>