From 1f0884701008ef54615daeae6d0925ac78333075 Mon Sep 17 00:00:00 2001 From: derpeter Date: Thu, 28 Jun 2018 16:41:09 +0200 Subject: [PATCH] updated fusoin18 --- fusion18/__init__.py | 98 ++++++++++++++++++++++---------------- fusion18/artwork/intro.svg | 16 +++---- 2 files changed, 66 insertions(+), 48 deletions(-) diff --git a/fusion18/__init__.py b/fusion18/__init__.py index a70d27d..0a75727 100644 --- a/fusion18/__init__.py +++ b/fusion18/__init__.py @@ -6,67 +6,85 @@ from easing import * # URL to Schedule-XML scheduleUrl = 'https://talks.kulturkosmos.de/content18/schedule/export?exporter=core-frab-xml' + def bounce(i, min, max, frames): if i == frames - 1: return 0 - if i <= frames/2: - return easeInOutQuad(i, min, max, frames/2) + if i <= frames / 2: + return easeInOutQuad(i, min, max, frames / 2) else: - return max - easeInOutQuad(i - frames/2, min, max, frames/2) + return max - easeInOutQuad(i - frames / 2, min, max, frames / 2) + def introFrames(parameters): # 1 Sekunde Text Fadein - frames = 1*fps + frames = 1 * fps for i in range(0, frames): yield ( - ('text', 'style', 'opacity', "%.4f" % easeLinear(i, 0, 1, frames)), + ('text', 'style', 'opacity', "%.4f" % easeLinear(i, 0, 1, frames)), ) # 4 Sekunden stehen lassen - frames = 4*fps + frames = 4 * fps for i in range(0, frames): yield () + # 3 Sekunde Text Fadeout + frames = 1 * fps + for i in range(0, frames): + yield ( + ('text', 'style', 'opacity', "%.4f" % easeLinear(i, 1, -1, frames)), + ) + + # two final frames + for i in range(0, 2): + yield ( + ('text', 'style', 'opacity', "%.4f" % 0), + # ('text', 'attr', 'transform', 'translate(%.4f, 0)' % move), + ) + def outroFrames(p): # 5 Sekunden stehen bleiben - frames = 5*fps + frames = 5 * fps for i in range(0, frames): yield [] + def debug(): render( - 'intro.svg', - '../intro.ts', - introFrames, - { - '$ID': 4711, - '$TITLE': "Long Long Long title is LONG", - '$SUBTITLE': 'Long Long Long Long subtitle is LONGER', - '$SPEAKER': 'Long Name of Dr. Dr. Prof. Dr. Long Long' - } + 'intro.svg', + '../intro.ts', + introFrames, + { + '$ID': 4711, + '$TITLE': "Long Long Long title is LONG", + '$SUBTITLE': 'Long Long Long Long subtitle is LONGER', + '$SPEAKER': 'Long Name of Dr. Dr. Prof. Dr. Long Long' + } ) -# render( -# 'pause.svg', -# '../pause.ts', -# pauseFrames -# ) -# + # render( + # 'pause.svg', + # '../pause.ts', + # pauseFrames + # ) + # render( - 'outro.svg', - '../outro.ts', - outroFrames + 'outro.svg', + '../outro.ts', + outroFrames ) + def tasks(queue, args, idlist, skiplist): # iterate over all events extracted from the schedule xml-export for event in events(scheduleUrl): if event['room'] not in ('ConTent'): print("skipping room %s (%s [%s])" % (event['room'], event['title'], event['id'])) continue - if not (idlist==[]): + if not (idlist == []): if 000000 in idlist: print("skipping id (%s [%s])" % (event['title'], event['id'])) continue @@ -74,31 +92,31 @@ def tasks(queue, args, idlist, skiplist): print("skipping id (%s [%s])" % (event['title'], event['id'])) continue - # generate a task description and put it into the queue + # generate a task description and put it into the queue queue.put(Rendertask( - infile = 'intro.svg', - outfile = str(event['id'])+".ts", - sequence = introFrames, - parameters = { + infile='intro.svg', + outfile=str(event['id']) + ".ts", + sequence=introFrames, + parameters={ '$ID': event['id'], '$TITLE': event['title'], '$SUBTITLE': event['subtitle'], '$SPEAKER': event['personnames'] - } - )) + } + )) # place a task for the outro into the queue if not "out" in skiplist: queue.put(Rendertask( - infile = 'outro.svg', - outfile = 'outro.ts', - sequence = outroFrames - )) + infile='outro.svg', + outfile='outro.ts', + sequence=outroFrames + )) # place the pause-sequence into the queue if not "pause" in skiplist: queue.put(Rendertask( - infile = 'pause.svg', - outfile = 'pause.ts', - sequence = pauseFrames + infile='pause.svg', + outfile='pause.ts', + sequence=pauseFrames )) diff --git a/fusion18/artwork/intro.svg b/fusion18/artwork/intro.svg index 05e6db9..3da8061 100644 --- a/fusion18/artwork/intro.svg +++ b/fusion18/artwork/intro.svg @@ -23,7 +23,7 @@ inkscape:version="0.92.3 (2405546, 2018-03-11)">image/svg+xml $TITLE$SUBTITLE$SPEAKER$SPEAKER