Skip to content
This repository has been archived by the owner on Feb 7, 2025. It is now read-only.

Commit

Permalink
fix volume ui
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexFreik committed Nov 22, 2024
1 parent 83f4643 commit 5aeadf4
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions vmix-master/vmix-info.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ function renderVmixInfo(box) {
return `
<div class="gap-1 inline-block w-fit">
<span class="${busInfo.sendToMaster === 'True' ? 'text-error' : 'text-secondary'}">${bus}:</span>
<span>${busInfo.volume}%</span>
<span>${getVolumeInfo(busInfo)}</span>
</div>`;
})
.filter((str) => str !== '')
Expand All @@ -115,7 +115,7 @@ function renderVmixInfo(box) {
(input) => `
<div class="flex items-center gap-1">
<span class="text-secondary">${input.number}.</span>
<span>${input.volume}%</span>
<span>${getVolumeInfo(input)}</span>
<span class="badge badge-success h-[16px] px-1 py-0">${input.audiobusses}</span>
<span class="whitespace-nowrap overflow-hidden inline-flex flex-1">${getResponsiveTitle(input.title)}</span>
</div>
Expand Down Expand Up @@ -163,3 +163,11 @@ function getShortInputProgress(input) {
}
return `${formatTimeMMSS(duration)} | ${formatTimeMMSS(remaining)}`;
}

function getVolumeInfo(input) {
let gain = '';
if (input.gainDb !== undefined && input.gainDb !== '0') {
gain = ' | ' + input.gainDb + 'dB';
}
return Math.round(input.volume) + '%' + gain;
}

0 comments on commit 5aeadf4

Please sign in to comment.