mirror of
https://github.com/ha7ilm/openwebrx.git
synced 2026-04-04 22:17:34 +00:00
display ensemble info
This commit is contained in:
parent
cf60932ed0
commit
87afa13b46
3 changed files with 41 additions and 16 deletions
|
|
@ -1389,6 +1389,10 @@ img.openwebrx-mirror-img
|
|||
width: 100%;
|
||||
}
|
||||
|
||||
.dab-container > * {
|
||||
margin: 2px 0;
|
||||
}
|
||||
|
||||
.dab-container label {
|
||||
display: block;
|
||||
margin: 5px 0;
|
||||
|
|
@ -1397,4 +1401,12 @@ img.openwebrx-mirror-img
|
|||
.dab-container select#dab-service-id {
|
||||
width: 100%;
|
||||
padding: 3px;
|
||||
}
|
||||
|
||||
.dab-container .dab-ensemble-id:not(:empty):before {
|
||||
content: "Ensemble ID: ";
|
||||
}
|
||||
|
||||
.dab-container .dab-ensemble-label:not(:empty):before {
|
||||
content: "Ensemble: ";
|
||||
}
|
||||
|
|
@ -562,6 +562,8 @@ function DabMetaPanel(el) {
|
|||
});
|
||||
var $container = $(
|
||||
'<div class="dab-container">' +
|
||||
'<div class="dab-auto-clear dab-ensemble-id"></div>' +
|
||||
'<div class="dab-auto-clear dab-ensemble-label"></div>' +
|
||||
'<label for="dab-service-id">DAB Service:</label>' +
|
||||
'</div>'
|
||||
);
|
||||
|
|
@ -580,6 +582,14 @@ DabMetaPanel.prototype.isSupported = function(data) {
|
|||
DabMetaPanel.prototype.update = function(data) {
|
||||
if (!this.isSupported(data)) return;
|
||||
|
||||
if ('ensemble_id' in data) {
|
||||
$(this.el).find('.dab-ensemble-id').text('0x' + parseInt(data.ensemble_id).toString(16));
|
||||
}
|
||||
|
||||
if ('ensemble_label' in data) {
|
||||
$(this.el).find('.dab-ensemble-label').text(data.ensemble_label);
|
||||
}
|
||||
|
||||
if ('programmes' in data) {
|
||||
var options = Object.entries(data.programmes).map(function(e) {
|
||||
return '<option value="' + e[0] + '">' + e[1] + '</option>';
|
||||
|
|
@ -593,6 +603,7 @@ DabMetaPanel.prototype.update = function(data) {
|
|||
|
||||
DabMetaPanel.prototype.clear = function() {
|
||||
this.service_id = 0;
|
||||
$(this.el).find('.dab-auto-clear').empty();
|
||||
this.$select.empty();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue