CC-2301 : dos2unix being run
This commit is contained in:
parent
3e320f1e2e
commit
435bb83588
3 changed files with 86 additions and 86 deletions
|
@ -27,23 +27,23 @@ class Application_Form_GeneralPreferences extends Zend_Form_SubForm
|
||||||
)
|
)
|
||||||
));
|
));
|
||||||
|
|
||||||
//Default station fade in
|
//Default station fade in
|
||||||
$this->addElement('text', 'stationDefaultCrossfadeDuration', array(
|
$this->addElement('text', 'stationDefaultCrossfadeDuration', array(
|
||||||
'class' => 'input_text',
|
'class' => 'input_text',
|
||||||
'label' => _('Default Crossfade Duration (s):'),
|
'label' => _('Default Crossfade Duration (s):'),
|
||||||
'required' => true,
|
'required' => true,
|
||||||
'filters' => array('StringTrim'),
|
'filters' => array('StringTrim'),
|
||||||
'validators' => array(
|
'validators' => array(
|
||||||
array(
|
array(
|
||||||
$rangeValidator,
|
$rangeValidator,
|
||||||
$notEmptyValidator,
|
$notEmptyValidator,
|
||||||
'regex', false, array('/^[0-9]{1,2}(\.\d{1})?$/', 'messages' => _('enter a time in seconds 0{.0}'))
|
'regex', false, array('/^[0-9]{1,2}(\.\d{1})?$/', 'messages' => _('enter a time in seconds 0{.0}'))
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
'value' => Application_Model_Preference::GetDefaultCrossfadeDuration(),
|
'value' => Application_Model_Preference::GetDefaultCrossfadeDuration(),
|
||||||
'decorators' => array(
|
'decorators' => array(
|
||||||
'ViewHelper'
|
'ViewHelper'
|
||||||
)
|
)
|
||||||
));
|
));
|
||||||
|
|
||||||
//Default station fade in
|
//Default station fade in
|
||||||
|
|
|
@ -195,21 +195,21 @@ class Application_Model_Preference
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function SetDefaultCrossfadeDuration($duration)
|
public static function SetDefaultCrossfadeDuration($duration)
|
||||||
{
|
{
|
||||||
self::setValue("default_crossfade_duration", $duration);
|
self::setValue("default_crossfade_duration", $duration);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function GetDefaultCrossfadeDuration()
|
public static function GetDefaultCrossfadeDuration()
|
||||||
{
|
{
|
||||||
$duration = self::getValue("default_crossfade_duration");
|
$duration = self::getValue("default_crossfade_duration");
|
||||||
|
|
||||||
if ($duration === "") {
|
if ($duration === "") {
|
||||||
// the default value of the fade is 00.5
|
// the default value of the fade is 00.5
|
||||||
return "0";
|
return "0";
|
||||||
}
|
}
|
||||||
|
|
||||||
return $duration;
|
return $duration;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function SetDefaultFadeIn($fade)
|
public static function SetDefaultFadeIn($fade)
|
||||||
|
|
|
@ -262,8 +262,8 @@ class Application_Model_Scheduler
|
||||||
$cueout = Application_Common_DateHelper::calculateLengthInSeconds($data["cueout"]);
|
$cueout = Application_Common_DateHelper::calculateLengthInSeconds($data["cueout"]);
|
||||||
$data["cliplength"] = Application_Common_DateHelper::secondsToPlaylistTime($cueout - $cuein);
|
$data["cliplength"] = Application_Common_DateHelper::secondsToPlaylistTime($cueout - $cuein);
|
||||||
|
|
||||||
//fade is in format SS.uuuuuu
|
//fade is in format SS.uuuuuu
|
||||||
$data["fadein"] = Application_Model_Preference::GetDefaultFadeIn();
|
$data["fadein"] = Application_Model_Preference::GetDefaultFadeIn();
|
||||||
$data["fadeout"] = Application_Model_Preference::GetDefaultFadeOut();
|
$data["fadeout"] = Application_Model_Preference::GetDefaultFadeOut();
|
||||||
|
|
||||||
$data["type"] = 0;
|
$data["type"] = 0;
|
||||||
|
@ -333,29 +333,29 @@ class Application_Model_Scheduler
|
||||||
return $files;
|
return $files;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* @param DateTime startDT in UTC
|
* @param DateTime startDT in UTC
|
||||||
* @param string duration
|
* @param string duration
|
||||||
* in format H:i:s.u (could be more that 24 hours)
|
* in format H:i:s.u (could be more that 24 hours)
|
||||||
*
|
*
|
||||||
* @return DateTime endDT in UTC
|
* @return DateTime endDT in UTC
|
||||||
*/
|
*/
|
||||||
private function findTimeDifference($p_startDT, $p_seconds)
|
private function findTimeDifference($p_startDT, $p_seconds)
|
||||||
{
|
{
|
||||||
$startEpoch = $p_startDT->format("U.u");
|
$startEpoch = $p_startDT->format("U.u");
|
||||||
|
|
||||||
//add two float numbers to 6 subsecond precision
|
//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.
|
//DateTime::createFromFormat("U.u") will have a problem if there is no decimal in the resulting number.
|
||||||
$newEpoch = bcsub($startEpoch , (string) $p_seconds, 6);
|
$newEpoch = bcsub($startEpoch , (string) $p_seconds, 6);
|
||||||
|
|
||||||
$dt = DateTime::createFromFormat("U.u", $newEpoch, new DateTimeZone("UTC"));
|
$dt = DateTime::createFromFormat("U.u", $newEpoch, new DateTimeZone("UTC"));
|
||||||
|
|
||||||
if ($dt === false) {
|
if ($dt === false) {
|
||||||
//PHP 5.3.2 problem
|
//PHP 5.3.2 problem
|
||||||
$dt = DateTime::createFromFormat("U", intval($newEpoch), new DateTimeZone("UTC"));
|
$dt = DateTime::createFromFormat("U", intval($newEpoch), new DateTimeZone("UTC"));
|
||||||
}
|
}
|
||||||
|
|
||||||
return $dt;
|
return $dt;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -415,41 +415,41 @@ class Application_Model_Scheduler
|
||||||
return $nextDT;
|
return $nextDT;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* @param int $showInstance
|
* @param int $showInstance
|
||||||
* This function recalculates the start/end times of items in a gapless show to
|
* This function recalculates the start/end times of items in a gapless show to
|
||||||
* account for crossfade durations.
|
* account for crossfade durations.
|
||||||
*/
|
*/
|
||||||
private function calculateCrossfades($showInstance)
|
private function calculateCrossfades($showInstance)
|
||||||
{
|
{
|
||||||
Logging::info("adjusting start, end times of scheduled items to account for crossfades show instance #".$showInstance);
|
Logging::info("adjusting start, end times of scheduled items to account for crossfades show instance #".$showInstance);
|
||||||
|
|
||||||
$instance = CcShowInstancesQuery::create()->findPK($showInstance, $this->con);
|
$instance = CcShowInstancesQuery::create()->findPK($showInstance, $this->con);
|
||||||
if (is_null($instance)) {
|
if (is_null($instance)) {
|
||||||
throw new OutDatedScheduleException(_("The schedule you're viewing is out of date!"));
|
throw new OutDatedScheduleException(_("The schedule you're viewing is out of date!"));
|
||||||
}
|
}
|
||||||
|
|
||||||
$itemStartDT = $instance->getDbStarts(null);
|
$itemStartDT = $instance->getDbStarts(null);
|
||||||
$itemEndDT = null;
|
$itemEndDT = null;
|
||||||
|
|
||||||
$schedule = CcScheduleQuery::create()
|
$schedule = CcScheduleQuery::create()
|
||||||
->filterByDbInstanceId($showInstance)
|
->filterByDbInstanceId($showInstance)
|
||||||
->orderByDbStarts()
|
->orderByDbStarts()
|
||||||
->find($this->con);
|
->find($this->con);
|
||||||
|
|
||||||
foreach ($schedule as $item) {
|
foreach ($schedule as $item) {
|
||||||
|
|
||||||
$itemEndDT = $item->getDbEnds(null);
|
$itemEndDT = $item->getDbEnds(null);
|
||||||
|
|
||||||
$item
|
$item
|
||||||
->setDbStarts($itemStartDT)
|
->setDbStarts($itemStartDT)
|
||||||
->setDbEnds($itemEndDT);
|
->setDbEnds($itemEndDT);
|
||||||
|
|
||||||
$itemStartDT = $this->findTimeDifference($itemEndDT, $this->crossfadeDuration);
|
$itemStartDT = $this->findTimeDifference($itemEndDT, $this->crossfadeDuration);
|
||||||
$itemEndDT = $this->findEndTime($itemStartDT, $item->getDbClipLength());
|
$itemEndDT = $this->findEndTime($itemStartDT, $item->getDbClipLength());
|
||||||
}
|
}
|
||||||
|
|
||||||
$schedule->save($this->con);
|
$schedule->save($this->con);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue