gonzopi

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

commit 14121f850990a04f3d74bae43fc72eb7ba7c8215
parent 698767481f29217ac81132f1db258516fbf5cecd
Author: rbckman <rob@tarina.org>
Date:   Thu,  9 May 2024 22:03:00 +0100

finally some tunings on ui

Diffstat:
Mgonzopi.py | 20+++++++++++++-------
Msrv/gonzopiserver.py | 30++++++++++++++++++++++--------
Msrv/templates/index.html | 4+++-
3 files changed, 38 insertions(+), 16 deletions(-)

diff --git a/gonzopi.py b/gonzopi.py @@ -2695,9 +2695,11 @@ def namesomething(what, readymadeinput): #-------------New film---------------- def nameyourfilm(filmfolder, filmname, abc, newfilm): + filmcount=len(getfilms(filmfolder)) oldfilmname = filmname - if newfilm == True: - filmname = '' + filmname = 'reel_'+str(filmcount).zfill(3) + #if newfilm == True: + # filmname = '' pressed = '' buttonpressed = '' buttontime = time.time() @@ -5048,7 +5050,7 @@ def getbutton(lastbutton, buttonpressed, buttontime, holdbutton): pressed = 'remove' elif event == 'KEY_BACKSPACE': pressed = 'remove' - elif event == 'P' or (readbus2 == 245 and readbus == 191): + elif event == 'N' or (readbus2 == 245 and readbus == 191): pressed = 'peak' elif event == 'S' or (readbus2 == 245 and readbus == 223): pressed = 'screen' @@ -5058,7 +5060,7 @@ def getbutton(lastbutton, buttonpressed, buttontime, holdbutton): pressed = 'changemode' elif event == 'H' or (readbus2 == 245 and readbus == 247): pressed = 'showhelp' - elif event == 'I' or (readbus2 == 245 and readbus == 253): + elif event == 'P' or (readbus2 == 245 and readbus == 253): pressed = 'insert' elif event == 'C' or (readbus2 == 244): pressed = 'copy' @@ -5078,10 +5080,14 @@ def getbutton(lastbutton, buttonpressed, buttontime, holdbutton): if float(time.time() - buttontime) > 0.2 and buttonpressed == True: if holdbutton == 'up' or holdbutton == 'down' or holdbutton == 'right' or holdbutton == 'left' or holdbutton == 'shutdown' or holdbutton == 'remove': pressed = holdbutton - keydelay = 0.02 + keydelay = 0.1 if time.time() - buttontime > 2 and buttonpressed == True: - keydelay = 0.02 - if time.time() - buttontime > 4 and buttonpressed == True: + keydelay = 0.1 + if time.time() - buttontime > 6 and buttonpressed == True: + keydelay = 0.05 + if time.time() - buttontime > 8 and buttonpressed == True: + keydelay = 0.08 + if time.time() - buttontime > 10 and buttonpressed == True: keydelay = 0.01 return pressed, buttonpressed, buttontime, holdbutton, event, keydelay diff --git a/srv/gonzopiserver.py b/srv/gonzopiserver.py @@ -368,6 +368,9 @@ class api: p=0 film=None if menu != '': + scene=1 + shot=1 + take=1 for i in menu: if p == 0: selected=int(i)+3 @@ -392,20 +395,31 @@ class api: except: film=None if p == 4 and film != None: - scene=int(i.split(':')[1].split('/')[0]) + try: + scene=int(i.split(':')[1].split('/')[0]) + except: + scene=1 if p == 5 and film != None: - shot=int(i.split(':')[1].split('/')[0]) + try: + shot=int(i.split(':')[1].split('/')[0]) + except: + shot=1 if p == 6 and film != None: - take=int(i.split(':')[1].split('/')[0]) - if p > 0 and selected == 423: - menudone=menudone+'<ka style="text-decoration:none; font-size:20px;" color:fff;" href="">'+i+'</ka>' - if p > 2 and film == None: - menudone=menudone+'<ka style="text-decoration:none; font-size:20px;" color:fff;" href="">'+i+'</ka>' + try: + take=int(i.split(':')[1].split('/')[0]) + except: + take=1 + #if p > 0 and selected == 423: + #menudone=menudone+'<ka style="text-decoration:none; font-size:20px;" color:fff;" href="">'+i+'</ka>' + #if p > 2 and film == None: + #menudone=menudone+'<ka style="text-decoration:none; font-size:20px;" color:fff;" href="">'+i+'</ka>' p = p + 1 thumb = '' video = '' if film != None: - if selected == 4: + if selected == 3: + video = '/'+filmfolder + film +'/'+ film+'.mp4' + elif selected == 4: video = '/'+filmfolder + film + '/scene' + str(scene).zfill(3) + '/scene.mp4' elif selected == 5: video = '/'+filmfolder + film + '/scene' + str(scene).zfill(3) + '/shot' + str(shot).zfill(3) + '/take' + str(take).zfill(3) + '.mp4' diff --git a/srv/templates/index.html b/srv/templates/index.html @@ -104,7 +104,6 @@ $$(document).on('keydown', function (event) { } }); </script> -<input></input> connected <pre>use keyboard to control</pre> $for i in cameras: @@ -121,6 +120,9 @@ $for i in cameras: <div id="menu2" style="margin:0 auto; width:99%" ></div> <div id="menu" style="margin:0 auto; width:99%"> </div> +<br> +<input></input> + $if thumb != '': $ picture= '/'+filmfolder + name + "/scene" + str(scene).zfill(3) + "/shot" + str(shot).zfill(3) + "/picture" + str(take).zfill(3) + ".jpeg" $else: