]> git.sesse.net Git - casparcg/blob - source/amcp/template-graphics-commands.rst
DOCS
[casparcg] / source / amcp / template-graphics-commands.rst
1 **************************\r
2 Template Graphics Commands\r
3 **************************\r
4 \r
5 Data to templates is sent as xml, formatted as follows::\r
6 \r
7         <templateData> \r
8                 <componentData id="f0"> \r
9                         <data id="text" value="Niklas P Andersson" /> \r
10                 </componentData> \r
11                 <componentData id="f1"> \r
12                 <data id="text" value="Developer" /> \r
13                 </componentData> \r
14                 <componentData id="f2"> \r
15                         <data id="text" value="Providing an example" /> \r
16                 </componentData> \r
17         </templateData>\r
18         \r
19 The node under each componentData is sent directly into the specified component. \r
20 This makes it possible to provide completely custom data to templates. \r
21 The data-nodes in this example is just the way the default CasparCG textfield wants its data. \r
22 More information about this will be provided with the tools and ActionScript classes required to build your own templates.\r
23 A complete call to CG ADD (see below), correctly escaped and with the data above would look like this::\r
24 \r
25         CG 1 ADD 0 "demo/test" 1 "<templateData><componentData id=\"f0\"><data id=\"text\" value=\"Niklas P Andersson\"></data> </componentData><componentData id=\"f1\"><data id=\"text\" value=\"developer\"></data></componentData><componentData id=\"f2\"><data id=\"text\" value=\"Providing an example\"></data> </componentData></templateData>"\r
26 \r
27 ======\r
28 CG ADD\r
29 ======\r
30 \r
31 Prepares a template for displaying. It won't show until you call CG PLAY (unless you supply the play-on-load flag, 1 for true). \r
32 Data is either inline xml or a reference to a saved dataset.\r
33 \r
34 Syntax::\r
35 \r
36         CG [channel:int]-[layer:int] ADD [template-host-layer:int] [template:string] {[play-on-load:0|1]} {[data:string]}\r
37                 \r
38 Example::\r
39 \r
40         >> CG 1-1 ADD 10 svtnews/info 1\r
41         \r
42 =========\r
43 CG REMOVE\r
44 =========\r
45 Removes the visible template from a specific layer.\r
46 \r
47 Syntax::\r
48 \r
49         CG [channel:int]-[layer:int] REMOVE [template-host-layer:int] \r
50                 \r
51 Example::\r
52 \r
53         >> CG 1-1 REMOVE 1\r
54                 \r
55 ========\r
56 CG CLEAR\r
57 ========\r
58 Clears all layers and any state that might be stored. What this actually does behind the scene is to create a new instance of the Adobe Flash player ActiveX controller in memory.\r
59 \r
60 Syntax::\r
61 \r
62         CG [channel:int]-[layer:int] CLEAR\r
63                 \r
64 Example::\r
65 \r
66         >> CG 1-1 CLEAR\r
67 \r
68 =======\r
69 CG PLAY\r
70 =======\r
71 Plays and displays the template in the specified layer.\r
72 \r
73 Syntax::\r
74 \r
75         CG [channel:int]-[layer:int] PLAY [template-host-layer:int] \r
76                 \r
77 Example::\r
78 \r
79         >> CG 1-1 PLAY 1\r
80 \r
81 =======\r
82 CG STOP\r
83 =======\r
84 Stops and removes the template from the specified layer. This is different than REMOVE in that the template gets a chance to animate out when it is stopped.\r
85 \r
86 Syntax::\r
87 \r
88         CG [channel:int]-[layer:int] STOP [template-host-layer:int] \r
89                 \r
90 Example::\r
91 \r
92         >> CG 1-1 STOP 1\r
93 \r
94 =======\r
95 CG NEXT\r
96 =======\r
97 Triggers a "continue" in the template on the specified layer. This is used to control animations that has multiple discreet steps.\r
98 \r
99 Syntax::\r
100 \r
101         CG [channel:int]-[layer:int] NEXT [template-host-layer:int] \r
102                 \r
103 Example::\r
104 \r
105         >> CG 1-1 NEXT 1\r
106 \r
107 =======\r
108 CG GOTO\r
109 =======\r
110 Jumps to the specified label in the template on the specified layer.\r
111 \r
112 Syntax::\r
113 \r
114         CG [channel:int]-[layer:int] GOTO [template-host-layer:int] {[label:string]}\r
115                 \r
116 Example::\r
117 \r
118         >> CG 1-1 GOTO 1 intro\r
119         \r
120 =========\r
121 CG UPDATE\r
122 =========\r
123 Sends new data to the template on specified layer. Data is either inline xml or a reference to a saved dataset (See AMCP DATA command).\r
124 \r
125 Syntax::\r
126 \r
127         CG [channel:int]-[layer:int] UPDATE [template-host-layer:int] [data:string]\r
128                 \r
129 Example::\r
130 \r
131         >> CG 1-1 UPDATE 1 "<templateData> xml or stored dataset name"\r
132         \r
133 =========\r
134 CG INVOKE\r
135 =========\r
136 Calls a custom method in the document class of the template on the specified layer. The method must return void and take no parameters.\r
137 \r
138 Syntax::\r
139 \r
140         CG [channel:int]-[layer:int] INVOKE [template-host-layer:int] [method:string]\r
141                 \r
142 Example::\r
143 \r
144         >> CG 1-1 INVOKE 1 start_intro