commit f4126bad9ec77cf843c71bdb90f1591f5cd201d8
parent 9ac0a11c9359c9f9d4606117a731fdc64602f68a
Author: rbckman <robinbackman@gmail.com>
Date: Thu, 30 Aug 2018 00:33:56 +0300
correct label
Diffstat:
M | tarina.py | | | 55 | ++++++++++++++++++++++--------------------------------- |
1 file changed, 22 insertions(+), 33 deletions(-)
diff --git a/tarina.py b/tarina.py
@@ -1,8 +1,8 @@
#/usr/bin/env python
# -*- coding: utf-8 -*-
-#Tarina - the DIY filmmaking device
-#Copyright 2018 Robin Bäckman
+#Tarina - 3d printable camera for lazy filmmakers
+#Copyright 2016 - 2018 Robin Bäckman
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
@@ -1197,30 +1197,18 @@ def main():
disk = os.statvfs(filmfolder)
diskleft = str(disk.f_bavail * disk.f_frsize / 1024 / 1024 / 1024) + 'Gb'
- #start interface
+ #START INTERFACE
screen = startinterface()
camera = startcamera()
time.sleep(1)
#LOAD FILM AND SCENE SETTINGS
filmname = getfilms(filmfolder)[0][0]
- organize(filmfolder, filmname)
- scene, shot, take = countlast(filmname, filmfolder)
-
- #FILE & FOLDER NAMES
- #foldername = filmfolder + filmname + '/' + 'scene' + str(scene).zfill(3) + '/shot' + str(shot).zfill(3) + '/'
- #filename = 'take' + str(take).zfill(3)
#NEW FILM (IF NOTHING TO LOAD)
if filmname == '':
filmname = nameyourfilm(filmfolder, 'untitled')
- if flip == "yes":
- camera.vflip = True
- camera.hflip = True
- os.system('amixer -c 0 sset Mic ' + str(miclevel) + '%')
- os.system('amixer -c 0 sset Speaker ' + str(headphoneslevel) + '%')
-
#THUMBNAILCHECKER
oldscene = scene
oldshot = shot
@@ -1229,7 +1217,6 @@ def main():
#MAIN LOOP
while True:
-
#GPIO.output(18,backlight)
pressed, buttonpressed, buttontime, holdbutton, event, keydelay = getbutton(pressed, buttonpressed, buttontime, holdbutton)
#event = screen.getch()
@@ -1381,8 +1368,6 @@ def main():
#LOAD FILM
elif pressed == 'middle' and menu[selected] == 'LOAD':
filmname = loadfilm(filmname, filmfolder)
- organize(filmfolder, filmname)
- scene, shot, take = countlast(filmname, filmfolder)
loadfilmsettings = True
#UPDATE
@@ -1454,9 +1439,6 @@ def main():
else:
scene, shot, take = countlast(filmname, filmfolder)
loadfilmsettings = True
- organize(filmfolder, filmname)
- renderscene = True
- renderfilm = True
updatethumb = True
time.sleep(0.2)
@@ -1635,18 +1617,6 @@ def main():
if shot == 0:
shot = 1
- #Check if scene, shot, or take changed and update thumbnail
- if oldscene != scene or oldshot != shot or oldtake != take or updatethumb == True:
- if recording == False:
- print 'okey something has changed'
- overlay = removeimage(camera, overlay)
- imagename = filmfolder + filmname + '/scene' + str(scene).zfill(3) + '/shot' + str(shot).zfill(3) + '/take' + str(take).zfill(3) + '.png'
- overlay = displayimage(camera, imagename)
- oldscene = scene
- oldshot = shot
- oldtake = take
- updatethumb = False
-
#Start Recording Time
if recording == True:
t = time.time() - starttime
@@ -1657,9 +1627,28 @@ def main():
filmsettings = loadsettings(filmfolder, filmname)
camera.brightness, camera.contrast, camera.saturation, camera.shutter_speed, camera.iso, camera.awb_mode, camera.awb_gains, awb_lock, miclevel, headphoneslevel, beeps, flip, renderscene, renderfilm = filmsettings
time.sleep(0.2)
+ if flip == "yes":
+ camera.vflip = True
+ camera.hflip = True
+ os.system('amixer -c 0 sset Mic ' + str(miclevel) + '%')
+ os.system('amixer -c 0 sset Speaker ' + str(headphoneslevel) + '%')
+ organize(filmfolder, filmname)
+ scene, shot, take = countlast(filmname, filmfolder)
loadfilmsettings = False
rendermenu = True
+ #Check if scene, shot, or take changed and update thumbnail
+ if oldscene != scene or oldshot != shot or oldtake != take or updatethumb == True:
+ if recording == False:
+ print 'okey something has changed'
+ overlay = removeimage(camera, overlay)
+ imagename = filmfolder + filmname + '/scene' + str(scene).zfill(3) + '/shot' + str(shot).zfill(3) + '/take' + str(take).zfill(3) + '.png'
+ overlay = displayimage(camera, imagename)
+ oldscene = scene
+ oldshot = shot
+ oldtake = take
+ updatethumb = False
+
#If auto dont show value show auto
if camera.iso == 0:
cameraiso = 'auto'