Merge branch 'devel' of dev.sourcefabric.org:airtime into devel
This commit is contained in:
commit
610a5da24e
|
@ -45,18 +45,21 @@ class UserController extends Zend_Controller_Action
|
||||||
if ($form->isValid($request->getPost())) {
|
if ($form->isValid($request->getPost())) {
|
||||||
|
|
||||||
$formdata = $form->getValues();
|
$formdata = $form->getValues();
|
||||||
if (isset($CC_CONFIG['demo']) && $CC_CONFIG['demo'] == 1 && $formdata['login'] == 'admin' && $formdata['user_id'] != 0) {
|
if (isset($CC_CONFIG['demo']) && $CC_CONFIG['demo'] == 1
|
||||||
|
&& $formdata['login'] == 'admin'
|
||||||
|
&& $formdata['user_id'] != 0) {
|
||||||
$this->view->successMessage = "<div class='errors'>Specific action is not allowed in demo version!</div>";
|
$this->view->successMessage = "<div class='errors'>Specific action is not allowed in demo version!</div>";
|
||||||
} elseif ($form->validateLogin($formdata)) {
|
} elseif ($form->validateLogin($formdata)) {
|
||||||
$user = new Application_Model_User($formdata['user_id']);
|
$user = new Application_Model_User($formdata['user_id']);
|
||||||
$user->setFirstName($formdata['first_name']);
|
$user->setFirstName($formdata['first_name']);
|
||||||
$user->setLastName($formdata['last_name']);
|
$user->setLastName($formdata['last_name']);
|
||||||
$user->setLogin($formdata['login']);
|
$user->setLogin($formdata['login']);
|
||||||
// We don't allow 6 x's as passwords are not allowed.
|
// We don't allow 6 x's as a password.
|
||||||
// The reason is because we that as a password placeholder
|
// The reason is because we that as a password placeholder
|
||||||
// on the client side.
|
// on the client side.
|
||||||
if ($formdata['password'] != "xxxxxx")
|
if ($formdata['password'] != "xxxxxx") {
|
||||||
$user->setPassword($formdata['password']);
|
$user->setPassword($formdata['password']);
|
||||||
|
}
|
||||||
$user->setType($formdata['type']);
|
$user->setType($formdata['type']);
|
||||||
$user->setEmail($formdata['email']);
|
$user->setEmail($formdata['email']);
|
||||||
$user->setCellPhone($formdata['cell_phone']);
|
$user->setCellPhone($formdata['cell_phone']);
|
||||||
|
|
|
@ -19,7 +19,7 @@ end
|
||||||
def append_title(m) =
|
def append_title(m) =
|
||||||
log("Using stream_format #{!stream_metadata_type}")
|
log("Using stream_format #{!stream_metadata_type}")
|
||||||
if !stream_metadata_type == 1 then
|
if !stream_metadata_type == 1 then
|
||||||
[("title", "#{!show_name} - #{m['artist']}")]
|
[("title", "#{!show_name} - #{m['artist']} - #{m['title']}")]
|
||||||
elsif !stream_metadata_type == 2 then
|
elsif !stream_metadata_type == 2 then
|
||||||
[("title", "#{!station_name} - #{!show_name}")]
|
[("title", "#{!station_name} - #{!show_name}")]
|
||||||
else
|
else
|
||||||
|
|
|
@ -50,33 +50,33 @@ queue = crossfade(queue)
|
||||||
output.dummy(fallible=true, queue)
|
output.dummy(fallible=true, queue)
|
||||||
|
|
||||||
|
|
||||||
stream_queue = switch(id="stream_queue_switch", track_sensitive=false,
|
stream_queue = switch(id="stream_queue_switch", track_sensitive=false,
|
||||||
transitions=[transition, transition],
|
transitions=[transition, transition],
|
||||||
[({!webstream_enabled},web_stream),
|
[({!webstream_enabled},web_stream),
|
||||||
({true}, queue)])
|
({true}, queue)])
|
||||||
|
|
||||||
ignore(output.dummy(stream_queue, fallible=true))
|
ignore(output.dummy(stream_queue, fallible=true))
|
||||||
|
|
||||||
server.register(namespace="vars",
|
server.register(namespace="vars",
|
||||||
"pypo_data",
|
"pypo_data",
|
||||||
fun (s) -> begin log("vars.pypo_data") pypo_data := s "Done" end)
|
fun (s) -> begin log("vars.pypo_data") pypo_data := s "Done" end)
|
||||||
server.register(namespace="vars",
|
server.register(namespace="vars",
|
||||||
"stream_metadata_type",
|
"stream_metadata_type",
|
||||||
fun (s) -> begin log("vars.stream_metadata_type") stream_metadata_type := int_of_string(s) s end)
|
fun (s) -> begin log("vars.stream_metadata_type") stream_metadata_type := int_of_string(s) s end)
|
||||||
server.register(namespace="vars",
|
server.register(namespace="vars",
|
||||||
"show_name",
|
"show_name",
|
||||||
fun (s) -> begin log("vars.show_name") show_name := s s end)
|
fun (s) -> begin log("vars.show_name") show_name := s s end)
|
||||||
server.register(namespace="vars",
|
server.register(namespace="vars",
|
||||||
"station_name",
|
"station_name",
|
||||||
fun (s) -> begin log("vars.station_name") station_name := s s end)
|
fun (s) -> begin log("vars.station_name") station_name := s s end)
|
||||||
server.register(namespace="vars",
|
server.register(namespace="vars",
|
||||||
"bootup_time",
|
"bootup_time",
|
||||||
fun (s) -> begin log("vars.bootup_time") time := s s end)
|
fun (s) -> begin log("vars.bootup_time") time := s s end)
|
||||||
server.register(namespace="streams",
|
server.register(namespace="streams",
|
||||||
"connection_status",
|
"connection_status",
|
||||||
fun (s) -> begin log("streams.connection_status") "1:#{!s1_connected},2:#{!s2_connected},3:#{!s3_connected}" end)
|
fun (s) -> begin log("streams.connection_status") "1:#{!s1_connected},2:#{!s2_connected},3:#{!s3_connected}" end)
|
||||||
server.register(namespace="vars",
|
server.register(namespace="vars",
|
||||||
"default_dj_fade",
|
"default_dj_fade",
|
||||||
fun (s) -> begin log("vars.default_dj_fade") default_dj_fade := float_of_string(s) s end)
|
fun (s) -> begin log("vars.default_dj_fade") default_dj_fade := float_of_string(s) s end)
|
||||||
|
|
||||||
server.register(namespace="dynamic_source",
|
server.register(namespace="dynamic_source",
|
||||||
|
@ -117,7 +117,7 @@ ignore(output.dummy(default, fallible=true))
|
||||||
|
|
||||||
master_dj_enabled = ref false
|
master_dj_enabled = ref false
|
||||||
live_dj_enabled = ref false
|
live_dj_enabled = ref false
|
||||||
scheduled_play_enabled = ref false
|
scheduled_play_enabled = ref false
|
||||||
|
|
||||||
def make_master_dj_available()
|
def make_master_dj_available()
|
||||||
master_dj_enabled := true
|
master_dj_enabled := true
|
||||||
|
@ -153,7 +153,7 @@ def live_dj_connect(header) =
|
||||||
update_source_status("live_dj", true)
|
update_source_status("live_dj", true)
|
||||||
end
|
end
|
||||||
|
|
||||||
def live_dj_disconnect() =
|
def live_dj_disconnect() =
|
||||||
update_source_status("live_dj", false)
|
update_source_status("live_dj", false)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -161,7 +161,7 @@ def master_dj_connect(header) =
|
||||||
update_source_status("master_dj", true)
|
update_source_status("master_dj", true)
|
||||||
end
|
end
|
||||||
|
|
||||||
def master_dj_disconnect() =
|
def master_dj_disconnect() =
|
||||||
update_source_status("master_dj", false)
|
update_source_status("master_dj", false)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -172,7 +172,7 @@ def check_master_dj_client(user,password) =
|
||||||
ret = get_process_lines("python /usr/lib/airtime/pypo/bin/liquidsoap_scripts/liquidsoap_auth.py --master #{user} #{password}")
|
ret = get_process_lines("python /usr/lib/airtime/pypo/bin/liquidsoap_scripts/liquidsoap_auth.py --master #{user} #{password}")
|
||||||
#ret has now the value of the live client (dj1,dj2, or djx), or "ERROR"/"unknown" ...
|
#ret has now the value of the live client (dj1,dj2, or djx), or "ERROR"/"unknown" ...
|
||||||
ret = list.hd(ret)
|
ret = list.hd(ret)
|
||||||
|
|
||||||
#return true to let the client transmit data, or false to tell harbor to decline
|
#return true to let the client transmit data, or false to tell harbor to decline
|
||||||
ret == "True"
|
ret == "True"
|
||||||
end
|
end
|
||||||
|
@ -188,10 +188,10 @@ end
|
||||||
|
|
||||||
def append_dj_inputs(master_harbor_input_port, master_harbor_input_mount_point, dj_harbor_input_port, dj_harbor_input_mount_point, s) =
|
def append_dj_inputs(master_harbor_input_port, master_harbor_input_mount_point, dj_harbor_input_port, dj_harbor_input_mount_point, s) =
|
||||||
if master_harbor_input_port != 0 and master_harbor_input_mount_point != "" and dj_harbor_input_port != 0 and dj_harbor_input_mount_point != "" then
|
if master_harbor_input_port != 0 and master_harbor_input_mount_point != "" and dj_harbor_input_port != 0 and dj_harbor_input_mount_point != "" then
|
||||||
master_dj = mksafe(audio_to_stereo(input.harbor(id="master_harbor", master_harbor_input_mount_point, port=master_harbor_input_port, auth=check_master_dj_client,
|
master_dj = mksafe(audio_to_stereo(input.harbor(id="master_harbor", master_harbor_input_mount_point, port=master_harbor_input_port, auth=check_master_dj_client,
|
||||||
max=40., on_connect=master_dj_connect, on_disconnect=master_dj_disconnect)))
|
max=40., on_connect=master_dj_connect, on_disconnect=master_dj_disconnect)))
|
||||||
dj_live = mksafe(audio_to_stereo(input.harbor(id="live_dj_harbor", dj_harbor_input_mount_point, port=dj_harbor_input_port, auth=check_dj_client,
|
dj_live = mksafe(audio_to_stereo(input.harbor(id="live_dj_harbor", dj_harbor_input_mount_point, port=dj_harbor_input_port, auth=check_dj_client,
|
||||||
max=40., on_connect=live_dj_connect, on_disconnect=live_dj_disconnect)))
|
max=40., on_connect=live_dj_connect, on_disconnect=live_dj_disconnect)))
|
||||||
|
|
||||||
master_dj = rewrite_metadata([("artist","Airtime"), ("title", "Master Dj")],master_dj)
|
master_dj = rewrite_metadata([("artist","Airtime"), ("title", "Master Dj")],master_dj)
|
||||||
dj_live = rewrite_metadata([("artist","Airtime"), ("title", "Live Dj")],dj_live)
|
dj_live = rewrite_metadata([("artist","Airtime"), ("title", "Live Dj")],dj_live)
|
||||||
|
@ -207,9 +207,9 @@ def append_dj_inputs(master_harbor_input_port, master_harbor_input_mount_point,
|
||||||
switch(id="master_dj_switch", track_sensitive=false, transitions=[transition, transition], [({!master_dj_enabled},master_dj), ({true}, s)])
|
switch(id="master_dj_switch", track_sensitive=false, transitions=[transition, transition], [({!master_dj_enabled},master_dj), ({true}, s)])
|
||||||
elsif dj_harbor_input_port != 0 and dj_harbor_input_mount_point != "" then
|
elsif dj_harbor_input_port != 0 and dj_harbor_input_mount_point != "" then
|
||||||
dj_live = mksafe(audio_to_stereo(input.harbor(id="live_dj_harbor", dj_harbor_input_mount_point, port=dj_harbor_input_port, auth=check_dj_client,
|
dj_live = mksafe(audio_to_stereo(input.harbor(id="live_dj_harbor", dj_harbor_input_mount_point, port=dj_harbor_input_port, auth=check_dj_client,
|
||||||
max=40., on_connect=live_dj_connect, on_disconnect=live_dj_disconnect)))
|
max=40., on_connect=live_dj_connect, on_disconnect=live_dj_disconnect)))
|
||||||
|
|
||||||
dj_live = rewrite_metadata([("artist","Airtime"), ("title", "Live Dj")],dj_live)
|
dj_live = rewrite_metadata([("artist","Airtime"), ("title", "Live Dj")],dj_live)
|
||||||
|
|
||||||
ignore(output.dummy(dj_live, fallible=true))
|
ignore(output.dummy(dj_live, fallible=true))
|
||||||
switch(id="live_dj_switch", track_sensitive=false, transitions=[transition, transition], [({!live_dj_enabled},dj_live), ({true}, s)])
|
switch(id="live_dj_switch", track_sensitive=false, transitions=[transition, transition], [({!live_dj_enabled},dj_live), ({true}, s)])
|
||||||
|
@ -218,8 +218,8 @@ def append_dj_inputs(master_harbor_input_port, master_harbor_input_mount_point,
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
s = switch(id="default_switch", track_sensitive=false,
|
s = switch(id="default_switch", track_sensitive=false,
|
||||||
transitions=[transition_default, transition],
|
transitions=[transition_default, transition],
|
||||||
[({!scheduled_play_enabled}, stream_queue),({true},default)])
|
[({!scheduled_play_enabled}, stream_queue),({true},default)])
|
||||||
s = append_dj_inputs(master_live_stream_port, master_live_stream_mp,
|
s = append_dj_inputs(master_live_stream_port, master_live_stream_mp,
|
||||||
dj_live_stream_port, dj_live_stream_mp, s)
|
dj_live_stream_port, dj_live_stream_mp, s)
|
||||||
|
@ -261,48 +261,48 @@ server.register(namespace="streams",
|
||||||
|
|
||||||
if output_sound_device then
|
if output_sound_device then
|
||||||
success = ref false
|
success = ref false
|
||||||
|
|
||||||
log(output_sound_device_type)
|
log(output_sound_device_type)
|
||||||
|
|
||||||
%ifdef output.alsa
|
%ifdef output.alsa
|
||||||
if output_sound_device_type == "ALSA" then
|
if output_sound_device_type == "ALSA" then
|
||||||
ignore(output.alsa(s))
|
ignore(output.alsa(s))
|
||||||
success := true
|
success := true
|
||||||
end
|
end
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
%ifdef output.ao
|
%ifdef output.ao
|
||||||
if output_sound_device_type == "AO" then
|
if output_sound_device_type == "AO" then
|
||||||
ignore(output.ao(s))
|
ignore(output.ao(s))
|
||||||
success := true
|
success := true
|
||||||
end
|
end
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
%ifdef output.oss
|
%ifdef output.oss
|
||||||
if output_sound_device_type == "OSS" then
|
if output_sound_device_type == "OSS" then
|
||||||
ignore(output.oss(s))
|
ignore(output.oss(s))
|
||||||
success := true
|
success := true
|
||||||
end
|
end
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
%ifdef output.portaudio
|
%ifdef output.portaudio
|
||||||
if output_sound_device_type == "Portaudio" then
|
if output_sound_device_type == "Portaudio" then
|
||||||
ignore(output.portaudio(s))
|
ignore(output.portaudio(s))
|
||||||
success := true
|
success := true
|
||||||
end
|
end
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
%ifdef output.pulseaudio
|
%ifdef output.pulseaudio
|
||||||
if output_sound_device_type == "Pulseaudio" then
|
if output_sound_device_type == "Pulseaudio" then
|
||||||
ignore(output.pulseaudio(s))
|
ignore(output.pulseaudio(s))
|
||||||
success := true
|
success := true
|
||||||
end
|
end
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
if (!success == false) then
|
if (!success == false) then
|
||||||
ignore(output.prefered(s))
|
ignore(output.prefered(s))
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
if s1_enable == true then
|
if s1_enable == true then
|
||||||
|
@ -312,8 +312,8 @@ if s1_enable == true then
|
||||||
s1_namespace := s1_mount
|
s1_namespace := s1_mount
|
||||||
end
|
end
|
||||||
server.register(namespace=!s1_namespace, "connected", fun (s) -> begin log("#{!s1_namespace}.connected") !s1_connected end)
|
server.register(namespace=!s1_namespace, "connected", fun (s) -> begin log("#{!s1_namespace}.connected") !s1_connected end)
|
||||||
output_to(s1_output, s1_type, s1_bitrate, s1_host, s1_port, s1_pass,
|
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_mount, s1_url, s1_description, s1_genre, s1_user, s, "1",
|
||||||
s1_connected, s1_name, s1_channels)
|
s1_connected, s1_name, s1_channels)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -324,10 +324,10 @@ if s2_enable == true then
|
||||||
s2_namespace := s2_mount
|
s2_namespace := s2_mount
|
||||||
end
|
end
|
||||||
server.register(namespace=!s2_namespace, "connected", fun (s) -> begin log("#{!s2_namespace}.connected") !s2_connected end)
|
server.register(namespace=!s2_namespace, "connected", fun (s) -> begin log("#{!s2_namespace}.connected") !s2_connected end)
|
||||||
output_to(s2_output, s2_type, s2_bitrate, s2_host, s2_port, s2_pass,
|
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_mount, s2_url, s2_description, s2_genre, s2_user, s, "2",
|
||||||
s2_connected, s2_name, s2_channels)
|
s2_connected, s2_name, s2_channels)
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
if s3_enable == true then
|
if s3_enable == true then
|
||||||
|
@ -337,8 +337,8 @@ if s3_enable == true then
|
||||||
s3_namespace := s3_mount
|
s3_namespace := s3_mount
|
||||||
end
|
end
|
||||||
server.register(namespace=!s3_namespace, "connected", fun (s) -> begin log("#{!s3_namespace}.connected") !s3_connected end)
|
server.register(namespace=!s3_namespace, "connected", fun (s) -> begin log("#{!s3_namespace}.connected") !s3_connected end)
|
||||||
output_to(s3_output, s3_type, s3_bitrate, s3_host, s3_port, s3_pass,
|
output_to(s3_output, s3_type, s3_bitrate, s3_host, s3_port, s3_pass,
|
||||||
s3_mount, s3_url, s3_name, s3_genre, s3_user, s, "3",
|
s3_mount, s3_url, s3_name, s3_genre, s3_user, s, "3",
|
||||||
s3_connected, s3_description, s3_channels)
|
s3_connected, s3_description, s3_channels)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue