CC-2301 : dos2unix being run
This commit is contained in:
parent
3e320f1e2e
commit
435bb83588
3 changed files with 86 additions and 86 deletions
|
@ -262,8 +262,8 @@ class Application_Model_Scheduler
|
|||
$cueout = Application_Common_DateHelper::calculateLengthInSeconds($data["cueout"]);
|
||||
$data["cliplength"] = Application_Common_DateHelper::secondsToPlaylistTime($cueout - $cuein);
|
||||
|
||||
//fade is in format SS.uuuuuu
|
||||
$data["fadein"] = Application_Model_Preference::GetDefaultFadeIn();
|
||||
//fade is in format SS.uuuuuu
|
||||
$data["fadein"] = Application_Model_Preference::GetDefaultFadeIn();
|
||||
$data["fadeout"] = Application_Model_Preference::GetDefaultFadeOut();
|
||||
|
||||
$data["type"] = 0;
|
||||
|
@ -333,29 +333,29 @@ class Application_Model_Scheduler
|
|||
return $files;
|
||||
}
|
||||
|
||||
/*
|
||||
* @param DateTime startDT in UTC
|
||||
* @param string duration
|
||||
* in format H:i:s.u (could be more that 24 hours)
|
||||
*
|
||||
* @return DateTime endDT in UTC
|
||||
*/
|
||||
private function findTimeDifference($p_startDT, $p_seconds)
|
||||
{
|
||||
$startEpoch = $p_startDT->format("U.u");
|
||||
|
||||
//add two float numbers to 6 subsecond precision
|
||||
//DateTime::createFromFormat("U.u") will have a problem if there is no decimal in the resulting number.
|
||||
$newEpoch = bcsub($startEpoch , (string) $p_seconds, 6);
|
||||
|
||||
$dt = DateTime::createFromFormat("U.u", $newEpoch, new DateTimeZone("UTC"));
|
||||
|
||||
if ($dt === false) {
|
||||
//PHP 5.3.2 problem
|
||||
$dt = DateTime::createFromFormat("U", intval($newEpoch), new DateTimeZone("UTC"));
|
||||
}
|
||||
|
||||
return $dt;
|
||||
/*
|
||||
* @param DateTime startDT in UTC
|
||||
* @param string duration
|
||||
* in format H:i:s.u (could be more that 24 hours)
|
||||
*
|
||||
* @return DateTime endDT in UTC
|
||||
*/
|
||||
private function findTimeDifference($p_startDT, $p_seconds)
|
||||
{
|
||||
$startEpoch = $p_startDT->format("U.u");
|
||||
|
||||
//add two float numbers to 6 subsecond precision
|
||||
//DateTime::createFromFormat("U.u") will have a problem if there is no decimal in the resulting number.
|
||||
$newEpoch = bcsub($startEpoch , (string) $p_seconds, 6);
|
||||
|
||||
$dt = DateTime::createFromFormat("U.u", $newEpoch, new DateTimeZone("UTC"));
|
||||
|
||||
if ($dt === false) {
|
||||
//PHP 5.3.2 problem
|
||||
$dt = DateTime::createFromFormat("U", intval($newEpoch), new DateTimeZone("UTC"));
|
||||
}
|
||||
|
||||
return $dt;
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -415,41 +415,41 @@ class Application_Model_Scheduler
|
|||
return $nextDT;
|
||||
}
|
||||
|
||||
/*
|
||||
* @param int $showInstance
|
||||
/*
|
||||
* @param int $showInstance
|
||||
* This function recalculates the start/end times of items in a gapless show to
|
||||
* account for crossfade durations.
|
||||
*/
|
||||
private function calculateCrossfades($showInstance)
|
||||
{
|
||||
Logging::info("adjusting start, end times of scheduled items to account for crossfades show instance #".$showInstance);
|
||||
|
||||
$instance = CcShowInstancesQuery::create()->findPK($showInstance, $this->con);
|
||||
if (is_null($instance)) {
|
||||
throw new OutDatedScheduleException(_("The schedule you're viewing is out of date!"));
|
||||
}
|
||||
|
||||
* account for crossfade durations.
|
||||
*/
|
||||
private function calculateCrossfades($showInstance)
|
||||
{
|
||||
Logging::info("adjusting start, end times of scheduled items to account for crossfades show instance #".$showInstance);
|
||||
|
||||
$instance = CcShowInstancesQuery::create()->findPK($showInstance, $this->con);
|
||||
if (is_null($instance)) {
|
||||
throw new OutDatedScheduleException(_("The schedule you're viewing is out of date!"));
|
||||
}
|
||||
|
||||
$itemStartDT = $instance->getDbStarts(null);
|
||||
$itemEndDT = null;
|
||||
|
||||
$schedule = CcScheduleQuery::create()
|
||||
->filterByDbInstanceId($showInstance)
|
||||
->orderByDbStarts()
|
||||
->find($this->con);
|
||||
|
||||
foreach ($schedule as $item) {
|
||||
$itemEndDT = null;
|
||||
|
||||
$schedule = CcScheduleQuery::create()
|
||||
->filterByDbInstanceId($showInstance)
|
||||
->orderByDbStarts()
|
||||
->find($this->con);
|
||||
|
||||
foreach ($schedule as $item) {
|
||||
|
||||
$itemEndDT = $item->getDbEnds(null);
|
||||
|
||||
|
||||
$item
|
||||
->setDbStarts($itemStartDT)
|
||||
->setDbEnds($itemEndDT);
|
||||
|
||||
->setDbStarts($itemStartDT)
|
||||
->setDbEnds($itemEndDT);
|
||||
|
||||
$itemStartDT = $this->findTimeDifference($itemEndDT, $this->crossfadeDuration);
|
||||
$itemEndDT = $this->findEndTime($itemStartDT, $item->getDbClipLength());
|
||||
}
|
||||
|
||||
$schedule->save($this->con);
|
||||
$itemEndDT = $this->findEndTime($itemStartDT, $item->getDbClipLength());
|
||||
}
|
||||
|
||||
$schedule->save($this->con);
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue