]> git.sesse.net Git - ultimatescore/blobdiff - score.js
Some preliminary work on Sound Shark theming.
[ultimatescore] / score.js
index 394bb558043a7efd1beeda406824ee6e799e86aa..1d30924c2a444e2c9a49db503f94b88f284d8f3b 100644 (file)
--- a/score.js
+++ b/score.js
@@ -188,6 +188,27 @@ function hidelowerthird()
        lowerthird_visible = false;
 }
 
+function set_sound_shark_volume_db(volume_db)
+{
+       let img = document.getElementById('lowerthird-img');
+       let should_enable = (volume_db > -40.0);
+       let currently_enabled = (img.style.display === 'inline' && img.src.match(/microphone\.png$/));
+
+       if (should_enable === currently_enabled) {
+               return;
+       }
+
+       if (should_enable) {
+               img.style.display = 'inline';
+               img.src = 'generic/microphone.png';
+               document.getElementById('lowerthird-picture').className = 'lowerthird-picture lowerthird-picture-animate-in';
+               document.getElementById('lowerthird-picture-content').className = 'lowerthird-picture-content lowerthird-picture-content-animate-in';
+       } else {
+               document.getElementById('lowerthird-picture').className = 'lowerthird-picture lowerthird-picture-animate-out';
+               document.getElementById('lowerthird-picture-content').className = 'lowerthird-picture-content lowerthird-picture-content-animate-out';
+       }
+}
+
 function time_elapsed_raw(num)
 {
        let elapsed = (Date.now() - clocks[num].origin) * 1e-3;