public function getShows() { $last_show = count($this->shows); for ($current_show = 0; $current_show < $last_show; $current_show++) { $scheduled_show_duration = 0; $next_show = $current_show + 1; // possibly doesnt exist, then get the first show for the next "day" if (!isset($this->shows[$next_show])) { $next_show = 0; } $scheduled_show_duration = $this->shows[$next_show]->get_begin() - $this->shows[$current_show]->get_begin(); if ($current_show == $last_show - 1) { // fill day (first item + whole day to see how much time it is) $scheduled_show_duration = $this->shows[0]->get_begin() + 2400 - $this->shows[$current_show]->get_begin(); print "time for last show is " . $scheduled_show_duration . " seconds till next day.\n\n"; } $time = new simpletime(0, $scheduled_show_duration); $this->shows[$current_show]->set_scheduled_duration($time->getSeconds()); } return $this->shows; }
public function createAnnouncement($length = 1, $show) { global $path; $this->determineAnnouncementContent($show); // debug! global $config; // discusting a global... if (!$config["createAnnouncements"]) { return "AnnouncementsDisabledDueToDebugging.avi"; } $this->movieLength = $length; $this->totalFrames = $this->movieLength * $this->framesPerSecond; $simpletime = new simpletime(); $simpletime->loadDayPosition(); $this->tmpRenderDumpDir = $path['announcements'] . "dump/" . $simpletime->getTime() . "/"; mkdir($this->tmpRenderDumpDir); print "Creating announcements for " . $this->showsToDisplay[0]->get_name() . " at " . $this->showsToDisplay[0]->get_begin() . " hour.\n"; print "Announcements will last " . $this->movieLength . " seconds and contains " . $this->movieLength * $this->framesPerSecond . " frames. \n"; print "Rendering frames can take a while... \n"; // animate $this->createFrames(); // save and return. return $this->renderFramesToMovie(); }