Debian Codegraph @

gui/dialogs/video.xml

raw symbols SCIP
1 <?xml version="1.0"?>
2
3 <PropertyList>
4
5 <name>video-control</name>
6 <layout>vbox</layout>
7 <resizable>false</resizable>
8
9 <!-- titlebar -->
10 <group>
11 <layout>hbox</layout>
12
13 <text>
14 <label>Video Control</label>
15 </text>
16
17 <empty><stretch>1</stretch></empty>
18
19 <button>
20 <legend>X</legend>
21 <key>Esc</key>
22 <pref-width>20</pref-width>
23 <pref-height>20</pref-height>
24 <binding>
25 <command>dialog-close</command>
26 </binding>
27 </button>
28 </group>
29
30 <hrule/>
31
32 <group>
33 <layout>vbox</layout>
34 <text>
35 <label>Container</label>
36 </text>
37
38 <input>
39 <halign>left</halign>
40 <live>true</live>
41 <property>/sim/video/container</property>
42 <binding>
43 <command>dialog-apply</command>
44 </binding>
45 <binding>
46 <command>nasal</command>
47 <script>container_radios_set(nil);</script>
48 </binding>
49 </input>
50
51 <radio>
52 <halign>left</halign>
53 <label>MP4</label>
54 <property>/sim/gui/dialogs/video-control/container-mp4</property>
55 <value>mp4</value>
56 <live>true</live>
57 <binding>
58 <command>nasal</command>
59 <script>container_radios_set('mp4');</script>
60 </binding>
61 </radio>
62
63 <radio>
64 <halign>left</halign>
65 <label>MPEG</label>
66 <property>/sim/gui/dialogs/video-control/container-mpeg</property>
67 <value>mpeg</value>
68 <live>true</live>
69 <binding>
70 <command>nasal</command>
71 <script>container_radios_set('mpeg');</script>
72 </binding>
73 </radio>
74
75 <radio>
76 <halign>left</halign>
77 <label>MKV</label>
78 <property>/sim/gui/dialogs/video-control/container-mkv</property>
79 <value>mkv</value>
80 <live>true</live>
81 <binding>
82 <command>nasal</command>
83 <script>container_radios_set('mkv');</script>
84 </binding>
85 </radio>
86
87 <radio>
88 <halign>left</halign>
89 <label>OGV</label>
90 <property>/sim/gui/dialogs/video-control/container-ogv</property>
91 <value>ogv</value>
92 <live>true</live>
93 <binding>
94 <command>nasal</command>
95 <script>container_radios_set('ogv');</script>
96 </binding>
97 </radio>
98 </group>
99
100 <hrule/>
101
102 <group>
103 <layout>vbox</layout>
104 <text>
105 <label>Codec</label>
106 </text>
107 <input>
108 <halign>left</halign>
109 <live>true</live>
110 <property>/sim/video/codec</property>
111 <binding>
112 <command>dialog-apply</command>
113 </binding>
114 <binding>
115 <command>nasal</command>
116 <script>codec_radios_set(nil);</script>
117 </binding>
118 </input>
119
120 <radio>
121 <halign>left</halign>
122 <label>MPEG2</label>
123 <property>/sim/gui/dialogs/video-control/codec-mpeg2video</property>
124 <value>mpeg2video</value>
125 <live>true</live>
126 <binding>
127 <command>nasal</command>
128 <script>codec_radios_set('mpeg2video');</script>
129 </binding>
130 </radio>
131
132 <radio>
133 <halign>left</halign>
134 <label>H.264</label>
135 <property>/sim/gui/dialogs/video-control/codec-libx264</property>
136 <value>libx264</value>
137 <live>true</live>
138 <binding>
139 <command>nasal</command>
140 <script>codec_radios_set('libx264');</script>
141 </binding>
142 </radio>
143
144 <radio>
145 <halign>left</halign>
146 <label>H.265</label>
147 <property>/sim/gui/dialogs/video-control/codec-libx265</property>
148 <value>libx265</value>
149 <live>true</live>
150 <binding>
151 <command>nasal</command>
152 <script>codec_radios_set('libx265');</script>
153 </binding>
154 </radio>
155
156 <radio>
157 <halign>left</halign>
158 <label>VP8</label>
159 <property>/sim/gui/dialogs/video-control/codec-libvpx</property>
160 <value>libvpx</value>
161 <live>true</live>
162 <binding>
163 <command>nasal</command>
164 <script>codec_radios_set('libvpx');</script>
165 </binding>
166 </radio>
167
168 <radio>
169 <halign>left</halign>
170 <label>Theora</label>
171 <property>/sim/gui/dialogs/video-control/codec-libtheora</property>
172 <value>libtheora</value>
173 <live>true</live>
174 <binding>
175 <command>nasal</command>
176 <script>codec_radios_set('libtheora');</script>
177 </binding>
178 </radio>
179 </group>
180
181 <hrule/>
182
183 <group>
184 <layout>vbox</layout>
185 <text>
186 <label>Settings</label>
187 </text>
188
189 <group>
190 <layout>table</layout>
191 <text>
192 <row>0</row>
193 <col>0</col>
194 <halign>left</halign>
195 <label>Quality (-1 or 0..1)</label>
196 </text>
197 <input>
198 <row>0</row>
199 <col>1</col>
200 <name>quality</name>
201 <property>/sim/video/quality</property>
202 <live>true</live>
203 <binding>
204 <command>dialog-apply</command>
205 <object-name>quality</object-name>
206 </binding>
207 </input>
208 <text>
209 <row>1</row>
210 <col>0</col>
211 <halign>left</halign>
212 <label>Speed (-1 or 0..1)</label>
213 </text>
214 <input>
215 <row>1</row>
216 <col>1</col>
217 <name>speed</name>
218 <property>/sim/video/speed</property>
219 <live>true</live>
220 <binding>
221 <command>dialog-apply</command>
222 <object-name>speed</object-name>
223 </binding>
224 </input>
225 <text>
226 <row>2</row>
227 <col>0</col>
228 <halign>left</halign>
229 <label>Bitrate (bits/sec)</label>
230 </text>
231 <input>
232 <row>2</row>
233 <col>1</col>
234 <name>bitrate</name>
235 <property>/sim/video/bitrate</property>
236 <live>true</live>
237 <binding>
238 <command>dialog-apply</command>
239 <object-name>bitrate</object-name>
240 </binding>
241 </input>
242 </group>
243
244 <hrule/>
245
246 <group>
247 <layout>vbox</layout>
248 <text>
249 <label>Control</label>
250 </text>
251
252 <group>
253 <layout>hbox</layout>
254 <button>
255 <legend>Start</legend>
256 <equal>true</equal>
257 <enable>
258 <not><property>/sim/video/is-encoding</property></not>
259 </enable>
260 <binding>
261 <command>nasal</command>
262 <script>fgcommand("video-start");</script>
263 </binding>
264 <binding>
265 <command>dialog-close</command>
266 </binding>
267 </button>
268
269 <button>
270 <legend>Stop</legend>
271 <equal>true</equal>
272 <enable>
273 <property>/sim/video/is-encoding</property>
274 </enable>
275 <binding>
276 <command>nasal</command>
277 <script>fgcommand("video-stop");</script>
278 </binding>
279 </button>
280 </group>
281 </group>
282 </group>
283
284 <nasal>
285 <open><![CDATA[
286 # Code to implement radio buttons.
287 #
288 var container_radios = cmdarg().getChildren("group")[1].getChildren("radio");
289 var codec_radios = cmdarg().getChildren("group")[2].getChildren("radio");
290
291 var radios_set = func(prefix, radios, value)
292 {
293 for (var i = 0; i < size(radios); i += 1)
294 {
295 v = radios[i].getChild("value").getValue();
296 var path = "/sim/gui/dialogs/video-control/" ~ prefix ~ "-" ~ v;
297 setprop(path, v == value);
298 }
299 }
300 var codec_radios_set = func(value)
301 {
302 if (value == nil) value = getprop("/sim/video/codec");
303 radios_set("codec", codec_radios, value);
304 if (value != nil) setprop("/sim/video/codec", value);
305 }
306
307 var container_radios_set = func(value)
308 {
309 if (value == nil) value = getprop("/sim/video/container");
310 radios_set("container", container_radios, value);
311 if (value != nil) setprop("/sim/video/container", value);
312 }
313 codec_radios_set(getprop("/sim/video/codec"));
314 container_radios_set(getprop("/sim/video/container"));
315 ]]>
316 </open>
317 </nasal>
318
319 </PropertyList>