Code cleanup

This commit is contained in:
derchris 2017-05-08 11:14:05 +02:00
parent 78104a9b09
commit 8e2f9815ac

View file

@ -7,158 +7,59 @@ from easing import *
scheduleUrl = 'https://c3voc.de/share/schedules/mm17.xml' scheduleUrl = 'https://c3voc.de/share/schedules/mm17.xml'
def introFrames(args): def introFrames(args):
#fade in pillgroup0 #show for 1 second
frames = 1*fps frames = 1*fps
for i in range(0, frames): for i in range(0, frames):
yield ( yield (
('pillgroup0', 'style', 'opacity', easeInQuad(i, 0, 1, frames)),
('pillgroup1', 'style', 'opacity', 0),
('pillgroup2', 'style', 'opacity', 0),
('pillgroup3', 'style', 'opacity', 0),
('pillgroup4', 'style', 'opacity', 0),
('logotext', 'style', 'opacity', 0),
('title', 'style', 'opacity', 0), ('title', 'style', 'opacity', 0),
('subtitle', 'style', 'opacity', 0),
('persons', 'style', 'opacity', 0), ('persons', 'style', 'opacity', 0),
('persons2', 'style', 'opacity', 0), ('persons2', 'style', 'opacity', 0),
('id', 'style', 'opacity', 0),
) )
#fade in title, subtitle, persons and id
#fade in 2 seconds
frames = 2*fps frames = 2*fps
for i in range(0, frames): for i in range(0, frames):
yield( yield(
('title', 'style', 'opacity', easeInQuad(i, 0, 1, frames)), ('title', 'style', 'opacity', easeInQuad(i, 0, 1, frames)),
('subtitle', 'style', 'opacity', easeInQuad(i, 0, 1, frames)),
('persons', 'style', 'opacity', easeInQuad(i, 0, 1, frames)), ('persons', 'style', 'opacity', easeInQuad(i, 0, 1, frames)),
('persons2', 'style', 'opacity', easeInQuad(i, 0, 1, frames)), ('persons2', 'style', 'opacity', easeInQuad(i, 0, 1, frames)),
('id', 'style', 'opacity', easeInQuad(i, 0, 1, frames)),
) )
#show whole image for 2 seconds
#show for 5 seconds
frames = 5*fps frames = 5*fps
for i in range(0, frames): for i in range(0, frames):
yield( yield(
('title', 'style', 'opacity', 1), ('title', 'style', 'opacity', 1),
('subtitle', 'style', 'opacity', 1),
('persons', 'style', 'opacity', 1), ('persons', 'style', 'opacity', 1),
('persons2', 'style', 'opacity', 1), ('persons2', 'style', 'opacity', 1),
('id', 'style', 'opacity', 1),
) )
def backgroundFrames(parameters): def backgroundFrames(arg):
# 40 Sekunden #show for 1 second
frames = 1*fps
frames = 20*fps
for i in range(0, frames): for i in range(0, frames):
xshift = (i+1) * 300/frames yield tuple()
yshift = ((i+1) * (150/frames))
yield(
('pillgroup', 'attr', 'transform', 'translate(%.4f, %.4f)' % (xshift, yshift)),
)
frames = 20*fps
for i in range(0, frames):
xshift = 300 - ((i+1) * (300/frames))
yshift = 150 - ((i+1) * (150/frames))
yield(
('pillgroup', 'attr', 'transform', 'translate(%.4f, %.4f)' % (xshift, yshift)),
)
def outroFrames(args): def outroFrames(args):
#fadein outro graphics # show for 6 seconds
frames = 3*fps frames = 6*fps
for i in range(0, frames): for i in range(0, frames):
yield( yield tuple()
('pillgroup', 'style', 'opacity', easeInQuad(i, 0.01, 1, frames)),
('logotext', 'style', 'opacity', easeInQuad(i, 0.01, 1, frames)),
('c3voclogo', 'style', 'opacity', easeInQuad(i, 0.01, 1, frames)),
('c3voctext', 'style', 'opacity', easeInQuad(i, 0.01, 1, frames)),
('bysalogo', 'style', 'opacity', easeInQuad(i, 0.01, 1, frames)),
('bysatext', 'style', 'opacity', easeInQuad(i, 0.01, 1, frames)),
)
frames = 3*fps
for i in range(0, frames):
yield(
('pillgroup', 'style', 'opacity', 1),
('logotext', 'style', 'opacity', 1),
('c3voclogo', 'style', 'opacity', 1),
('c3voctext', 'style', 'opacity', 1),
('bysalogo', 'style', 'opacity', 1),
('bysatext', 'style', 'opacity', 1),
)
def pauseFrames(args): def pauseFrames(args):
#fade heartgroups # show for 1 second
frames = int(0.5*fps) frames = 1*fps
for i in range(0, frames): for i in range(0, frames):
yield ( yield tuple()
('heartgroup1', 'style', 'opacity', easeInQuad(i, 0.25, 0.75, frames)),
('heartgroup2', 'style', 'opacity', easeInQuad(i, 0.25, 0.75, frames)),
('heartgroup3', 'style', 'opacity', easeInQuad(i, 0.25, 0.75, frames)),
)
for i in range(0, frames):
yield (
('heartgroup1', 'style', 'opacity', easeInQuad(i, 1, -0.75, frames)),
('heartgroup2', 'style', 'opacity', easeInQuad(i, 1, -0.75, frames)),
('heartgroup3', 'style', 'opacity', easeInQuad(i, 1, -0.75, frames)),
)
for i in range(0, frames):
yield (
('heartgroup1', 'style', 'opacity', easeInQuad(i, 0.25, 0.75, frames)),
('heartgroup2', 'style', 'opacity', easeInQuad(i, 0.25, 0.75, frames)),
('heartgroup3', 'style', 'opacity', easeInQuad(i, 0.25, 0.75, frames)),
)
for i in range(0, frames):
yield (
('heartgroup1', 'style', 'opacity', easeInQuad(i, 1, -0.75, frames)),
('heartgroup2', 'style', 'opacity', easeInQuad(i, 1, -0.75, frames)),
('heartgroup3', 'style', 'opacity', easeInQuad(i, 1, -0.75, frames)),
)
for i in range(0, frames):
yield (
('heartgroup1', 'style', 'opacity', easeInQuad(i, 0.25, 0.75, frames)),
('heartgroup2', 'style', 'opacity', easeInQuad(i, 0.25, 0.75, frames)),
('heartgroup3', 'style', 'opacity', easeInQuad(i, 0.25, 0.75, frames)),
)
for i in range(0, frames):
yield (
('heartgroup1', 'style', 'opacity', easeInQuad(i, 1, -0.75, frames)),
('heartgroup2', 'style', 'opacity', easeInQuad(i, 1, -0.75, frames)),
('heartgroup3', 'style', 'opacity', easeInQuad(i, 1, -0.75, frames)),
)
for i in range(0, frames):
yield (
('heartgroup1', 'style', 'opacity', easeInQuad(i, 0.25, 0.75, frames)),
('heartgroup2', 'style', 'opacity', easeInQuad(i, 0.25, 0.75, frames)),
('heartgroup3', 'style', 'opacity', easeInQuad(i, 0.25, 0.75, frames)),
)
for i in range(0, frames):
yield (
('heartgroup1', 'style', 'opacity', easeInQuad(i, 1, -0.75, frames)),
('heartgroup2', 'style', 'opacity', easeInQuad(i, 1, -0.75, frames)),
('heartgroup3', 'style', 'opacity', easeInQuad(i, 1, -0.75, frames)),
)
for i in range(0, frames):
yield (
('heartgroup1', 'style', 'opacity', easeInQuad(i, 0.25, 0.75, frames)),
('heartgroup2', 'style', 'opacity', easeInQuad(i, 0.25, 0.75, frames)),
('heartgroup3', 'style', 'opacity', easeInQuad(i, 0.25, 0.75, frames)),
)
for i in range(0, frames):
yield (
('heartgroup1', 'style', 'opacity', easeInQuad(i, 1, -0.75, frames)),
('heartgroup2', 'style', 'opacity', easeInQuad(i, 1, -0.75, frames)),
('heartgroup3', 'style', 'opacity', easeInQuad(i, 1, -0.75, frames)),
)
def debug(): def debug():
render('intro.svg', render('intro.svg',
'../intro.ts', '../intro.ts',
introFrames, introFrames,
{ {
'$id': 7776, '$title': 'Make Munich Vortag',
'$title': 'StageWar live!', '$persons1': 'MM17 1',
'$subtitle': 'Metal Konzert', '$persons2': 'MM17 2'
'$persons': 'www.stagewar.de'
} }
) )
@ -198,7 +99,6 @@ def tasks(queue, args, idlist, skiplist):
parameters = { parameters = {
'$id': event['id'], '$id': event['id'],
'$title': event['title'], '$title': event['title'],
'$subtitle': event['subtitle'],
'$persons1': event['personnames'].upper(), '$persons1': event['personnames'].upper(),
'$persons2': event['personnames2'].upper() '$persons2': event['personnames2'].upper()
} }