mirror of
https://github.com/onyx-and-iris/xair-api-python.git
synced 2024-11-21 12:30:46 +00:00
sends example added.
obs example updated to reflect updates to obsws
This commit is contained in:
parent
265c26eb67
commit
c2cf2fe523
19
examples/sends/__main__.py
Normal file
19
examples/sends/__main__.py
Normal file
@ -0,0 +1,19 @@
|
||||
import logging
|
||||
|
||||
import xair_api
|
||||
|
||||
logging.basicConfig(level=logging.DEBUG)
|
||||
|
||||
|
||||
def main():
|
||||
with xair_api.connect("XR18", ip="mixer.local") as mixer:
|
||||
for send in mixer.strip[0].send:
|
||||
send.level = -22.8
|
||||
|
||||
mixer.strip[15].send[0].level = -16.3
|
||||
mixer.auxreturn.send[0].level = -15.3
|
||||
mixer.fxreturn[0].send[0].level = -14.3
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
@ -1,12 +1,19 @@
|
||||
import obsws_python as obs
|
||||
|
||||
import xair_api
|
||||
|
||||
|
||||
class Observer:
|
||||
def __init__(self, mixer):
|
||||
self._mixer = mixer
|
||||
self._cl = obs.EventClient()
|
||||
self._cl.callback.register(self.on_current_program_scene_changed)
|
||||
self._client = obs.EventClient()
|
||||
self._client.callback.register(self.on_current_program_scene_changed)
|
||||
|
||||
def __enter__(self):
|
||||
return self
|
||||
|
||||
def __exit__(self, exc_type, exc_value, exc_traceback):
|
||||
self._client.disconnect()
|
||||
|
||||
def on_current_program_scene_changed(self, data):
|
||||
scene = data.scene_name
|
||||
@ -28,11 +35,9 @@ class Observer:
|
||||
|
||||
def main():
|
||||
with xair_api.connect("MR18", ip="mixer.local") as mixer:
|
||||
Observer(mixer)
|
||||
|
||||
while cmd := input("<Enter> to exit\n"):
|
||||
if not cmd:
|
||||
break
|
||||
with Observer(mixer):
|
||||
while _ := input("Press <Enter> to exit\n"):
|
||||
pass
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
Loading…
Reference in New Issue
Block a user