implement dmr timeslot muting

This commit is contained in:
Jakob Ketterl
2019-06-15 19:10:33 +02:00
parent 7362e48cf3
commit 8af8f93434
4 changed files with 74 additions and 18 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

View File

@ -937,11 +937,32 @@ img.openwebrx-mirror-img
background-color: #676767;
padding: 2px 0;
color: #333;
text-align: center;
position: relative;
}
.openwebrx-meta-slot, .openwebrx-meta-slot.muted:before {
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
}
text-align: center;
.openwebrx-meta-slot.muted:before {
display: block;
content: "";
background-image: url("gfx/openwebrx-mute.png");
width:100%;
height:133px;
background-position: center;
background-repeat: no-repeat;
position: absolute;
width: 100%;
height: 100%;
top: 0;
left: 0;
background-color: rgba(0,0,0,.3);
}
.openwebrx-meta-slot.active {
@ -977,3 +998,7 @@ img.openwebrx-mirror-img
.openwebrx-meta-slot.active .openwebrx-meta-user-image.group {
background-image: url("gfx/openwebrx-groupcall.png");
}
.openwebrx-dmr-timeslot-panel * {
cursor: pointer;
}

View File

@ -619,7 +619,7 @@ function demodulator_analog_replace(subtype, for_digital)
}
demodulator_add(new demodulator_default_analog(temp_offset,subtype));
demodulator_buttons_update();
clear_metadata();
hide_digitalvoice_panels();
toggle_panel("openwebrx-panel-metadata-" + subtype, true);
}
@ -1338,8 +1338,7 @@ function update_metadata(meta) {
$(el).find(".openwebrx-dmr-target").text(target);
$(el).find(".openwebrx-meta-user-image")[group ? "addClass" : "removeClass"]("group");
} else {
$(".openwebrx-meta-panel .openwebrx-meta-autoclear").text("");
$(".openwebrx-meta-panel").removeClass("active").removeClass("sync");
clear_metadata();
}
break;
case 'YSF':
@ -1365,17 +1364,22 @@ function update_metadata(meta) {
break;
} else {
$(".openwebrx-meta-panel .openwebrx-meta-autoclear").text("");
$(".openwebrx-meta-panel").removeClass("active").removeClass("sync");
clear_metadata();
}
}
function clear_metadata() {
function hide_digitalvoice_panels() {
$(".openwebrx-meta-panel").each(function(_, p){
toggle_panel(p.id, false);
});
update_metadata({});
clear_metadata();
}
function clear_metadata() {
$(".openwebrx-meta-panel .openwebrx-meta-autoclear").text("");
$(".openwebrx-meta-slot").removeClass("active").removeClass("sync");
$(".openwebrx-dmr-timeslot-panel").removeClass("muted");
}
function add_problem(what)
@ -2327,7 +2331,7 @@ function openwebrx_init()
init_rx_photo();
open_websocket();
secondary_demod_init();
clear_metadata();
digimodes_init();
place_panels(first_show_panel);
window.setTimeout(function(){window.setInterval(debug_audio,1000);},1000);
window.addEventListener("resize",openwebrx_resize);
@ -2338,6 +2342,25 @@ function openwebrx_init()
}
function digimodes_init() {
hide_digitalvoice_panels();
// initialze DMR timeslot muting
$('.openwebrx-dmr-timeslot-panel').click(function(e) {
$(e.currentTarget).toggleClass("muted");
update_dmr_timeslot_filtering();
});
}
function update_dmr_timeslot_filtering() {
var filter = $('.openwebrx-dmr-timeslot-panel').map(function(index, el){
return (!$(el).hasClass("muted")) << index;
}).toArray().reduce(function(acc, v){
return acc | v;
}, 0);
webrx_set_param("dmr_filter", filter);
}
function iosPlayButtonClick()
{
//On iOS, we can only start audio from a click or touch event.