CC-2301 : dos2unix being run

This commit is contained in:
Naomi 2013-05-02 16:52:30 -04:00
parent 3e320f1e2e
commit 435bb83588
3 changed files with 86 additions and 86 deletions

View file

@ -27,23 +27,23 @@ class Application_Form_GeneralPreferences extends Zend_Form_SubForm
)
));
//Default station fade in
$this->addElement('text', 'stationDefaultCrossfadeDuration', array(
'class' => 'input_text',
'label' => _('Default Crossfade Duration (s):'),
'required' => true,
'filters' => array('StringTrim'),
'validators' => array(
array(
$rangeValidator,
$notEmptyValidator,
'regex', false, array('/^[0-9]{1,2}(\.\d{1})?$/', 'messages' => _('enter a time in seconds 0{.0}'))
)
),
'value' => Application_Model_Preference::GetDefaultCrossfadeDuration(),
'decorators' => array(
'ViewHelper'
)
//Default station fade in
$this->addElement('text', 'stationDefaultCrossfadeDuration', array(
'class' => 'input_text',
'label' => _('Default Crossfade Duration (s):'),
'required' => true,
'filters' => array('StringTrim'),
'validators' => array(
array(
$rangeValidator,
$notEmptyValidator,
'regex', false, array('/^[0-9]{1,2}(\.\d{1})?$/', 'messages' => _('enter a time in seconds 0{.0}'))
)
),
'value' => Application_Model_Preference::GetDefaultCrossfadeDuration(),
'decorators' => array(
'ViewHelper'
)
));
//Default station fade in

View file

@ -195,21 +195,21 @@ class Application_Model_Preference
}
}
public static function SetDefaultCrossfadeDuration($duration)
{
self::setValue("default_crossfade_duration", $duration);
}
public static function GetDefaultCrossfadeDuration()
{
$duration = self::getValue("default_crossfade_duration");
if ($duration === "") {
// the default value of the fade is 00.5
return "0";
}
return $duration;
public static function SetDefaultCrossfadeDuration($duration)
{
self::setValue("default_crossfade_duration", $duration);
}
public static function GetDefaultCrossfadeDuration()
{
$duration = self::getValue("default_crossfade_duration");
if ($duration === "") {
// the default value of the fade is 00.5
return "0";
}
return $duration;
}
public static function SetDefaultFadeIn($fade)

View file

@ -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);
}
/*