From bcbbf42f62cacedded7fa55efad0a09cabd062c4 Mon Sep 17 00:00:00 2001 From: James Date: Fri, 13 Jan 2012 16:56:02 -0500 Subject: [PATCH] CC-3246: Hardware audio output cannot be switched off - fixed --- .../application/controllers/PreferenceController.php | 2 +- airtime_mvc/application/forms/StreamSetting.php | 12 +++++++++--- .../public/js/airtime/preferences/streamsetting.js | 6 ++++++ 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/airtime_mvc/application/controllers/PreferenceController.php b/airtime_mvc/application/controllers/PreferenceController.php index 8d227c7e7..03ddd677b 100644 --- a/airtime_mvc/application/controllers/PreferenceController.php +++ b/airtime_mvc/application/controllers/PreferenceController.php @@ -194,7 +194,7 @@ class PreferenceController extends Zend_Controller_Action } } if($form->isValid($post_data)){ - if(Application_Model_Preference::GetPlanLevel() == 'disabled'){// && $form->isValid($post_data['output_sound_device'])){ + if(Application_Model_Preference::GetPlanLevel() == 'disabled'){ $values['output_sound_device'] = $form->getValue('output_sound_device'); } diff --git a/airtime_mvc/application/forms/StreamSetting.php b/airtime_mvc/application/forms/StreamSetting.php index 6c4e59871..eda28845b 100644 --- a/airtime_mvc/application/forms/StreamSetting.php +++ b/airtime_mvc/application/forms/StreamSetting.php @@ -68,9 +68,15 @@ class Application_Form_StreamSetting extends Zend_Form } public function isValid($data){ - if($data['output_sound_device']){ - $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'], "streamFormat"=>$data['streamFormat'])); + if(isset($data['output_sound_device'])){ + $d = array(); + $d["output_sound_device"] = $data['output_sound_device']; + $d["icecast_vorbis_metadata"] = $data['icecast_vorbis_metadata']; + if(isset($data['output_sound_device_type'])){ + $d["output_sound_device_type"] = $data['output_sound_device_type']; + } + $d["streamFormat"] = $data['streamFormat']; + $this->populate($d); } return true; } diff --git a/airtime_mvc/public/js/airtime/preferences/streamsetting.js b/airtime_mvc/public/js/airtime/preferences/streamsetting.js index a8195bb2d..a88d27ace 100644 --- a/airtime_mvc/public/js/airtime/preferences/streamsetting.js +++ b/airtime_mvc/public/js/airtime/preferences/streamsetting.js @@ -125,6 +125,12 @@ $(document).ready(function() { rebuildStreamURL($(this)) }) + if(!$("#output_sound_device").is(':checked')){ + $("select[id=output_sound_device_type]").attr('disabled', 'disabled') + }else{ + $("select[id=output_sound_device_type]").removeAttr('disabled') + } + $("#output_sound_device").change(function(){ if($(this).is(':checked')){ $("select[id=output_sound_device_type]").removeAttr('disabled')