CC-3963: If DJ is scheduled to broadcast for show, then automatically
enable source when DJ connects. - done
This commit is contained in:
parent
22453f3820
commit
57397312f2
6 changed files with 62 additions and 3 deletions
|
@ -814,6 +814,12 @@ class ApiController extends Zend_Controller_Action
|
|||
Application_Model_Preference::SetSourceSwitchStatus($sourcename, "off");
|
||||
Application_Model_LiveLog::SetEndTime($sourcename == 'scheduled_play'?'S':'L',
|
||||
new DateTime("now", new DateTimeZone('UTC')));
|
||||
}elseif($status == "true" && Application_Model_Preference::GetAutoSwitch()){
|
||||
$data = array("sourcename"=>$sourcename, "status"=>"on");
|
||||
Application_Model_RabbitMq::SendMessageToPypo("switch_source", $data);
|
||||
Application_Model_Preference::SetSourceSwitchStatus($sourcename, "on");
|
||||
Application_Model_LiveLog::SetNewLogTime($sourcename == 'scheduled_play'?'S':'L',
|
||||
new DateTime("now", new DateTimeZone('UTC')));
|
||||
}
|
||||
Application_Model_Preference::SetSourceStatus($sourcename, $status);
|
||||
}
|
||||
|
|
|
@ -215,6 +215,7 @@ class PreferenceController extends Zend_Controller_Action
|
|||
Application_Model_Preference::SetLiveSteamMasterPassword($values["master_password"]);
|
||||
Application_Model_Preference::SetDefaultTransitionFade($values["transition_fade"]);
|
||||
Application_Model_Preference::SetAutoTransition($values["auto_transition"]);
|
||||
Application_Model_Preference::SetAutoSwitch($values["auto_switch"]);
|
||||
|
||||
if (!$isSaas) {
|
||||
if (!Application_Model_Preference::GetMasterDjConnectionUrlOverride()) {
|
||||
|
|
|
@ -15,13 +15,20 @@ class Application_Form_LiveStreamingPreferences extends Zend_Form_SubForm
|
|||
$defaultFade = '00.000000';
|
||||
}
|
||||
|
||||
// automatic switch off
|
||||
// automatic trasition on source disconnection
|
||||
$auto_transition = new Zend_Form_Element_Checkbox("auto_transition");
|
||||
$auto_transition->setLabel("Auto Source Transition")
|
||||
$auto_transition->setLabel("Auto Switch Off")
|
||||
->setValue(Application_Model_Preference::GetAutoTransition())
|
||||
->setDecorators(array('ViewHelper'));
|
||||
$this->addElement($auto_transition);
|
||||
|
||||
// automatic switch on upon source connection
|
||||
$auto_switch = new Zend_Form_Element_Checkbox("auto_switch");
|
||||
$auto_switch->setLabel("Auto Switch On")
|
||||
->setValue(Application_Model_Preference::GetAutoSwitch())
|
||||
->setDecorators(array('ViewHelper'));
|
||||
$this->addElement($auto_switch);
|
||||
|
||||
// Default transition fade
|
||||
$transition_fade = new Zend_Form_Element_Text("transition_fade");
|
||||
$transition_fade->setLabel("Switch Transition Fade (s)")
|
||||
|
|
|
@ -877,6 +877,14 @@ class Application_Model_Preference
|
|||
return self::GetValue("auto_transition");
|
||||
}
|
||||
|
||||
public static function SetAutoSwitch($value){
|
||||
self::SetValue("auto_switch", $value, false);
|
||||
}
|
||||
|
||||
public static function GetAutoSwitch(){
|
||||
return self::GetValue("auto_switch");
|
||||
}
|
||||
|
||||
public static function SetEnableSystemEmail($upload) {
|
||||
self::SetValue("enable_system_email", $upload);
|
||||
}
|
||||
|
|
|
@ -17,6 +17,22 @@
|
|||
</ul>
|
||||
<?php endif; ?>
|
||||
</dd>
|
||||
<dt id="auto_switch-label">
|
||||
<label class="optional" for="auto_transition"><?php echo $this->element->getElement('auto_switch')->getLabel() ?> :
|
||||
<span class="icecast_metadata_help_icon" id="auto_switch_help">
|
||||
</span>
|
||||
</label>
|
||||
</dt>
|
||||
<dd id="auto_switch-element">
|
||||
<?php echo $this->element->getElement('auto_switch') ?>
|
||||
<?php if($this->element->getElement('auto_switch')->hasErrors()) : ?>
|
||||
<ul class='errors'>
|
||||
<?php foreach($this->element->getElement('auto_switch')->getMessages() as $error): ?>
|
||||
<li><?php echo $error; ?></li>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
<?php endif; ?>
|
||||
</dd>
|
||||
<dt id="transition_fade-label">
|
||||
<label class="optional" for="transition_fade"><?php echo $this->element->getElement('transition_fade')->getLabel() ?> :
|
||||
</label>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue