CC-3301: Add ability to switch stereo/mono stream in stream settings
-fixed
This commit is contained in:
parent
8b5f94fa9f
commit
859445c766
8 changed files with 238 additions and 54 deletions
|
@ -163,7 +163,6 @@ class PreferenceController extends Zend_Controller_Action
|
|||
foreach ($temp as $t) {
|
||||
$setting[$t['keyname']] = $t['value'];
|
||||
}
|
||||
|
||||
// get predefined type and bitrate from pref table
|
||||
$temp_types = Application_Model_Preference::GetStreamType();
|
||||
$stream_types = array();
|
||||
|
@ -204,12 +203,11 @@ class PreferenceController extends Zend_Controller_Action
|
|||
$form->addSubForm($subform, "s".$i."_subform");
|
||||
}
|
||||
if ($request->isPost()) {
|
||||
$post_data = $request->getPost();
|
||||
$values = $request->getPost();
|
||||
|
||||
$error = false;
|
||||
$values = $post_data;
|
||||
|
||||
if ($form->isValid($post_data)) {
|
||||
if ($form->isValid($values)) {
|
||||
if (!$isSaas) {
|
||||
$values['output_sound_device'] = $form->getValue('output_sound_device');
|
||||
$values['output_sound_device_type'] = $form->getValue('output_sound_device_type');
|
||||
|
@ -264,7 +262,7 @@ class PreferenceController extends Zend_Controller_Action
|
|||
$data = array();
|
||||
$info = Application_Model_StreamSetting::getStreamSetting();
|
||||
$data['setting'] = $info;
|
||||
for ($i=1;$i<=$num_of_stream;$i++) {
|
||||
for ($i=1; $i<=$num_of_stream; $i++) {
|
||||
Application_Model_StreamSetting::setLiquidsoapError($i, "waiting");
|
||||
}
|
||||
|
||||
|
|
|
@ -83,6 +83,16 @@ class Application_Form_StreamSettingSubForm extends Zend_Form_SubForm
|
|||
}
|
||||
$this->addElement($output);
|
||||
|
||||
$channels = new Zend_Form_Element_Select('channels');
|
||||
$channels->setLabel("Channels:")
|
||||
->setMultiOptions(array("mono"=>"1 - Mono", "stereo"=>"2 - Stereo"))
|
||||
->setValue(isset($setting[$prefix.'_channels']) ? $setting[$prefix.'_channels'] : "stereo")
|
||||
->setDecorators(array('ViewHelper'));
|
||||
if ($disable_all) {
|
||||
$channels->setAttrib("disabled", "disabled");
|
||||
}
|
||||
$this->addElement($channels);
|
||||
|
||||
$host = new Zend_Form_Element_Text('host');
|
||||
$host->setLabel("Server")
|
||||
->setValue(isset($setting[$prefix.'_host'])?$setting[$prefix.'_host']:"")
|
||||
|
|
|
@ -183,11 +183,13 @@ class Application_Model_StreamSetting
|
|||
}
|
||||
$v = trim($v);
|
||||
|
||||
#escape double single quotes CC-3926
|
||||
$v = str_replace("'", "''", $v);
|
||||
$sql = "UPDATE cc_stream_setting SET value='$v' WHERE keyname='$keyname'";
|
||||
$stream_setting = CcStreamSettingQuery::create()->filterByDbKeyName($keyname)->findOne();
|
||||
if (is_null($stream_setting)) {
|
||||
throw new Exception("Keyname $keyname does not exist!");
|
||||
}
|
||||
|
||||
$con->exec($sql);
|
||||
$stream_setting->setDbValue($v);
|
||||
$stream_setting->save();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -60,7 +60,14 @@
|
|||
<dd id="<?php echo $s_name?>Output-element">
|
||||
<?php echo $this->element->getElement('output')?>
|
||||
</dd>
|
||||
|
||||
|
||||
<dt id="<?php echo $s_name?>Channels-label">
|
||||
<label for="<?php echo $s_name?>Channels"><?php echo $this->element->getElement('channels')->getLabel()?></label>
|
||||
</dt>
|
||||
<dd id="<?php echo $s_name?>Channels-element">
|
||||
<?php echo $this->element->getElement('channels')?>
|
||||
</dd>
|
||||
|
||||
<fieldset class="padded top-margin display_field toggle closed" id="output_setting">
|
||||
<legend style="cursor: pointer;">
|
||||
<span class="ui-icon ui-icon-triangle-2-n-s"></span>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue