commit b4f70c05809e47c824bbb25c48c5bc19d35a4e23
parent e1a2b52f9f8011dee1f43701b6fc0c43dee35f85
Author: rob <rob@tarina.org>
Date: Wed, 14 Dec 2022 20:48:40 +0200
mastersound
Diffstat:
1 file changed, 20 insertions(+), 4 deletions(-)
diff --git a/tarinactrl.py b/tarinactrl.py
@@ -22,8 +22,9 @@ os.system('clear')
selected = 1
camselected=0
newselected=0
+mastersound=0
recording=None
-
+sleep=0.5
##---------------Connection----------------------------------------------
@@ -91,7 +92,7 @@ menu = ["Quit","Add CAMERA","New SCENE","Sync SCENE","Ping"]
##----------------------Main loop starts-------------------------
def main(serverstatus):
- global nextstatus, selected, cameras, menu, camselected, recording
+ global nextstatus, selected, cameras, menu, camselected, recording, sleep
newselected=camselected
with term.cbreak():
val=term.inkey(timeout=0)
@@ -163,9 +164,13 @@ def main(serverstatus):
else:
sendtocamera(i,port,'REC')
recording=camselected
+ elif a == mastersound:
+ sendtocamera(i,port,'STOP')
+ time.sleep(sleep)
+ sendtocamera(i,port,'RECSOUND')
else:
sendtocamera(i,port,'PLACEHOLDER')
- a=a+1
+ a=a+1
elif event == "0":
newselected = 0
elif event == "1":
@@ -190,10 +195,21 @@ def main(serverstatus):
if c not in camerasoff:
if a == camselected:
sendtocamera(c,port,'STOP')
- sendtocamera(c,port,'PLACEHOLDER')
+ if a == mastersound:
+ time.sleep(sleep)
+ sendtocamera(c,port,'RECSOUND')
+ else:
+ sendtocamera(c,port,'PLACEHOLDER')
elif a == newselected:
+ if a == mastersound:
+ sendtocamera(c,port,'STOP')
+ time.sleep(sleep)
sendtocamera(c,port,'REC')
recording=newselected
+ elif a == mastersound:
+ sendtocamera(c,port,'STOP')
+ time.sleep(sleep)
+ sendtocamera(c,port,'RECSOUND')
else:
sendtocamera(c,port,'PLACEHOLDER')
a=a+1