CC-2607: Ability to adjust stream bitrate, type, etc from UI

- removed debug code from NowPlayingController
- New Form for streamsetting
- Action created in PreferenceController
This commit is contained in:
James 2011-08-18 13:53:12 -04:00
parent 4f2b2dba6d
commit cf55e92aa3
17 changed files with 701 additions and 103 deletions

View file

@ -1,8 +1,9 @@
<?php
class Application_Model_StreamSetting {
public function __construct(){
}
public static function getStreamSetting(){
global $CC_DBC;
$sql = "SELECT *"
@ -11,4 +12,32 @@ class Application_Model_StreamSetting {
$rows = $CC_DBC->getAll($sql);
return $rows;
}
public static function setStreamSetting($data){
global $CC_DBC;
foreach($data as $key=>$d){
if($key == "output_sound_device"){
$v = $d == 1?"true":"false";
$sql = "UPDATE cc_stream_setting SET value='$v' WHERE keyname='$key'";
$CC_DBC->query($sql);
}
else{
$temp = explode('_', $key);
$prefix = $temp[0];
foreach($d as $k=>$v){
$keyname = $prefix."_".$k;
if( $k == 'output'){
$keyname = $k."_".$prefix;
if( $d["enable"] == 0){
$v = 'disabled';
}
}
if( $k == 'mount'){
$v = $d['mount'].".".$d['type'];
}
$sql = "UPDATE cc_stream_setting SET value='$v' WHERE keyname='$keyname'";
$CC_DBC->query($sql);
}
}
}
}
}