- let elapsed = (Date.now() - clock_origin) * 1e-3;
- if (clock_elapsed + elapsed >= clock_limit) {
- clock_elapsed = clock_limit;
- clock_origin = Date.now();
- clock_running = false;
+ 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;
+ if (clocks[num].elapsed + elapsed >= clock_limit) {
+ console.log("limit for", num);
+ if (num == 0) {
+ clocks[num].elapsed = clock_limit;
+ clocks[num].origin = Date.now();
+ clocks[num].running = false;
+
+ if (state['autocomment_on_clock_limit'] == '1' && !comment_visible) {
+ state['comment'] = state['autocomment'];
+ setcomment();
+ showcomment();
+ }
+ }
+