commit 414ef9546814788cbd5b8a798926b59c4b04a67c
parent 37c60b7d38d191d763bb44d64a6550f1f489b129
Author: rbckman <rob@tarina.org>
Date:   Wed, 15 Nov 2023 11:23:00 +0000
keyboard shortcuts work on tarina web
Diffstat:
4 files changed, 24 insertions(+), 12 deletions(-)
diff --git a/srv/tarinaserver.py b/srv/tarinaserver.py
@@ -52,6 +52,7 @@ session = web.session.Session(app,store,initializer={'login': 0, 'user': '', 'ba
 port=55555
 ip='0.0.0.0'
 cameras=[]
+recording = False
 
 session.randhash = hashlib.md5(str(random.getrandbits(256)).encode('utf-8')).hexdigest()
 
@@ -147,6 +148,7 @@ def counttakes(filmname, filmfolder, scene, shot):
 
 class index:
     def GET(self):
+        global recording
         films = getfilms(filmfolder)
         renderedfilms = []
         unrenderedfilms = []
@@ -155,7 +157,7 @@ class index:
                 renderedfilms.append(f[0])
             else:
                 unrenderedfilms.append(f[0])
-        i=web.input(func=None,selected=None,retake=None)
+        i=web.input(func=None,selected=None)
         if i.selected != None:
             sendtocamera(ip,port,'SELECTED:'+i.selected)
         if i.func == 'search':
@@ -168,7 +170,7 @@ class index:
         elif i.func == 'record':
             sendtocamera(ip,port,'REC')
         elif i.func == 'retake':
-            print(i.func+'fuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu')
+            print('retake')
         elif i.func == 'up':
             sendtocamera(ip,port,'UP')
         elif i.func == 'down':
@@ -187,10 +189,6 @@ class index:
             sendtocamera(ip,port,'PICTURE')
             session.randhash = hashlib.md5(str(random.getrandbits(256)).encode('utf-8')).hexdigest()
             session.reload = 1
-        if i.func != None or i.retake != None:
-            session.reload = 1
-            raise web.seeother('/')
-        time.sleep(1)
         interface=open('/dev/shm/interface','r')
         vumeter=open('/dev/shm/vumeter','r')
         menu=interface.readlines()
@@ -218,7 +216,17 @@ class index:
             take=1
             session.reload = 0
         if i.func == 'retake': 
-            sendtocamera(ip,port,'RETAKE:'+shot)
+            print(i.func+'fuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuiccccccccccccccccccccccccccccccccccccccccckkkkkkkkkkkkkkkkkkkkkkkkkk')
+            if recording == False:
+                sendtocamera(ip,port,'RETAKE:'+shot)
+                recording = True
+            else:
+                sendtocamera(ip,port,'STOPRETAKE')
+                recording = False
+        if i.func != None:
+            time.sleep(1)
+            session.reload = 1
+            raise web.seeother('/')
         thumb="/static/Videos/"+name+"/scene"+str(scene).zfill(3)+"/shot"+str(shot).zfill(3)+"/picture"+str(take).zfill(3)+".jpeg"
         print(thumb)
         if os.path.isfile(basedir+thumb) == False:
diff --git a/srv/tarinaserver.pyc b/srv/tarinaserver.pyc
Binary files differ.
diff --git a/srv/templates/base.html b/srv/templates/base.html
@@ -3,8 +3,8 @@ $def with (content)
 <HEAD>
     <meta charset="utf-8">
     <title>Tarina | video & audio recorder with glue</title>
-    <link rel="stylesheet" href="/static/style.css?v=34" type="text/css" rel="stylesheet"/>
-    <script src="http://code.jquery.com/jquery-latest.min.js" type="text/javascript"></script>
+    <link rel="stylesheet" href="/static/style.css?v=35" type="text/css" rel="stylesheet"/>
+    <script src="/static/jquery-3.7.1.min.js" type="text/javascript"></script>
 </HEAD>
 
 <BODY>
diff --git a/srv/templates/index.html b/srv/templates/index.html
@@ -25,14 +25,18 @@ $$(document).on('keydown', function (event) {
 });
 </script>
 connected 
+<pre>use keyboard to control</pre>
 $for i in cameras:
     $i
 <br>
+<div id="controls" style="display:none"> >
 <a id="VIEW" href="/?func=view">VIEW</a> <a id="UP" href="/?func=up">__UP__</a> <a id="RECORD" href="/?func=record">RECORD</a><br>
 <a id="LEFT" href="/?func=left">LEFT</a> <a id="MIDDLE" href="/?func=middle">MIDDLE</a> <a id="RIGHT" href="/?func=right">RIGHT</a><br>
 <a id="DELETE" href="/?func=delete">DELETE</a> <a id="DOWN" href="/?func=down">DOWN</a> <a id="RETAKE" href="/?func=retake">RETAKE</a><br>
 <a href="/?func=picture">PICTURE</a>
 <a href="/?func=search">SEARCH</a>
+</div>
+
 <div id="menu" style="margin:0 auto; width:99%">
 $vumetermessage
 <br>
@@ -55,11 +59,11 @@ $ take_link="static/Videos/" + name + "/scene" + str(scene).zfill(3) + "/shot" +
 $ scene_link="static/Videos/" + name + "/scene" + str(scene).zfill(3) + "/scene.mp4"
 $ film_link="static/Videos/" + name + "/" +name+ ".mp4"
 $if selected == 0:
-    <a href='$film_link'><img width="99%" src="$picture?$randhash"/></a><br>
+    <a href='$film_link'><img width="80%" src="$picture?$randhash"/></a><br>
 $elif selected == 1:
-    <a href='$scene_link'><img width="99%" src="$picture?$randhash"/></a><br>
+    <a href='$scene_link'><img width="80%" src="$picture?$randhash"/></a><br>
 $elif selected > 1:
-    <a href='$take_link'><img width="99%" src="$picture?$randhash"/></a><br>
+    <a href='$take_link'><img width="80%" src="$picture?$randhash"/></a><br>
 <br>
 $if func=='show_all_films':
     <h1>FILMS</h1>