Bin ich am richtigen Weg ?
PHP-Code:
###[LBS]###
<?php
function LB_LBSID($id) {
if ($E[2]['refresh']==1) {
setLogicElementVar($id,2,1); // PLAY
setLogicElementVar($id,3,0); // PAUSE
setLogicElementVar($id,4,0); // STOP
}
if ($E[3]['refresh']==1) {
setLogicElementVar($id,2,0); // PLAY
setLogicElementVar($id,3,1); // PAUSE
setLogicElementVar($id,4,0); // STOP
}
if ($E[4]['refresh']==1) {
setLogicElementVar($id,2,0); // PLAY
setLogicElementVar($id,3,0); // PAUSE
setLogicElementVar($id,4,1); // STOP
}
if (getLogicElementVar($id,1)!=1) {
setLogicElementVar($id,1,1);
callLogicFunctionExec(LBSID,$id);
}
}
?>
###[/LBS]###
PHP-Code:
// ---- HTTP-Requests | kein UDP-Paket empfangen | http SENDEN:
if ($E=getLogicEingangDataAll($id)) {
$url = "http://".$E[34]['value']."/%7E".$E[33]['value']."/iControl.php?c=";
// ---- HTTP-Requests | iTunes | Steuerung:
if (getLogicElementVar($id,2) == 1) {
if ($E[8]['value'] == 1) {
$ctx=stream_context_create(array('http' => array('timeout' => 3 )));
$r=file_get_contents($url.'play&p1=fadein&p2='.$E[9]['value'],0,$ctx);
writeToTraceLog(0,true,'iTunes E02 URL :'.$url.'play&p1='.$E[8]['value'].'&p2='.$E[9]['value'].' / ctx '.$ctx);
} else {
$ctx=stream_context_create(array('http' => array('timeout' => 3 )));
$r=file_get_contents($url.'play',0,$ctx);
writeToTraceLog(0,true,'iTunes E02 URL :'.$url.'play' / ctx '.$ctx);
}
}
}
Kommentar