diff --git a/airtime_mvc/application/common/ProvisioningHelper.php b/airtime_mvc/application/common/ProvisioningHelper.php
index cdd9818c0..f5aacd53d 100644
--- a/airtime_mvc/application/common/ProvisioningHelper.php
+++ b/airtime_mvc/application/common/ProvisioningHelper.php
@@ -11,6 +11,7 @@ class ProvisioningHelper
private $dbuser, $dbpass, $dbname, $dbhost, $dbowner, $apikey;
private $instanceId;
private $stationName, $description;
+ private $defaultIcecastPassword;
public function __construct($apikey)
{
@@ -118,6 +119,9 @@ class ProvisioningHelper
if (isset($_POST['description'])) {
$this->description = $_POST['description'];
}
+ if (isset($_POST['icecast_pass'])) {
+ $this->defaultIcecastPassword = $_POST['icecast_pass'];
+ }
}
/**
@@ -208,6 +212,9 @@ class ProvisioningHelper
if ($this->description) {
Application_Model_Preference::SetStationDescription($this->description);
}
+ if (isset($this->defaultIcecastPassword)) {
+ Application_Model_Preference::setDefaultIcecastPassword($this->defaultIcecastPassword);
+ }
}
}
diff --git a/airtime_mvc/application/configs/constants.php b/airtime_mvc/application/configs/constants.php
index c7c062066..0a3d320a2 100644
--- a/airtime_mvc/application/configs/constants.php
+++ b/airtime_mvc/application/configs/constants.php
@@ -32,6 +32,8 @@ define('DEFAULT_LOGO_PLACEHOLDER', 1);
define('DEFAULT_LOGO_FILE', 'images/airtime_logo.png');
define('DEFAULT_TIMESTAMP_FORMAT', 'Y-m-d H:i:s');
define('DEFAULT_MICROTIME_FORMAT', 'Y-m-d H:i:s.u');
+define('DEFAULT_ICECAST_PORT', 8000);
+define('DEFAULT_ICECAST_PASS', 'hackme');
// Metadata Keys for files
define('MDATA_KEY_FILEPATH' , 'filepath');
diff --git a/airtime_mvc/application/controllers/LocaleController.php b/airtime_mvc/application/controllers/LocaleController.php
index 7d83a165e..31d899d48 100644
--- a/airtime_mvc/application/controllers/LocaleController.php
+++ b/airtime_mvc/application/controllers/LocaleController.php
@@ -171,8 +171,7 @@ class LocaleController extends Zend_Controller_Action
"Check this box to automatically switch on Master/Show source upon source connection." => _("Check this box to automatically switch on Master/Show source upon source connection."),
"If your Icecast server expects a username of 'source', this field can be left blank." => _("If your Icecast server expects a username of 'source', this field can be left blank."),
"If your live streaming client does not ask for a username, this field should be 'source'." => _("If your live streaming client does not ask for a username, this field should be 'source'."),
- "If you change the username or password values for an enabled stream the playout engine will be rebooted and your listeners will hear silence for 5-10 seconds. Changing the following fields will NOT cause a reboot: Stream Label (Global Settings), and Switch Transition Fade(s), Master Username, and Master Password (Input Stream Settings). If Airtime is recording, and if the change causes a playout engine restart, the recording will be interrupted."
- => _("If you change the username or password values for an enabled stream the playout engine will be rebooted and your listeners will hear silence for 5-10 seconds. Changing the following fields will NOT cause a reboot: Stream Label (Global Settings), and Switch Transition Fade(s), Master Username, and Master Password (Input Stream Settings). If Airtime is recording, and if the change causes a playout engine restart, the recording will be interrupted."),
+ "WARNING: This will restart your stream and may cause a short dropout for your listeners!" => _("WARNING: This will restart your stream and may cause a short dropout for your listeners!"),
"This is the admin username and password for Icecast/SHOUTcast to get listener statistics." => _("This is the admin username and password for Icecast/SHOUTcast to get listener statistics."),
//preferences/support-setting.js
"Image must be one of jpg, jpeg, png, or gif" => _("Image must be one of jpg, jpeg, png, or gif"),
diff --git a/airtime_mvc/application/controllers/PreferenceController.php b/airtime_mvc/application/controllers/PreferenceController.php
index 39b7a8613..7eee7afbe 100644
--- a/airtime_mvc/application/controllers/PreferenceController.php
+++ b/airtime_mvc/application/controllers/PreferenceController.php
@@ -149,9 +149,6 @@ class PreferenceController extends Zend_Controller_Action
session_start(); //Open session for writing.
- // get current settings
- $setting = Application_Model_StreamSetting::getStreamSetting();
-
$name_map = array(
'ogg' => 'Ogg Vorbis',
'fdkaac' => 'AAC+',
@@ -160,55 +157,14 @@ class PreferenceController extends Zend_Controller_Action
'mp3' => 'MP3',
);
- // get predefined type and bitrate from pref table
- $temp_types = Application_Model_Preference::GetStreamType();
- $stream_types = array();
- foreach ($temp_types as $type) {
- $type = strtolower(trim($type));
- if (isset($name_map[$type])) {
- $name = $name_map[$type];
- } else {
- $name = $type;
- }
- $stream_types[$type] = $name;
- }
-
- $temp_bitrate = Application_Model_Preference::GetStreamBitrate();
- $max_bitrate = intval(Application_Model_Preference::GetMaxBitrate());
- $stream_bitrates = array();
- foreach ($temp_bitrate as $type) {
- if (intval($type) <= $max_bitrate) {
- $stream_bitrates[trim($type)] = strtoupper(trim($type))." kbit/s";
- }
- }
-
$num_of_stream = intval(Application_Model_Preference::GetNumOfStreams());
$form = new Application_Form_StreamSetting();
- // $form->addElement('hash', 'csrf', array(
- // 'salt' => 'unique'
- // ));
-
$csrf_namespace = new Zend_Session_Namespace('csrf_namespace');
$csrf_element = new Zend_Form_Element_Hidden('csrf');
$csrf_element->setValue($csrf_namespace->authtoken)->setRequired('true')->removeDecorator('HtmlTag')->removeDecorator('Label');
$form->addElement($csrf_element);
- $form->setSetting($setting);
- $form->startFrom();
-
- $live_stream_subform = new Application_Form_LiveStreamingPreferences();
- $form->addSubForm($live_stream_subform, "live_stream_subform");
-
- for ($i=1; $i<=$num_of_stream; $i++) {
- $subform = new Application_Form_StreamSettingSubForm();
- $subform->setPrefix($i);
- $subform->setSetting($setting);
- $subform->setStreamTypes($stream_types);
- $subform->setStreamBitrates($stream_bitrates);
- $subform->startForm();
- $form->addSubForm($subform, "s".$i."_subform");
- }
if ($request->isPost()) {
$params = $request->getPost();
/* Parse through post data and put in format
@@ -246,7 +202,6 @@ class PreferenceController extends Zend_Controller_Action
$values["s3_data"] = $s3_data;
$values["s4_data"] = $s4_data;
- $error = false;
if ($form->isValid($values)) {
$values['icecast_vorbis_metadata'] = $form->getValue('icecast_vorbis_metadata');
@@ -263,13 +218,8 @@ class PreferenceController extends Zend_Controller_Action
$s4_set_admin_pass = !empty($values["s4_data"]["admin_pass"]);
// this goes into cc_pref table
- Application_Model_Preference::SetStreamLabelFormat($values['streamFormat']);
- Application_Model_Preference::SetLiveStreamMasterUsername($values["master_username"]);
- Application_Model_Preference::SetLiveStreamMasterPassword($values["master_password"]);
- Application_Model_Preference::SetDefaultTransitionFade($values["transition_fade"]);
- Application_Model_Preference::SetAutoTransition($values["auto_transition"]);
- Application_Model_Preference::SetAutoSwitch($values["auto_switch"]);
-
+ $this->setStreamPreferences($values);
+
// compare new values with current value
$changeRGenabled = Application_Model_Preference::GetEnableReplayGain() != $values["enableReplayGain"];
$changeRGmodifier = Application_Model_Preference::getReplayGainModifier() != $values["replayGainModifier"];
@@ -294,34 +244,86 @@ class PreferenceController extends Zend_Controller_Action
}
Application_Model_RabbitMq::SendMessageToPypo("update_stream_setting", $data);
-
- $live_stream_subform->updateVariables();
- $this->view->enable_stream_conf = Application_Model_Preference::GetEnableStreamConf();
- $this->view->form = $form;
- $this->view->num_stream = $num_of_stream;
$this->view->statusMsg = "