default fade setting for songs.
This commit is contained in:
parent
12dbdf8f4c
commit
f8d3a38b2e
4 changed files with 36 additions and 12 deletions
|
@ -24,22 +24,18 @@ class PreferenceController extends Zend_Controller_Action
|
||||||
}
|
}
|
||||||
|
|
||||||
$form = new Application_Form_Preferences();
|
$form = new Application_Form_Preferences();
|
||||||
if (!$form->isValid($request->getPost())) {
|
if ($form->isValid($request->getPost())) {
|
||||||
|
|
||||||
} else {
|
|
||||||
$values = $form->getValues();
|
$values = $form->getValues();
|
||||||
Application_Model_Preference::SetHeadTitle($values["stationName"], $this->view);
|
Application_Model_Preference::SetHeadTitle($values["stationName"], $this->view);
|
||||||
|
Application_Model_Preference::SetDefaultFade($values["stationDefaultFade"]);
|
||||||
|
|
||||||
$this->view->statusMsg = "Preferences Updated.";
|
$this->view->statusMsg = "Preferences Updated.";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$this->view->form = $form;
|
$this->view->form = $form;
|
||||||
return $this->render('index'); //render the phtml file
|
return $this->render('index'); //render the phtml file
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -16,6 +16,16 @@ class Application_Form_Preferences extends Zend_Form
|
||||||
'validators' => array('NotEmpty'),
|
'validators' => array('NotEmpty'),
|
||||||
'value' => Application_Model_Preference::GetValue("station_name")
|
'value' => Application_Model_Preference::GetValue("station_name")
|
||||||
));
|
));
|
||||||
|
|
||||||
|
// Add login element
|
||||||
|
$this->addElement('text', 'stationDefaultFade', array(
|
||||||
|
'class' => 'input_text',
|
||||||
|
'label' => 'Default Fade:',
|
||||||
|
'required' => false,
|
||||||
|
'filters' => array('StringTrim'),
|
||||||
|
'validators' => array(array('regex', false, array('/^[0-2][0-3]:[0-5][0-9]:[0-5][0-9](\.\d{1,6})?$/', 'messages' => 'enter a time 00:00:00{.000000}'))),
|
||||||
|
'value' => Application_Model_Preference::GetValue("default_fade")
|
||||||
|
));
|
||||||
|
|
||||||
$this->addElement('submit', 'submit', array(
|
$this->addElement('submit', 'submit', array(
|
||||||
'class' => 'ui-button ui-state-default',
|
'class' => 'ui-button ui-state-default',
|
||||||
|
@ -24,4 +34,4 @@ class Application_Form_Preferences extends Zend_Form
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
///^[0-2][0-3]:[0-5][0-9]:[0-5][0-9]{.}[0-9]{0-6}/i
|
||||||
|
|
|
@ -927,11 +927,21 @@ class Playlist {
|
||||||
*/
|
*/
|
||||||
private function insertPlaylistElement($plId, $fileId, $pos, $clipLength, $cuein, $cueout, $fadeIn=NULL, $fadeOut=NULL)
|
private function insertPlaylistElement($plId, $fileId, $pos, $clipLength, $cuein, $cueout, $fadeIn=NULL, $fadeOut=NULL)
|
||||||
{
|
{
|
||||||
if(is_null($fadeIn))
|
$defaultFade = Application_Model_Preference::GetDefaultFade();
|
||||||
$fadeIn = '00:00:00.000';
|
|
||||||
if(is_null($fadeOut))
|
|
||||||
$fadeOut = '00:00:00.000';
|
|
||||||
|
|
||||||
|
if(is_null($fadeIn)) {
|
||||||
|
if($defaultFade != "")
|
||||||
|
$fadeIn = $defaultFade;
|
||||||
|
else
|
||||||
|
$fadeIn = '00:00:00.000';
|
||||||
|
}
|
||||||
|
if(is_null($fadeOut)) {
|
||||||
|
if($defaultFade != "")
|
||||||
|
$fadeOut = $defaultFade;
|
||||||
|
else
|
||||||
|
$fadeOut = '00:00:00.000';
|
||||||
|
}
|
||||||
|
|
||||||
$row = new CcPlaylistcontents();
|
$row = new CcPlaylistcontents();
|
||||||
$row->setDbPlaylistId($plId);
|
$row->setDbPlaylistId($plId);
|
||||||
$row->setDbFileId($fileId);
|
$row->setDbFileId($fileId);
|
||||||
|
|
|
@ -78,5 +78,13 @@ class Application_Model_Preference
|
||||||
return Application_Model_Preference::GetValue("shows_populated_until");
|
return Application_Model_Preference::GetValue("shows_populated_until");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static function SetDefaultFade($fade) {
|
||||||
|
Application_Model_Preference::SetValue("default_fade", $fade);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function GetDefaultFade() {
|
||||||
|
return Application_Model_Preference::GetValue("default_fade");
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue