]> git.sesse.net Git - ultimatescore/blobdiff - nageru/ultimate.lua
Fix an issue where newer browsers would squeeze the secondary scorebugs.
[ultimatescore] / nageru / ultimate.lua
index 566b465c65c1be8784e4ff258ccc252819752414..3efaa633d0fa873176fb281f5a27621f96faaeb4 100644 (file)
@@ -1,6 +1,6 @@
 -- Nageru theme for TFK mini-tournament 2017, based on the default theme.
 
-local futatabi_server = "http://10.1.0.172:9096"
+local futatabi_server = "http://10.42.0.2:9096"
 
 local state = {
        transition_start = -2.0,
@@ -724,6 +724,8 @@ function fetch_input_resolution(signals, signal_num)
        return res
 end
 
+local last_alsa_sound_shark_volume = -1   -- Always update on the first frame.
+
 function update_volume()
        if Nageru.get_num_audio_buses() < 3 or
           Nageru.get_audio_bus_name(2) ~= 'Sound Shark' then
@@ -741,6 +743,13 @@ function update_volume()
                volume_db = -100.0
        end
        cef_input:execute_javascript_async("set_sound_shark_volume_db(" .. volume_db .. ")")
+
+       local desired_alsa_sound_shark_volume = (volume_db < -40.0) and 0 or 154  -- 154 corresponds to 70% in alsamixer for this input.
+       if desired_alsa_sound_shark_volume ~= last_alsa_sound_shark_volume then
+               os.execute("amixer -D hw:CARD=USB sset 'Mix A Input 04' " .. desired_alsa_sound_shark_volume .. " &")
+               os.execute("amixer -D hw:CARD=USB sset 'Mix B Input 04' " .. desired_alsa_sound_shark_volume .. " &")
+               last_alsa_sound_shark_volume = desired_alsa_sound_shark_volume
+       end
 end
 
 local last_rate = 0.0