Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Updates

  • Loading branch information...
commit c02dbfc998d6ea7bdef9b340032608a47c9d42c4 1 parent 40842b7
root authored
Showing with 49 additions and 8 deletions.
  1. +39 −1 broadcast.php
  2. +3 −2 config.php
  3. +7 −5 functions.php
View
40 broadcast.php
@@ -105,7 +105,7 @@
$bump = $image['category'].'.png';
if (file_exists(USER_IMAGEDIR.'/'.$bump)) {
exec('rsync '.USER_IMAGEDIR.'/'.$bump.' '.BROADCASTCACHEDIR.'/'.$bump);
- fputs($fp, ' <img src="'.REMOTEDIR.'/cache/'.$bump.'" alt="'.htmlspecialchars('Bump - '.$image['category'], ENT_QUOTES, 'UTF-8').'" dur="'.BUMPDURATION.'" region="content" fill="remove" erase="whenDone" />'.chr(13).chr(10));
+ fputs($fp, ' <img src="'.REMOTEDIR.'/cache/'.$bump.'" alt="'.htmlspecialchars('Bump - '.$image['category'], ENT_QUOTES, 'UTF-8').'" dur="'.BUMPDURATION.'s" region="content" fill="remove" erase="whenDone" />'.chr(13).chr(10));
}
}
@@ -122,10 +122,48 @@
fflush($fp);
fclose($fp);
+ $fp = fopen($tmpdirectory.'/index.html', 'w');
+ fputs($fp, '<?xml version="1.0" encoding="UTF-8"?>'.$rn.
+ '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">'.$rn.
+ '<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" >'.$rn.
+ ' <head>'.$rn.
+ ' <title>PlusRTV</title>'.$rn.
+ ' <script type="text/javascript" src="smil.js"></script>'.$rn.
+ ' <link rel="stylesheet" href="index.css" type="text/css" />'.$rn.
+ ' </head>'.$rn.
+ ' <body onLoad="start();">'.$rn);
+ foreach ($out as $image) {
+ if (EMERGENCY) {
+ if ($image['template'] == 'NOOD.xsl') {
+ fputs($fp, ' <img src="'.$image['src'].'" alt="'.htmlspecialchars($image['title'], ENT_QUOTES, 'UTF-8').'" dur="'.$image['dur'].'s" />'.chr(13).chr(10));
+ }
+ } else {
+ if (defined('BUMPDURATION') && $current_cat != $image['category']) {
+ $current_cat = $image['category'];
+ $bump = $image['category'].'.png';
+ if (file_exists(USER_IMAGEDIR.'/'.$bump)) {
+ exec('rsync '.USER_IMAGEDIR.'/'.$bump.' '.BROADCASTCACHEDIR.'/'.$bump);
+ fputs($fp, ' <img src="'.REMOTEDIR.'/cache/'.$bump.'" alt="'.htmlspecialchars('Bump - '.$image['category'], ENT_QUOTES, 'UTF-8').'" dur="'.BUMPDURATION.'s" />'.chr(13).chr(10));
+ }
+ }
+ if ($image['template'] != 'video.xsl') {
+ fputs($fp, ' <img src="'.$image['src'].'" alt="'.htmlspecialchars($image['title'], ENT_QUOTES, 'UTF-8').'" dur="'.$image['dur'].'s" region="content" fill="remove" erase="whenDone" />'.chr(13).chr(10));
+ } else {
+// fputs($fp, ' <video src="'.htmlspecialchars($image['title'], ENT_QUOTES, 'UTF-8').'" alt="Intermezzo" dur="'.$image['dur'].'s" region="content" fill="remove" erase="whenDone" />'.chr(13).chr(10));
+ }
+ }
+ }
+
+ fputs($fp, ' </body>'.$rn.
+ '</html>'.$rn);
+ fflush($fp);
+ fclose($fp);
+
if (!file_exists($tmpdirectory)) {
exec('mkdir '.$tmpdirectory);
}
exec('mv -u '.$tmpdirectory.'/*.smil '.BROADCASTDIR.'/.');
+ exec('mv -u '.$tmpdirectory.'/*.html '.BROADCASTDIR.'/.');
// exec('mv -u '.$tmpdirectory.'/*.png '.BROADCASTCACHEDIR.'/.');
exec('ln -sf /home/tv/broadcast/'.date('Y-m-d', $now).'.smil /home/tv/broadcast.smil');
View
5 config.php
@@ -9,9 +9,10 @@
define ('CACHEDIR', ABSOLUTEDIR.'/broadcast/cache');
define ('DATABASE', ABSOLUTEDIR.'/database/'.strtolower(OWNER).'-olifant.db');
define ('THEMESEQ', TRUE);
- define ('BUMPDURATION', '10s');
+ define ('BUMPDURATION', 10);
+ define ('DURATION', 23);
define ('REMOTEHOST', '127.0.0.1');
- define ('REMOTEDIR', '/home/tv/broadcast');
+ define ('REMOTEDIR', 'broadcast');
define ('RESOLUTIONW', '1024');
define ('RESOLUTIONH', '768');
define ('EMERGENCY', false);
View
12 functions.php
@@ -168,7 +168,7 @@ function newrun() {
function newpreview() {
unset($_SESSION['document'][0]);
- $_SESSION['document'][0]['text_duration']=20;
+ $_SESSION['document'][0]['text_duration']=DURATION;
$_SESSION['document']['activeid']=0;
}
@@ -219,9 +219,9 @@ function checkandbroadcast($safebox=0, $width=RESOLUTIONW, $height=RESOLUTIONH,
function checkandpreview($safebox=0, $width=RESOLUTIONW, $height=RESOLUTIONH, $format='png', $title, $para, $photo, $template, $dir='', $filename='', $cat_title='', $cat_photo='', $cat_width=0, $cat_height=0, $cat_x=0, $cat_y=0) {
$filename = ($filename!=''?$filename:md5($title.$para.$photo.$template.$category));
$dir = ($dir!=''?$dir:PREVIEWDIR);
- $pngfile = $dir.'/'.$filename.'.png';
+ $file = $dir.'/'.$filename.$format;
- if (!file_exists($pngfile)) {
+ if (!file_exists($file)) {
$category_xml = '<category><title>'.strtoupper($cat_title).'</title><img><src>'.($cat_photo!=''?USER_IMAGEDIR.'/'.$cat_photo:'').'</src>'.
'<width>'.$cat_width.'</width>'.
'<height>'.$cat_height.'</height>'.
@@ -256,8 +256,10 @@ function checkandpreview($safebox=0, $width=RESOLUTIONW, $height=RESOLUTIONH, $f
$xml = null;
- $debug = shell_exec('/usr/bin/inkscape -z --file='.$svgfile.' --export-width='.$width.' --export-height='.$height.' --export-png='.$pngfile.' 2>&1 1>/dev/null');
- // unlink($svgfile);
+ if ($format == 'png') {
+ $debug = shell_exec('/usr/bin/inkscape -z --file='.$svgfile.' --export-width='.$width.' --export-height='.$height.' --export-png='.$file.' 2>&1 1>/dev/null');
+ }
+ unlink($svgfile);
}
return $filename;
}
Please sign in to comment.
Something went wrong with that request. Please try again.