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

interface

- dummy page "Stream Setting" page for the test
- StreamSetting model is added
- set owner and group as 'pypo' for liquidsoap.cfg
- pypofech handle 'update_stream_setting' command
This commit is contained in:
James 2011-08-15 16:10:46 -04:00
parent e18c0903cb
commit 4f2b2dba6d
12 changed files with 174 additions and 30 deletions

View file

@ -609,7 +609,7 @@ class ApiController extends Zend_Controller_Action
}
public function getStreamSettingAction() {
global $CC_CONFIG, $CC_DBC;
global $CC_CONFIG;
$request = $this->getRequest();
$api_key = $request->getParam('api_key');
@ -619,12 +619,8 @@ class ApiController extends Zend_Controller_Action
print 'You are not allowed to access this resource.';
exit;
}
$sql = "SELECT *"
." FROM cc_stream_setting";
$rows = $CC_DBC->getAll($sql);
$this->view->msg = $rows;
$this->view->msg = Application_Model_StreamSetting::getStreamSetting();
}
}

View file

@ -14,6 +14,7 @@ class PreferenceController extends Zend_Controller_Action
->addActionContext('reload-watch-directory', 'json')
->addActionContext('remove-watch-directory', 'json')
->addActionContext('is-import-in-progress', 'json')
->addActionContext('change-stream-setting', 'json')
->initContext();
}
@ -82,6 +83,16 @@ class PreferenceController extends Zend_Controller_Action
$this->view->form = $watched_dirs_pref;
}
public function streamSettingAction()
{
$request = $this->getRequest();
$baseUrl = $request->getBaseUrl();
$this->view->headScript()->appendFile($baseUrl.'/js/airtime/preferences/streamsetting.js','text/javascript');
$this->view->form = new Application_Form_StreamSetting();
}
public function serverBrowseAction()
{
@ -134,6 +145,16 @@ class PreferenceController extends Zend_Controller_Action
$this->view->subform = $watched_dirs_form->render();
}
public function changeStreamSettingAction()
{
$data = array();
$data['setting'] = Application_Model_StreamSetting::getStreamSetting();
RabbitMq::SendMessageToPypo("update_stream_setting", $data);
$form = new Application_Form_StreamSetting();
$this->view->subform = $form->render();
}
public function reloadWatchDirectoryAction()
{