assume vban.toml for observer example

add README to observer example
This commit is contained in:
onyx-and-iris 2022-10-18 15:20:20 +01:00
parent 362873c5be
commit 197f81aa73
2 changed files with 32 additions and 8 deletions

View File

@ -0,0 +1,29 @@
## About
Registers a class as an observer and defines a callback.
## Configure
The script assumes you have connection info saved in a config file named `vban.toml` placed next to `__main__.py`.
A valid `vban.toml` might look like this:
```toml
[connection]
ip = "gamepc.local"
port = 6980
streamname = "Command1"
```
It should be placed next to `__main__.py`.
## Use
Make sure you have established a working VBAN connection.
Run the script, then:
- change GUI parameters to trigger pdirty
- play audio through any bus to trigger ldirty
Pressing `<Enter>` will exit.

View File

@ -22,7 +22,9 @@ class Observer:
def main(): def main():
with vban_cmd.api(kind_id, **opts) as vban: kind_id = "potato"
with vban_cmd.api(kind_id) as vban:
Observer(vban) Observer(vban)
while cmd := input("Press <Enter> to exit\n"): while cmd := input("Press <Enter> to exit\n"):
@ -33,11 +35,4 @@ def main():
if __name__ == "__main__": if __name__ == "__main__":
logging.basicConfig(level=logging.INFO) logging.basicConfig(level=logging.INFO)
kind_id = "potato"
opts = {
"ip": "<ip address>",
"streamname": "Command1",
"port": 6980,
}
main() main()