tarina

git clone https://git.tarina.org/tarina
Log | Files | Refs | README | LICENSE

commit 059c7893eccac3e24f20e3400400b9aadda3d071
parent 94731c39ea7ee72d356dd48d4f3926cd3798d9e6
Author: rob <rob@tarina.org>
Date:   Mon, 20 Mar 2023 17:44:05 +0000

some more browser camera control features

Diffstat:
Msrv/tarinaserver.py | 6++++--
Msrv/templates/index.html | 18++++++++++++++----
Mtarina.py | 9+++++++--
3 files changed, 25 insertions(+), 8 deletions(-)

diff --git a/srv/tarinaserver.py b/srv/tarinaserver.py @@ -155,7 +155,9 @@ class index: renderedfilms.append(f[0]) else: unrenderedfilms.append(f[0]) - i=web.input(func=None) + i=web.input(func=None,selected=None) + if i.selected != None: + sendtocamera(ip,port,'SELECTED:'+i.selected) if i.func == 'search': session.cameras=[] # ping ip every 10 sec while not recording to connect cameras @@ -188,6 +190,7 @@ class index: if i.func != 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() @@ -214,7 +217,6 @@ class index: except: take=1 session.reload = 0 - time.sleep(1) thumb="/static/Videos/"+name+"/scene"+str(scene).zfill(3)+"/shot"+str(shot).zfill(3)+"/take"+str(take).zfill(3)+".jpeg" print(thumb) if os.path.isfile(basedir+thumb) == False: diff --git a/srv/templates/index.html b/srv/templates/index.html @@ -16,21 +16,31 @@ $for i in cameras: <a href="/?func=picture">PICTURE</a> <a href="/?func=search">SEARCH</a> <div id="menu" style="margin:0 auto; width:99%"> +$vumetermessage +<br> $ y=0 $for m in menu[3:]: $if selected == y: - <b><a>$m</a></b> + <b>$m[:-1]</b> $else: - $m + <a href="?selected=$y">$m[:-1]</a> $ y+=1 <br> -$vumetermessage </div> $if thumb != '': $ picture="static/Videos/" + name + "/scene" + str(scene).zfill(3) + "/shot" + str(shot).zfill(3) + "/take" + str(take).zfill(3) + ".jpeg" $else: $ picture="static/Videos/" + name + "/scene" + str(scene).zfill(3) + "/shot" + str(shot).zfill(3) + "/picture" + str(take).zfill(3) + ".jpeg" -<a href='static/Videos/$name.mp4'<img width="99%" src="$picture?$randhash"/><br> + +$ take_link="static/Videos/" + name + "/scene" + str(scene).zfill(3) + "/shot" + str(shot).zfill(3) + "/take" + str(take).zfill(3) + ".mp4" +$ scene_link="static/Videos/" + name + "/scene" + str(scene).zfill(3) + "/scene.mp4" +$ film_link="static/Videos/" + name + "/scene/" +name+ ".mp4" +$if selected == 0: + <a href='$film_link'><img width="99%" src="$picture?$randhash"/></a><br> +$if selected == 1: + <a href='$scene_link'><img width="99%" src="$picture?$randhash"/></a><br> +$else: + <a href='$take_link'><img width="99%" src="$picture?$randhash"/></a><br> <br> <h1>FILMS</h1> diff --git a/tarina.py b/tarina.py @@ -94,7 +94,7 @@ else: #MAIN def main(): - global headphoneslevel, miclevel, tarinafolder, screen, loadfilmsettings, plughw, channels, filmfolder, scene, showmenu, quality, profilelevel, i2cbuttons, menudone, soundrate, soundformat, process, serverstate, que, port, recording, onlysound, camera_model, fps_selection, fps_selected, fps, db + global headphoneslevel, miclevel, tarinafolder, screen, loadfilmsettings, plughw, channels, filmfolder, scene, showmenu, quality, profilelevel, i2cbuttons, menudone, soundrate, soundformat, process, serverstate, que, port, recording, onlysound, camera_model, fps_selection, fps_selected, fps, db, selected # Get path of the current dir, then use it as working directory: rundir = os.path.dirname(__file__) if rundir != '': @@ -3515,7 +3515,7 @@ def flushbutton(): break def getbutton(lastbutton, buttonpressed, buttontime, holdbutton): - global i2cbuttons, serverstate, nextstatus, process, que, tarinactrl_ip, recording, onlysound, filmname, filmfolder, scene, shot, take, selected, camera, loadfilmsettings + global i2cbuttons, serverstate, nextstatus, process, que, tarinactrl_ip, recording, onlysound, filmname, filmfolder, scene, shot, take, selected, camera, loadfilmsettings, selected #Check controller pressed = '' nextstatus = '' @@ -3527,6 +3527,11 @@ def getbutton(lastbutton, buttonpressed, buttontime, holdbutton): print('tarinactrl ip:' + tarinactrl_ip) process = Process(target=listenforclients, args=("0.0.0.0", port, que)) process.start() + if 'SELECTED' in nextstatus: + try: + selected=int(nextstatus.split(':')[1]) + except: + print('wtf?') if nextstatus=="PICTURE": pressed="picture" elif nextstatus=="UP":