loglevel INFO set for examples

This commit is contained in:
onyx-and-iris 2022-09-29 10:01:18 +01:00
parent 4c6fc2d396
commit aefde48c98
4 changed files with 18 additions and 4 deletions

View File

@ -1,3 +1,4 @@
import logging
import time import time
import voicemeeterlib import voicemeeterlib
@ -55,8 +56,9 @@ class Parser:
def main(cmds=None): def main(cmds=None):
kind_id = "banana" kind_id = "banana"
subs = {ev: False for ev in ["pdirty", "mdirty", "ldirty", "midi"]}
with voicemeeterlib.api(kind_id) as vm: with voicemeeterlib.api(kind_id, subs=subs) as vm:
parser = Parser(vm) parser = Parser(vm)
if cmds: if cmds:
res = parser.parse(cmds) res = parser.parse(cmds)
@ -72,6 +74,7 @@ def main(cmds=None):
if __name__ == "__main__": if __name__ == "__main__":
logging.basicConfig(level=logging.INFO)
cmds = ( cmds = (
"strip 0 -> mute -> on", "strip 0 -> mute -> on",
"strip 0 -> mute", "strip 0 -> mute",

View File

@ -1,3 +1,5 @@
import logging
import voicemeeterlib import voicemeeterlib
@ -45,7 +47,7 @@ class Observer:
def main(): def main():
# we only care about midi events here. # we only care about midi events here.
subs = {ev: False for ev in ["pdirty", "mdirty", "ldirty"]} subs = {ev: False for ev in ["pdirty", "mdirty"]}
with voicemeeterlib.api(kind_id, subs=subs) as vm: with voicemeeterlib.api(kind_id, subs=subs) as vm:
obs = Observer(vm, midi_btn, macrobutton) obs = Observer(vm, midi_btn, macrobutton)
obs.register() obs.register()
@ -56,6 +58,7 @@ def main():
if __name__ == "__main__": if __name__ == "__main__":
logging.basicConfig(level=logging.INFO)
kind_id = "banana" kind_id = "banana"
# leftmost M on korg nanokontrol2 in CC mode # leftmost M on korg nanokontrol2 in CC mode
midi_btn = 48 midi_btn = 48

View File

@ -1,3 +1,5 @@
import logging
import obsws_python as obs import obsws_python as obs
import voicemeeterlib import voicemeeterlib
@ -49,7 +51,10 @@ def on_current_program_scene_changed(data):
if __name__ == "__main__": if __name__ == "__main__":
with voicemeeterlib.api("potato") as vm: logging.basicConfig(level=logging.INFO)
subs = {ev: False for ev in ["pdirty", "mdirty", "midi"]}
with voicemeeterlib.api("potato", subs=subs) as vm:
cl = obs.EventClient() cl = obs.EventClient()
cl.callback.register(on_current_program_scene_changed) cl.callback.register(on_current_program_scene_changed)

View File

@ -1,3 +1,5 @@
import logging
import voicemeeterlib import voicemeeterlib
@ -31,7 +33,7 @@ class Observer:
def main(): def main():
with voicemeeterlib.api(kind_id) as vm: with voicemeeterlib.api(kind_id) as vm:
obs = Observer(vm) Observer(vm)
while cmd := input("Press <Enter> to exit\n"): while cmd := input("Press <Enter> to exit\n"):
if not cmd: if not cmd:
@ -39,6 +41,7 @@ def main():
if __name__ == "__main__": if __name__ == "__main__":
logging.basicConfig(level=logging.INFO)
kind_id = "banana" kind_id = "banana"
main() main()