CC-3412: Icecast stream name not defined

-done
This commit is contained in:
denise 2012-06-12 17:08:36 -04:00
parent 8b2353ede0
commit f3b925daa2
6 changed files with 36 additions and 7 deletions

View file

@ -136,8 +136,17 @@ class Application_Form_StreamSettingSubForm extends Zend_Form_SubForm{
$url->setAttrib('alt', 'url'); $url->setAttrib('alt', 'url');
$this->addElement($url); $this->addElement($url);
$name = new Zend_Form_Element_Text('name');
$name->setLabel("Name")
->setValue(isset($setting[$prefix.'_name'])?$setting[$prefix.'_name']:"")
->setDecorators(array('ViewHelper'));
if($disable_all){
$name->setAttrib("disabled", "disabled");
}
$this->addElement($name);
$description = new Zend_Form_Element_Text('description'); $description = new Zend_Form_Element_Text('description');
$description->setLabel("Name/Description") $description->setLabel("Description")
->setValue(isset($setting[$prefix.'_description'])?$setting[$prefix.'_description']:"") ->setValue(isset($setting[$prefix.'_description'])?$setting[$prefix.'_description']:"")
->setDecorators(array('ViewHelper')); ->setDecorators(array('ViewHelper'));
if($disable_all){ if($disable_all){

View file

@ -153,7 +153,7 @@ class Application_Model_StreamSetting {
*/ */
public static function setStreamSetting($data) public static function setStreamSetting($data)
{ {
$con = Propel::getConnection(); $con = Propel::getConnection();
foreach ($data as $key=>$d) { foreach ($data as $key=>$d) {
if ($key == "output_sound_device" || $key == "icecast_vorbis_metadata") { if ($key == "output_sound_device" || $key == "icecast_vorbis_metadata") {

View file

@ -98,6 +98,19 @@
<dt class="block-display info-block"> <dt class="block-display info-block">
The following info will be displayed to listeners in their media player: The following info will be displayed to listeners in their media player:
</dt> </dt>
<dt id="stationName-label">
<label for="stationName"><?php echo $this->element->getElement('name')->getLabel()?> :</label>
</dt>
<dd id="stationName-element" class="clearfix">
<?php echo $this->element->getElement('name')?>
<?php if($this->element->getElement('name')->hasErrors()) : ?>
<ul class='errors'>
<?php foreach($this->element->getElement('name')->getMessages() as $error): ?>
<li><?php echo $error; ?></li>
<?php endforeach; ?>
</ul>
<?php endif; ?>
</dd>
<dt id="stationDescription-label"> <dt id="stationDescription-label">
<label for="stationDescription"><?php echo $this->element->getElement('description')->getLabel()?> :</label> <label for="stationDescription"><?php echo $this->element->getElement('description')->getLabel()?> :</label>
</dt> </dt>

View file

@ -1,5 +1,11 @@
INSERT INTO cc_subjs ("login", "type", "pass") VALUES ('admin', 'A', md5('admin')); INSERT INTO cc_subjs ("login", "type", "pass") VALUES ('admin', 'A', md5('admin'));
-- added in 2.2
INSERT INTO cc_stream_setting ("keyname", "value", "type") VALUES ('s1_name', 'Airtime!', 'string');
INSERT INTO cc_stream_setting ("keyname", "value", "type") VALUES ('s2_name', '', 'string');
INSERT INTO cc_stream_setting ("keyname", "value", "type") VALUES ('s3_name', '', 'string');
-- end of added in 2.2
-- added in 2.1 -- added in 2.1
INSERT INTO cc_pref("keystr", "valstr") VALUES('scheduled_play_switch', 'on'); INSERT INTO cc_pref("keystr", "valstr") VALUES('scheduled_play_switch', 'on');

View file

@ -62,7 +62,7 @@ def to_live(old,new) =
end end
def output_to(output_type, type, bitrate, host, port, pass, mount_point, url, description, genre, user, s, stream, connected) = def output_to(output_type, type, bitrate, host, port, pass, mount_point, url, description, genre, user, s, stream, connected, name) =
def on_error(msg) def on_error(msg)
connected := "false" connected := "false"
system("/usr/lib/airtime/pypo/bin/liquidsoap_scripts/notify.sh --error='#{msg}' --stream-id=#{stream} --time=#{!time} &") system("/usr/lib/airtime/pypo/bin/liquidsoap_scripts/notify.sh --error='#{msg}' --stream-id=#{stream} --time=#{!time} &")
@ -89,7 +89,8 @@ def output_to(output_type, type, bitrate, host, port, pass, mount_point, url, de
genre = genre, genre = genre,
user = !user_ref, user = !user_ref,
on_error = on_error, on_error = on_error,
on_connect = on_connect) on_connect = on_connect,
name = name)
if type == "mp3" then if type == "mp3" then
if bitrate == 24 then if bitrate == 24 then
ignore(output(%mp3(bitrate = 24),s)) ignore(output(%mp3(bitrate = 24),s))

View file

@ -258,7 +258,7 @@ if s1_enable == true then
s1_namespace := s1_mount s1_namespace := s1_mount
end end
server.register(namespace=!s1_namespace, "connected", fun (s) -> begin !s1_connected end) server.register(namespace=!s1_namespace, "connected", fun (s) -> begin !s1_connected end)
output_to(s1_output, s1_type, s1_bitrate, s1_host, s1_port, s1_pass, s1_mount, s1_url, s1_description, s1_genre, s1_user, s, "1", s1_connected) output_to(s1_output, s1_type, s1_bitrate, s1_host, s1_port, s1_pass, s1_mount, s1_url, s1_description, s1_genre, s1_user, s, "1", s1_connected, s1_name)
end end
if s2_enable == true then if s2_enable == true then
@ -268,7 +268,7 @@ if s2_enable == true then
s2_namespace := s2_mount s2_namespace := s2_mount
end end
server.register(namespace=!s2_namespace, "connected", fun (s) -> begin !s2_connected end) server.register(namespace=!s2_namespace, "connected", fun (s) -> begin !s2_connected end)
output_to(s2_output, s2_type, s2_bitrate, s2_host, s2_port, s2_pass, s2_mount, s2_url, s2_description, s2_genre, s2_user, s, "2", s2_connected) output_to(s2_output, s2_type, s2_bitrate, s2_host, s2_port, s2_pass, s2_mount, s2_url, s2_description, s2_genre, s2_user, s, "2", s2_connected, s2_name)
end end
@ -279,7 +279,7 @@ if s3_enable == true then
s3_namespace := s3_mount s3_namespace := s3_mount
end end
server.register(namespace=!s3_namespace, "connected", fun (s) -> begin !s3_connected end) server.register(namespace=!s3_namespace, "connected", fun (s) -> begin !s3_connected end)
output_to(s3_output, s3_type, s3_bitrate, s3_host, s3_port, s3_pass, s3_mount, s3_url, s3_description, s3_genre, s3_user, s, "3", s3_connected) output_to(s3_output, s3_type, s3_bitrate, s3_host, s3_port, s3_pass, s3_mount, s3_url, s3_description, s3_genre, s3_user, s, "3", s3_connected, s3_name)
end end
ignore(output.dummy(blank())) ignore(output.dummy(blank()))