2022-09-29 10:01:18 +01:00
|
|
|
import logging
|
|
|
|
|
2022-09-16 12:36:12 +01:00
|
|
|
import obsws_python as obs
|
2022-07-02 02:23:22 +01:00
|
|
|
import voicemeeterlib
|
|
|
|
|
|
|
|
|
|
|
|
def on_start():
|
|
|
|
vm.strip[0].mute = True
|
2022-07-22 15:44:36 +01:00
|
|
|
vm.strip[1].B1 = True
|
|
|
|
vm.strip[2].B2 = True
|
2022-07-02 02:23:22 +01:00
|
|
|
|
|
|
|
|
|
|
|
def on_brb():
|
|
|
|
vm.strip[7].fadeto(0, 500)
|
2022-07-22 15:44:36 +01:00
|
|
|
vm.bus[0].mute = True
|
2022-07-02 02:23:22 +01:00
|
|
|
|
|
|
|
|
|
|
|
def on_end():
|
2022-07-22 15:44:36 +01:00
|
|
|
vm.apply(
|
|
|
|
{
|
|
|
|
"strip-0": {"mute": True},
|
|
|
|
"strip-1": {"mute": True, "B1": False},
|
|
|
|
"strip-2": {"mute": True, "B1": False},
|
|
|
|
"vban-in-0": {"on": False},
|
|
|
|
}
|
|
|
|
)
|
2022-07-02 02:23:22 +01:00
|
|
|
|
|
|
|
|
|
|
|
def on_live():
|
|
|
|
vm.strip[0].mute = False
|
|
|
|
vm.strip[7].fadeto(-6, 500)
|
2022-07-22 15:44:36 +01:00
|
|
|
vm.strip[7].A3 = True
|
|
|
|
vm.vban.instream[0].on = True
|
2022-07-02 02:23:22 +01:00
|
|
|
|
|
|
|
|
2022-07-29 20:06:26 +01:00
|
|
|
def on_current_program_scene_changed(data):
|
|
|
|
scene = data.scene_name
|
2022-07-22 15:44:36 +01:00
|
|
|
print(f"Switched to scene {scene}")
|
|
|
|
|
2022-07-02 02:23:22 +01:00
|
|
|
match scene:
|
|
|
|
case "START":
|
|
|
|
on_start()
|
|
|
|
case "BRB":
|
|
|
|
on_brb()
|
|
|
|
case "END":
|
|
|
|
on_end()
|
|
|
|
case "LIVE":
|
|
|
|
on_live()
|
|
|
|
case _:
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
2022-07-29 20:06:26 +01:00
|
|
|
if __name__ == "__main__":
|
2022-09-29 10:01:18 +01:00
|
|
|
logging.basicConfig(level=logging.INFO)
|
|
|
|
|
|
|
|
subs = {ev: False for ev in ["pdirty", "mdirty", "midi"]}
|
|
|
|
with voicemeeterlib.api("potato", subs=subs) as vm:
|
2022-07-29 20:06:26 +01:00
|
|
|
cl = obs.EventClient()
|
|
|
|
cl.callback.register(on_current_program_scene_changed)
|
2022-07-02 02:23:22 +01:00
|
|
|
|
2022-07-29 20:06:26 +01:00
|
|
|
while cmd := input("<Enter> to exit\n"):
|
2022-07-02 02:23:22 +01:00
|
|
|
if not cmd:
|
|
|
|
break
|