diff --git a/airtime_mvc/application/forms/StreamSettingSubForm.php b/airtime_mvc/application/forms/StreamSettingSubForm.php
index 2a5ff94a3..0d5a3473f 100644
--- a/airtime_mvc/application/forms/StreamSettingSubForm.php
+++ b/airtime_mvc/application/forms/StreamSettingSubForm.php
@@ -94,23 +94,20 @@ class Application_Form_StreamSettingSubForm extends Zend_Form_SubForm{
$this->addElement($url);
$description = new Zend_Form_Element_Text('description');
- $description->setLabel("Description")
+ $description->setLabel("Name/Description")
->setValue($setting[$prefix.'_description'])
->setDecorators(array('ViewHelper'));
$this->addElement($description);
$mount_info = explode('.',$setting[$prefix.'_mount']);
$mount = new Zend_Form_Element_Text('mount');
- $mount->class = "with-info";
$mount->setLabel("Mount Point")
->setValue($mount_info[0])
->setDecorators(array('ViewHelper'));
$this->addElement($mount);
- $stream_url_value = "http://".$setting[$prefix.'_host'].":".$setting[$prefix.'_port']."/".$mount_info[0].".".$setting[$prefix.'_type'];
-
$this->setDecorators(array(
- array('ViewScript', array('viewScript' => 'form/stream-setting-form.phtml', "stream_number"=>$stream_number, "stream_url"=>$stream_url_value))
+ array('ViewScript', array('viewScript' => 'form/stream-setting-form.phtml', "stream_number"=>$stream_number))
));
}
diff --git a/airtime_mvc/application/models/StreamSetting.php b/airtime_mvc/application/models/StreamSetting.php
index e6228931d..8233388a3 100644
--- a/airtime_mvc/application/models/StreamSetting.php
+++ b/airtime_mvc/application/models/StreamSetting.php
@@ -31,9 +31,6 @@ class Application_Model_StreamSetting {
$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);
}
diff --git a/airtime_mvc/application/views/scripts/form/stream-setting-form.phtml b/airtime_mvc/application/views/scripts/form/stream-setting-form.phtml
index 74c904a91..d729cd27e 100644
--- a/airtime_mvc/application/views/scripts/form/stream-setting-form.phtml
+++ b/airtime_mvc/application/views/scripts/form/stream-setting-form.phtml
@@ -76,39 +76,9 @@
-
The following info will be displayed to listeners in their media player:
-
-
-
-
-
- element->getElement('genre')?>
- element->getElement('genre')->hasErrors()) : ?>
-
- element->getElement('genre')->getMessages() as $error): ?>
-
-
-
-
-
-
-
-
-
-
- element->getElement('url')?>
- element->getElement('url')->hasErrors()) : ?>
-
- element->getElement('url')->getMessages() as $error): ?>
-
-
-
-
-
-
@@ -122,12 +92,37 @@
-
+
+
+
+
+ element->getElement('url')?>
+ element->getElement('url')->hasErrors()) : ?>
+
+ element->getElement('url')->getMessages() as $error): ?>
+
+
+
+
+
+
+
+
+
+ element->getElement('genre')?>
+ element->getElement('genre')->hasErrors()) : ?>
+
+ element->getElement('genre')->getMessages() as $error): ?>
+
+
+
+
+
- element->getElement('mount')?>.element->getElement('type')->getValue()?>
+ element->getElement('mount')?>
element->getElement('mount')->hasErrors()) : ?>
element->getElement('mount')->getMessages() as $error): ?>
@@ -140,7 +135,7 @@
-
-
stream_url?>
+
diff --git a/airtime_mvc/build/sql/defaultdata.sql b/airtime_mvc/build/sql/defaultdata.sql
index e29a60543..aeb2af5fd 100644
--- a/airtime_mvc/build/sql/defaultdata.sql
+++ b/airtime_mvc/build/sql/defaultdata.sql
@@ -1,6 +1,6 @@
INSERT INTO cc_subjs ("login", "type", "pass") VALUES ('admin', 'A', md5('admin'));
-INSERT INTO cc_pref("keystr", "valstr") VALUES('stream_type', 'mp3, ogg');
+INSERT INTO cc_pref("keystr", "valstr") VALUES('stream_type', 'ogg, mp3');
INSERT INTO cc_pref("keystr", "valstr") VALUES('stream_bitrate', '24, 32, 48, 64, 96, 128, 160, 192, 224, 256, 320');
INSERT INTO cc_stream_setting ("keyname", "value", "type") VALUES ('output_sound_device', 'false', 'boolean');
diff --git a/airtime_mvc/public/js/airtime/preferences/streamsetting.js b/airtime_mvc/public/js/airtime/preferences/streamsetting.js
index 21a0195a5..523c184bb 100644
--- a/airtime_mvc/public/js/airtime/preferences/streamsetting.js
+++ b/airtime_mvc/public/js/airtime/preferences/streamsetting.js
@@ -8,23 +8,39 @@ function showErrorSections() {
}
});
}
-
-function buildStreamUrl(){
-
- $("input:[id$=-host], input:[id$=-port], input:[id$=-mount], select:[id$=-type]").change(function(){
- div = $(this).closest("div")
- host = div.find("input:[id$=-host]").val()
- port = div.find("input:[id$=-port]").val()
- mount = div.find("input:[id$=-mount]").val()
- type = div.find("select:[id$=-type]").val()
- div.find("#stream_url").html("http://"+host+":"+port+"/"+mount+"."+type)
- if($(this).attr('id').indexOf('type') != -1){
- div.find("#mount_ext").html("."+type)
+function rebuildStreamURL(ele){
+ div = ele.closest("div")
+ host = div.find("input:[id$=-host]").val()
+ port = div.find("input:[id$=-port]").val()
+ mount = div.find("input:[id$=-mount]").val()
+ streamurl = ""
+ if(div.find("select:[id$=-output]").val()=="icecast"){
+ streamurl = "http://"+host
+ if($.trim(port) != ""){
+ streamurl += ":"+port
}
- })
+ if($.trim(mount) != ""){
+ streamurl += "/"+mount
+ }
+ }else{
+ streamurl = "http://"+host+":"+port+"/"
+ }
+ div.find("#stream_url").html(streamurl)
}
$(document).ready(function() {
+ // initial stream url
+ $("dd[id=outputStreamURL-element]").each(function(){
+ rebuildStreamURL($(this))
+ })
+
+ $("input:[id$=-host], input:[id$=-port], input:[id$=-mount]").keyup(function(){
+ rebuildStreamURL($(this))
+ })
+
+ $("select:[id$=-output]").change(function(){
+ rebuildStreamURL($(this))
+ })
$('.collapsible-header').click(function() {
$(this).next().toggle('fast');
@@ -32,7 +48,17 @@ $(document).ready(function() {
return false;
}).next().hide();
+ $("select[id$=-output]").change(function(){
+ if($(this).val() == 'shoutcast'){
+ $(this).closest("div").find("#outputMountpoint-label").hide()
+ $(this).closest("div").find("#outputMountpoint-element").hide()
+ }else{
+ $(this).closest("div").find("#outputMountpoint-label").show()
+ $(this).closest("div").find("#outputMountpoint-element").show()
+ }
+ })
+
showErrorSections()
- buildStreamUrl()
+
});
\ No newline at end of file
diff --git a/python_apps/pypo/liquidsoap_scripts/ls_lib.liq b/python_apps/pypo/liquidsoap_scripts/ls_lib.liq
index e5cffa293..f16a3e134 100644
--- a/python_apps/pypo/liquidsoap_scripts/ls_lib.liq
+++ b/python_apps/pypo/liquidsoap_scripts/ls_lib.liq
@@ -110,7 +110,8 @@ def output_to(output_type, type, bitrate, host, port, pass, mount_point, url, de
restart = true,
restart_delay = 5,
url = url,
- genre = genre)
+ genre = genre,
+ name = description)
if bitrate == 24 then
ignore(output.shoutcast(%mp3(bitrate = 24),s))
elsif bitrate == 32 then