mirror of
https://github.com/onyx-and-iris/vban-cmd-python.git
synced 2025-01-18 10:30:48 +00:00
assume vban.toml for observer example
add README to observer example
This commit is contained in:
parent
362873c5be
commit
197f81aa73
29
examples/observer/README.md
Normal file
29
examples/observer/README.md
Normal 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.
|
@ -22,7 +22,9 @@ class Observer:
|
||||
|
||||
|
||||
def main():
|
||||
with vban_cmd.api(kind_id, **opts) as vban:
|
||||
kind_id = "potato"
|
||||
|
||||
with vban_cmd.api(kind_id) as vban:
|
||||
Observer(vban)
|
||||
|
||||
while cmd := input("Press <Enter> to exit\n"):
|
||||
@ -33,11 +35,4 @@ def main():
|
||||
if __name__ == "__main__":
|
||||
logging.basicConfig(level=logging.INFO)
|
||||
|
||||
kind_id = "potato"
|
||||
opts = {
|
||||
"ip": "<ip address>",
|
||||
"streamname": "Command1",
|
||||
"port": 6980,
|
||||
}
|
||||
|
||||
main()
|
||||
|
Loading…
Reference in New Issue
Block a user