1 <?xml version="1.0" encoding="UTF-8"?>
3 A scene that tries to mimick the Flash template AdvancedTemplate1
5 <scene width="1024" height="576" xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/CasparCG/Server/2.1.0/core/producer/scene/scene.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xs="http://www.w3.org/2001/XMLSchema">
7 <variable type="number" id="time" public="true">60</variable>
8 <variable type="number" id="hangaround_time" public="true">3</variable>
10 <!-- Controlled by timeline -->
11 <variable type="number" id="plate_x">0</variable>
13 <!-- Expressions good for time value between 0 and 3599. Can be extended to support hours as well -->
14 <variable type="number" id="countdown"> ${time - floor(frame / fps)}</variable>
15 <variable type="number" id="countdown_minutes"> ${floor(variable.countdown / 60)}</variable>
16 <variable type="number" id="countdown_seconds"> ${variable.countdown % 60}</variable>
17 <variable type="string" id="countdown_minutes_text">${(variable.countdown_minutes < 10 ? "0" : "") + variable.countdown_minutes}</variable>
18 <variable type="string" id="countdown_seconds_text">${(variable.countdown_seconds < 10 ? "0" : "") + variable.countdown_seconds}</variable>
19 <variable type="string" id="countdown_text">
20 ${variable.countdown < 0
22 : variable.countdown_minutes_text + ":" + variable.countdown_seconds_text}
28 <!-- A PNG under media -->
29 <producer>scene/TemplatePack1/AdvancedTemplate1_plate</producer>
30 <x>${variable.plate_x}</x>
32 <anchor_x>${layer.plate.width}</anchor_x>
34 <layer id="countdown">
35 <!-- Text producer -->
36 <producer>[TEXT] "" 0 0 size 40 color #444444 font LiberationSans</producer>
37 <!-- follow plate with minor adjustments -->
38 <x>${layer.plate.x - 20}</x>
39 <y>${layer.plate.y + layer.plate.height - 8}</y>
40 <anchor_x>${layer.countdown.width}</anchor_x>
42 <!-- Bind the text producer's published variable text to our countdown_text -->
43 <text>${variable.countdown_text}</text>
49 <mark at="0" type="start" label="intro" />
50 <mark at="35" type="stop" />
51 <mark at="35" type="start" label="outro" />
52 <mark at="70" type="remove" />
57 stop template automatically after the timer has been at 0 for
58 ${hangaround_time} seconds
60 <goto_mark label="outro" when="${variable.countdown <= -hangaround_time}" />
64 The timeline in this template is only for animating in and out, The actual
65 countdown is done entirely through expressions.
68 <timeline variable="variable.plate_x">
69 <keyframe at="0">0</keyframe>
70 <keyframe at="35" easing="easeoutsine">250</keyframe>
71 <keyframe at="70" easing="easeinsine">0</keyframe>