CC-3074: Give users the choice of which hardware sound API they wish to

use (instead of hardcoded to ALSA)

- finished everything except LS part(including upgrade and UI)
This commit is contained in:
James 2011-11-30 19:01:40 -05:00 committed by Martin Konecny
parent 06cbe215a3
commit 043f0c29a1
10 changed files with 62 additions and 2 deletions

View file

@ -198,6 +198,7 @@ class PreferenceController extends Zend_Controller_Action
}
$values['icecast_vorbis_metadata'] = $form->getValue('icecast_vorbis_metadata');
$values['output_sound_device_type'] = $form->getValue('output_sound_device_type');
}
if(!$error){
Application_Model_StreamSetting::setStreamSetting($values);

View file

@ -25,6 +25,17 @@ class Application_Form_StreamSetting extends Zend_Form
$output_sound_device->setAttrib("readonly", true);
}
$this->addElement($output_sound_device);
$output_types = array("ALSA"=>"ALSA", "AO"=>"AO", "OSS"=>"OSS", "Portaudio"=>"Portaudio", "Pulseaudio"=>"Pulseaudio");
$output_type = new Zend_Form_Element_Select('output_sound_device_type');
$output_type->setLabel("Output Type")
->setMultiOptions($output_types)
->setValue($setting['output_sound_device_type'])
->setDecorators(array('ViewHelper'));
if($setting['output_sound_device'] != "true"){
$output_type->setAttrib("disabled", "disabled");
}
$this->addElement($output_type);
}
$icecast_vorbis_metadata = new Zend_Form_Element_Checkbox('icecast_vorbis_metadata');
@ -39,7 +50,8 @@ class Application_Form_StreamSetting extends Zend_Form
}
public function isValid($data){
$this->populate(array("output_sound_device"=>$data['output_sound_device'], "icecast_vorbis_metadata"=>$data['icecast_vorbis_metadata']));
$this->populate(array("output_sound_device"=>$data['output_sound_device'], "icecast_vorbis_metadata"=>$data['icecast_vorbis_metadata'],
"output_sound_device_type"=>$data['output_sound_device_type']));
return true;
}
}

View file

@ -68,7 +68,6 @@ class Application_Form_StreamSettingSubForm extends Zend_Form_SubForm{
if($disable_all){
$bitrate->setAttrib("disabled", "disabled");
}
$this->addElement($type);
$this->addElement($bitrate);
$output = new Zend_Form_Element_Select('output');

View file

@ -20,6 +20,14 @@
<dd id="hardwareOut-element">
<?php echo $this->form->getElement('output_sound_device') ?>
</dd>
<dt id="hardwareOutType-label">
<label class="required">
<?php echo $this->form->getElement('output_sound_device_type')->getLabel() ?> :
</label>
</dt>
<dd id="hardwareOutType-element">
<?php echo $this->form->getElement('output_sound_device_type') ?>
</dd>
<?php } ?>
<dt id="vorbisMetadata-label">
<label class="required">