1 # application-specialfxproxy.tcl --
2 #
3 # Created by specialFX app when director activates special FX. Talks
4 # to special FX system and provides UI to the DC video window
5 #
6 # Copyright (c) 2000-2002 The Regents of the University of California.
7 # All rights reserved.
8 #
9 # Redistribution and use in source and binary forms, with or without
10 # modification, are permitted provided that the following conditions are met:
11 #
12 # A. Redistributions of source code must retain the above copyright notice,
13 # this list of conditions and the following disclaimer.
14 # B. Redistributions in binary form must reproduce the above copyright notice,
15 # this list of conditions and the following disclaimer in the documentation
16 # and/or other materials provided with the distribution.
17 # C. Neither the names of the copyright holders nor the names of its
18 # contributors may be used to endorse or promote products derived from this
19 # software without specific prior written permission.
20 #
21 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
22 # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23 # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24 # ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR
25 # ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26 # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
27 # SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
28 # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
29 # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31
32 import Application
33 import SSAC_Client
34 import CServiceManager
35 import CService
36 source [glob ~kpatel/mash-code/mash/tcl/psvp/fx_service/fx_client.tcl]
37
38 Class CSpecialFxProxyApplication -superclass Application
39
40 ##############################################################################
41 #
42 # CSpecialFxProxyApplication instproc InitArgs { options } {
43 #
44 # Input:
45 # options - the options object
46 #
47 # Output:
48 # none
49 #
50 # Description:
51 # Registers all options before the command line argument is parsed
52 #
53 ##############################################################################
54 CSpecialFxProxyApplication instproc InitArgs { options } {
55 $options register_option -ComPort optComPort
56 }
57
58 ##############################################################################
59 #
60 # CSpecialFxProxyApplication instproc InitResources { options } {
61 #
62 # Input:
63 # options - the options object
64 #
65 # Output:
66 # none
67 #
68 # Description:
69 # Gives defaults for options
70 #
71 ##############################################################################
72 CSpecialFxProxyApplication instproc InitResources { options } {
73 $options add_default optComPort 0
74 }
75
76
77 ##############################################################################
78 #
79 # CSpecialFxProxyApplication instproc init { argv } {
80 #
81 # Input:
82 # argv - command line input
83 #
84 # Output:
85 # none
86 #
87 # Description:
88 # Constructor for the object.
89 #
90 ##############################################################################
91 CSpecialFxProxyApplication instproc init { argv } {
92 $self next SpecialFxProxy
93
94 # initialize some variables
95 $self instvar m_inetMStudioAddr
96 $self instvar m_iMStudioPort
97 $self instvar m_inetClientAddr
98 $self instvar m_iClientPort
99
100 $self instvar m_specialFx_name
101 $self instvar m_specialFx_source1
102 $self instvar m_specialFx_source2
103 $self instvar m_specialFx_liSourceId
104 $self instvar m_i1
105 $self instvar m_i2
106 $self instvar m_o1
107 $self instvar m_latency
108 $self instvar m_text
109 $self instvar m_font
110 $self instvar m_point_size
111 $self instvar m_xpos
112 $self instvar m_ypos
113 $self instvar m_text_color
114 $self instvar m_back_color
115 $self instvar m_master_alpha
116 $self instvar m_back_alpha
117 $self instvar m_factor
118 $self instvar m_specialfx_cntrl
119
120
121 puts "got here"
122
123 # Initiailization of options
124 set options [$self options]
125 $self InitArgs $options
126 $self InitResources $options
127 $options load_preferences "SpecialFxProxy"
128 set argv [$options parse_args $argv]
129
130 # parse out the arguments
131 set m_inetMStudioAddr [lindex $argv 0]
132 set m_iMStudioPort [lindex $argv 1]
133
134 set m_inetClientAddr [lindex $argv 2]
135 set m_iClientPort [lindex $argv 3]
136
137 set m_specialFx_name [lindex $argv 4]
138 puts "name is $m_specialFx_name \n"
139
140 set m_specialFx_source1 [lindex $argv 5]
141 puts "source1 is $m_specialFx_source1"
142 set m_specialFx_source2 [lindex $argv 6]
143 puts "source2 is $m_specialFx_source2"
144 set m_specialFx_liSourceId [lindex $argv 7]
145 puts "liSourceId is $m_specialFx_liSourceId"
146
147
148 # setup the service manager stuff
149 $self instvar m_serviceManager
150 $self instvar m_lService
151
152 set iPort [$options get_option optComPort]
153 set m_serviceManager [new CServiceManager "ServiceApp" "SpecialFxProxy" \
154 $iPort]
155 $m_serviceManager Attach $self
156
157 set m_service ""
158
159 flush stdout
160
161 $self StartFx $argv
162 }
163
164
165 ##############################################################################
166 #
167 # CSpecialFxProxyApplication instproc destroy { }
168 #
169 # Input:
170 # none
171 #
172 # Output:
173 # none
174 #
175 # Description:
176 # destructor
177 #
178 ##############################################################################
179 CSpecialFxProxyApplication instproc destroy { } {
180 $self instvar m_timer
181
182 if { m_timer != "" } {
183 after cancel $m_timer
184 }
185 }
186
187
188
189 ##############################################################################
190 #
191 # CSpecialFxProxyApplication instproc NewConnection { service }
192 #
193 # Input:
194 # service - the new service that got connected
195 #
196 # Output:
197 # 1 - if handling this service
198 # 0 - otherwise
199 #
200 # Description:
201 # A call back function for the service manager. This function will be called
202 # when a new connection has just been noticed by the service manager
203 #
204 ##############################################################################
205 CSpecialFxProxyApplication instproc NewConnection { service } {
206 # this member should never be called.
207 puts "Replay Proxy got a new connection: exiting"
208 exit
209
210 return 0
211 }
212
213
214 ##############################################################################
215 #
216 # CSpecialFxProxyApplication public StartFx { arguments } {
217 #
218 # Input:
219 # arguments - the arguments that are sent by the client. It should hold
220 # the address and port of the remote client as well as all the information
221 # to start a new replay
222 #
223 # Output:
224 # none
225 #
226 # Description:
227 #
228 ##############################################################################
229 CSpecialFxProxyApplication public StartFx { arguments } {
230 $self instvar m_specialFx_name
231 $self instvar m_specialFx_source1
232 $self instvar m_specialFx_source2
233 $self instvar m_specialFx_liSourceId
234 $self instvar m_i1
235 $self instvar m_i2
236 $self instvar m_o1
237 $self instvar m_latency
238 $self instvar m_text
239 $self instvar m_font
240 $self instvar m_point_size
241 $self instvar m_xpos
242 $self instvar m_ypos
243 $self instvar m_text_color
244 $self instvar m_back_color
245 $self instvar m_master_alpha
246 $self instvar m_back_alpha
247 $self instvar m_factor
248
249
250
251
252 puts "start replay - $arguments"
253
254 ################################
255 # irene - talk to ketan at this point. set up args
256 ################################
257 $self instvar m_specialfx_cntrl
258 set m_specialfx_cntrl [fx_create $m_specialFx_name]
259 puts "handler is $m_specialfx_cntrl"
260
261 set m_i1 0
262 set m_i2 0
263 set m_o1 0
264 set m_latency 0
265 set m_text 0
266 set m_font 0
267 set m_point_size 0
268 set m_xpos 0
269 set m_ypos 0
270 set m_text_color 0
271 set m_back_color 0
272 set m_master_alpha 0
273 set m_back_alpha 0
274 set m_factor 0
275
276
277 fx_set_input_callback $m_specialfx_cntrl "$self ActivateUI "
278 fx_set_output_callback $m_specialfx_cntrl "$self ActivateUI "
279 fx_set_parameter_callback $m_specialfx_cntrl "$self ActivateUI "
280
281 puts "at the end of startfx "
282
283 }
284
285
286
287 ##############################################################################
288 #
289 # CSpecialFxProxyApplication private GetUIControl { service arguments }
290 #
291 # Input:
292 # service - the service that called this function
293 # arguments - the ui commands that will be evaluated to update the ui
294 #
295 # Output:
296 # none
297 #
298 # Description:
299 # send the control ui commands back to the client
300 #
301 ##############################################################################
302 CSpecialFxProxyApplication private GetUIControl { service arguments } {
303 $self instvar m_szPlayPauseState
304 $self instvar m_iOffset
305 $self instvar m_tmStart
306 $self instvar m_tmEnd
307 $self instvar m_specialFx_name
308 $self instvar m_specialFx_source1
309 $self instvar m_specialFx_source2
310 $self instvar m_specialFx_liSourceId
311 $self instvar m_specialfx_cntrl
312
313 set cmd ""
314
315 # for unique variable names
316 append cmd "regsub -all -- {\\\.} \$winFrame {_} __name \n"
317
318 if {$m_specialFx_name == "H261TitleSubprogram"} {
319 # Tab Buttons
320 append cmd "frame \$winFrame.tab \n"
321
322 # Inputs Button
323 append cmd "button \$winFrame.tab.inputs -text \"Inputs\" \
324 -command \"pack forget \$winFrame.inputs; \
325 pack forget \$winFrame.text; pack forget \$winFrame.color; \
326 pack forget \$winFrame.transperancy; \$winFrame.tab.inputs configure -fg black;\
327 \$winFrame.tab.text configure -fg grey; \
328 \$winFrame.tab.color configure -fg grey; \
329 \$winFrame.tab.transperancy configure -fg grey; \
330 pack \$winFrame.inputs -side top -expand 1 -fill both\" \n"
331 append cmd "pack \$winFrame.tab.inputs -side left \n"
332
333 # Text Button
334 append cmd "button \$winFrame.tab.text -text \"Text\" \
335 -command \"pack forget \$winFrame.inputs; \
336 pack forget \$winFrame.text; pack forget \$winFrame.color; \
337 pack forget \$winFrame.transperancy; \$winFrame.tab.inputs configure -fg grey;\
338 \$winFrame.tab.text configure -fg black; \
339 \$winFrame.tab.color configure -fg grey; \
340 \$winFrame.tab.transperancy configure -fg grey; \
341 pack \$winFrame.text -side top -expand 1 -fill both\" \n"
342 append cmd "pack \$winFrame.tab.text -side left \n"
343
344 # Color Button
345 append cmd "button \$winFrame.tab.color -text \"Color\" \
346 -command \"pack forget \$winFrame.inputs; \
347 pack forget \$winFrame.text; pack forget \$winFrame.color; \
348 pack forget \$winFrame.transperancy; \$winFrame.tab.inputs configure -fg grey;\
349 \$winFrame.tab.text configure -fg grey; \
350 \$winFrame.tab.color configure -fg black; \
351 \$winFrame.tab.transperancy configure -fg grey; \
352 pack \$winFrame.color -side top -expand 1 -fill both\" \n"
353 append cmd "pack \$winFrame.tab.color -side left \n"
354
355 # Transperancy Button
356 append cmd "button \$winFrame.tab.transperancy -text \"Transperancy\" \
357 -command \"pack forget \$winFrame.inputs; \
358 pack forget \$winFrame.text; pack forget \$winFrame.color; \
359 pack forget \$winFrame.transperancy; \$winFrame.tab.inputs configure -fg grey;\
360 \$winFrame.tab.text configure -fg grey; \
361 \$winFrame.tab.color configure -fg grey; \
362 \$winFrame.tab.transperancy configure -fg black; \
363 pack \$winFrame.transperancy -side top -expand 1 -fill both\" \n"
364 append cmd "pack \$winFrame.tab.transperancy -side left \n"
365
366 # Inputs Frame
367 append cmd "frame \$winFrame.inputs \n"
368
369 # i1
370 append cmd "frame \$winFrame.inputs.1 \n"
371 append cmd "global __i1 \n"
372 # append cmd "set i1\$__name \[lindex \$liSourceId 0\] \n"
373 append cmd "if {!\[info exist __i1\]} {set __i1 $m_specialFx_source1} \n"
374 append cmd "frame \$winFrame.inputs.1.i1 \n"
375 append cmd "label \$winFrame.inputs.1.i1.label -text \"i1\" \n"
376 append cmd "menubutton \$winFrame.inputs.1.i1.entry -textvariable __i1 \
377 -menu \$winFrame.inputs.1.i1.entry.menu -relief raised \n"
378 append cmd "menu \$winFrame.inputs.1.i1.entry.menu \n"
379 append cmd "pack \$winFrame.inputs.1.i1.label -side left \n"
380 append cmd "pack \$winFrame.inputs.1.i1.entry -side right -expand 1 -fill x \n"
381 append cmd "pack \$winFrame.inputs.1.i1 -side top -expand 1 -fill both \n"
382 append cmd "pack \$winFrame.inputs.1 -side left -expand 1 -fill both \n"
383
384 append cmd "foreach item \" $m_specialFx_liSourceId \" { \
385 \$winFrame.inputs.1.i1.entry.menu add radio \
386 -label \$item -variable __i1 \
387 -command \"global __i1; \
388 \$service Send UPDATE_I1_CONTROL \\\$__i1 \" \
389 } \n"
390
391 # latency
392 append cmd "frame \$winFrame.inputs.2 \n"
393 append cmd "frame \$winFrame.inputs.2.latency \n"
394 append cmd "label \$winFrame.inputs.2.latency.label -text \"latency\" \n"
395 append cmd "scale \$winFrame.inputs.2.latency.entry -orient horizontal \
396 -from 0.0 -to 1.0 -resolution \[expr (0.0-1.0) / 100.0\] \
397 -command \" \
398 \$service Send UPDATE_LATENCY_CONTROL \" \n"
399 append cmd "pack \$winFrame.inputs.2.latency.label -side left \n"
400 append cmd "pack \$winFrame.inputs.2.latency.entry -side right \
401 -expand 1 -fill both \n"
402 append cmd "pack \$winFrame.inputs.2.latency -side top -expand 1 \n"
403 append cmd "pack \$winFrame.inputs.2 -side right -expand 1 -fill both \n"
404
405 # Text Frame
406 append cmd "frame \$winFrame.text \n"
407
408 # text
409 append cmd "global __text \n"
410 append cmd "if {!\[info exist __text\]} {set __text Test} \n"
411
412 append cmd "global value \n"
413 append cmd "frame \$winFrame.text.text \n"
414 append cmd "label \$winFrame.text.text.label -text \"text\" \n"
415 append cmd "entry \$winFrame.text.text.entry -relief sunken \
416 -textvariable __text \n"
417 append cmd "button \$winFrame.text.text.button -text \"Set\" \
418 -command \"global __text;
419 \$service Send UPDATE_TEXT_CONTROL \\\" \\\$__text \\\" \" \n"
420 append cmd "pack \$winFrame.text.text.label -side left \n"
421 append cmd "pack \$winFrame.text.text.button -side right \n"
422 append cmd "pack \$winFrame.text.text.entry -side right -fill both -expand 1 \n"
423 append cmd "pack \$winFrame.text.text -side top -expand 1 -fill both \n"
424
425 # font
426 append cmd "frame \$winFrame.text.1 \n"
427 append cmd "global __font \n"
428 append cmd "global __fonts \n"
429 append cmd "set __fonts {Times-Roman Times-Bold Times-Italic \
430 Hevetica Hevetica-Narrow Hevetica-Bold} \n"
431 append cmd "set __font \[lindex \$__fonts 0\] \n"
432 append cmd "frame \$winFrame.text.1.font \n"
433 append cmd "label \$winFrame.text.1.font.label -text \"font\" \n"
434 append cmd "menubutton \$winFrame.text.1.font.entry \
435 -textvariable __font -menu \$winFrame.text.1.font.entry.menu \
436 -relief raised \n"
437 append cmd "menu \$winFrame.text.1.font.entry.menu \n"
438 append cmd "pack \$winFrame.text.1.font.label -side left \n"
439 append cmd "pack \$winFrame.text.1.font.entry -side right -expand 1 -fill both \n"
440 append cmd "pack \$winFrame.text.1.font -side left -expand 1 -fill x \n"
441
442 append cmd "foreach item \$__fonts { \
443 \$winFrame.text.1.font.entry.menu add radio -label \$item \
444 -variable __font \
445 -command \"global __font; puts \\\"font is \\\$__font \n\\\"; \
446 \$service Send UPDATE_FONT_CONTROL \\\$__font\" \
447 } \n"
448
449 # point_size
450 append cmd "frame \$winFrame.text.1.point_size \n"
451 append cmd "label \$winFrame.text.1.point_size.label -text \"point_size\" \n"
452
453 append cmd "global __pointsize \n"
454 append cmd "if {!\[info exist __pointsize\]} {set __pointsize 20} \n"
455
456 append cmd "scale \$winFrame.text.1.point_size.entry -orient horizontal \
457 -variable __pointsize \
458 -from 5 -to 40 -command \" \
459 \$service Send UPDATE_POINT_SIZE_CONTROL \" \n"
460 append cmd "pack \$winFrame.text.1.point_size.label -side left \n"
461 append cmd "pack \$winFrame.text.1.point_size.entry -side right \
462 -expand 1 -fill both \n"
463 append cmd "pack \$winFrame.text.1.point_size -side right -expand 1 \n"
464 append cmd "pack \$winFrame.text.1 -side top -expand 1 -fill both \n"
465
466 # xpos
467 append cmd "global __xpos \n"
468 append cmd "if {!\[info exist __xpos\]} {set __xpos 0.2} \n"
469
470 append cmd "frame \$winFrame.text.2 \n"
471 append cmd "frame \$winFrame.text.2.xpos \n"
472 append cmd "label \$winFrame.text.2.xpos.label -text \"xpos\" \n"
473 append cmd "scale \$winFrame.text.2.xpos.entry -orient horizontal \
474 -from 0.0 -to 1.0 -resolution \[expr (0.0-1.0) / 100.0\] \
475 -variable __xpos \
476 -command \" \
477 \$service Send UPDATE_XPOS_CONTROL \" \n"
478 append cmd "pack \$winFrame.text.2 -side top -expand 1 -fill both \n"
479 append cmd "pack \$winFrame.text.2.xpos -side right -expand 1 \n"
480 append cmd "pack \$winFrame.text.2.xpos.label -side left \n"
481 append cmd "pack \$winFrame.text.2.xpos.entry -side right -expand 1 -fill both \n"
482 append cmd "pack \$winFrame.text.2.xpos -side left -expand 1 \n"
483
484 # ypos
485 append cmd "global __ypos \n"
486 append cmd "if {!\[info exist __ypos\]} {set __ypos 0.2} \n"
487
488 append cmd "frame \$winFrame.text.2.ypos \n"
489 append cmd "label \$winFrame.text.2.ypos.label -text \"ypos\" \n"
490 append cmd "scale \$winFrame.text.2.ypos.entry -orient horizontal \
491 -from 0.0 -to 1.0 -resolution \[expr (0.0-1.0) / 100.0\] \
492 -variable __ypos \
493 -command \" \
494 \$service Send UPDATE_YPOS_CONTROL \" \n"
495 append cmd "pack \$winFrame.text.2.ypos.label -side left \n"
496 append cmd "pack \$winFrame.text.2.ypos.entry -side right -expand 1 -fill both \n"
497 append cmd "pack \$winFrame.text.2.ypos -side left -expand 1 \n"
498
499 # Color
500 append cmd "frame \$winFrame.color \n"
501
502 # text_color
503 append cmd "frame \$winFrame.color.text_color \n"
504 append cmd "label \$winFrame.color.text_color.label -text \"text_color\" \n"
505 append cmd "frame \$winFrame.color.text_color.entry \n"
506 append cmd "frame \$winFrame.color.text_color.entry.r \n"
507 append cmd "label \$winFrame.color.text_color.entry.r.label -text \"r\" \n"
508 append cmd "scale \$winFrame.color.text_color.entry.r.entry \
509 -orient horizontal -from 0 -to 255 \
510 -command \" \
511 global __valuer; global __valueg; global __valueb; global __value; \
512 set __valuer \\\[\$winFrame.color.text_color.entry.r.entry get\\\]; \
513 set __valueg \\\[\$winFrame.color.text_color.entry.g.entry get\\\]; \
514 set __valueb \\\[\$winFrame.color.text_color.entry.b.entry get\\\]; \
515 set __value \\\"\\\$__valuer \\\$__valueg \\\$__valueb\\\"; \
516 \$service Send UPDATE_TEXT_COLOR_CONTROL \\\$__value ;# \" \n"
517 append cmd "pack \$winFrame.color.text_color.entry.r.label -side left \n"
518 append cmd "pack \$winFrame.color.text_color.entry.r.entry -side right \
519 -expand 1 -fill both \n"
520
521 append cmd "frame \$winFrame.color.text_color.entry.g \n"
522 append cmd "label \$winFrame.color.text_color.entry.g.label -text \"g\" \n"
523 append cmd "scale \$winFrame.color.text_color.entry.g.entry \
524 -orient horizontal -from 0 -to 255 \
525 -command \" \
526 global __valuer; global __valueg; global __valueb; global __value; \
527 set __valuer \\\[\$winFrame.color.text_color.entry.r.entry get\\\]; \
528 set __valueg \\\[\$winFrame.color.text_color.entry.g.entry get\\\]; \
529 set __valueb \\\[\$winFrame.color.text_color.entry.b.entry get\\\]; \
530 set __value \\\"\\\$__valuer \\\$__valueg \\\$__valueb\\\"; \
531 \$service Send UPDATE_TEXT_COLOR_CONTROL \\\$__value ;# \" \n"
532 append cmd "pack \$winFrame.color.text_color.entry.g.label -side left \n"
533 append cmd "pack \$winFrame.color.text_color.entry.g.entry -side right \
534 -expand 1 -fill both \n"
535 append cmd "frame \$winFrame.color.text_color.entry.b \n"
536 append cmd "label \$winFrame.color.text_color.entry.b.label -text \"b\" \n"
537 append cmd "scale \$winFrame.color.text_color.entry.b.entry \
538 -orient horizontal -from 0 -to 255 \
539 -command \" \
540 global __valuer; global __valueg; global __valueb; global __value; \
541 set __valuer \\\[\$winFrame.color.text_color.entry.r.entry get\\\]; \
542 set __valueg \\\[\$winFrame.color.text_color.entry.g.entry get\\\]; \
543 set __valueb \\\[\$winFrame.color.text_color.entry.b.entry get\\\]; \
544 set __value \\\"\\\$__valuer \\\$__valueg \\\$__valueb\\\"; \
545 \$service Send UPDATE_TEXT_COLOR_CONTROL \\\$__value ;# \" \n"
546 append cmd "pack \$winFrame.color.text_color.entry.b.label -side left \n"
547 append cmd "pack \$winFrame.color.text_color.entry.b.entry -side right \
548 -expand 1 -fill both \n"
549
550 append cmd "pack \$winFrame.color.text_color.entry.r -side left \n"
551 append cmd "pack \$winFrame.color.text_color.entry.g -side left \n"
552 append cmd "pack \$winFrame.color.text_color.entry.b -side left \n"
553 append cmd "pack \$winFrame.color.text_color.label -side top \n"
554 append cmd "pack \$winFrame.color.text_color.entry -side top \
555 -expand 1 -fill both \n"
556 append cmd "pack \$winFrame.color.text_color -side top -expand 1 -fill both \n"
557
558 # back_color
559 append cmd "frame \$winFrame.color.back_color \n"
560 append cmd "label \$winFrame.color.back_color.label -text \"back_color\" \n"
561 append cmd "frame \$winFrame.color.back_color.entry \n"
562 append cmd "frame \$winFrame.color.back_color.entry.r \n"
563 append cmd "label \$winFrame.color.back_color.entry.r.label -text \"r\" \n"
564 append cmd "scale \$winFrame.color.back_color.entry.r.entry \
565 -orient horizontal -from 0 -to 255 \
566 -command \" \
567 global __valuer; global __valueg; global __valueb; global __value; \
568 set __valuer \\\[\$winFrame.color.back_color.entry.r.entry get\\\]; \
569 set __valueb \\\[\$winFrame.color.back_color.entry.b.entry get\\\]; \
570 set __valueg \\\[\$winFrame.color.back_color.entry.g.entry get\\\]; \
571 set __value \\\"\\\$__valuer \\\$__valueg \\\$__valueb\\\"; \
572 \$service Send UPDATE_BACK_COLOR_CONTROL \\\$__value ;# \" \n"
573 append cmd "pack \$winFrame.color.back_color.entry.r.label -side left \n"
574 append cmd "pack \$winFrame.color.back_color.entry.r.entry -side right \
575 -expand 1 -fill both \n"
576
577 append cmd "frame \$winFrame.color.back_color.entry.g \n"
578 append cmd "label \$winFrame.color.back_color.entry.g.label -text \"g\" \n"
579 append cmd "scale \$winFrame.color.back_color.entry.g.entry \
580 -orient horizontal -from 0 -to 255 \
581 -command \" \
582 global __valuer; global __valueg; global __valueb; global __value; \
583 set __valuer \\\[\$winFrame.color.back_color.entry.r.entry get\\\]; \
584 set __valueb \\\[\$winFrame.color.back_color.entry.b.entry get\\\]; \
585 set __valueg \\\[\$winFrame.color.back_color.entry.g.entry get\\\]; \
586 set __value \\\"\\\$__valuer \\\$__valueg \\\$__valueb\\\"; \
587 \$service Send UPDATE_BACK_COLOR_CONTROL \\\$__value ;# \" \n"
588 append cmd "pack \$winFrame.color.back_color.entry.g.label -side left \n"
589 append cmd "pack \$winFrame.color.back_color.entry.g.entry -side right \
590 -expand 1 -fill both \n"
591 append cmd "frame \$winFrame.color.back_color.entry.b \n"
592 append cmd "label \$winFrame.color.back_color.entry.b.label -text \"b\" \n"
593 append cmd "scale \$winFrame.color.back_color.entry.b.entry \
594 -orient horizontal -from 0 -to 255 \
595 -command \" \
596 global __valuer; global __valueg; global __valueb; global __value; \
597 set __valuer \\\[\$winFrame.color.back_color.entry.r.entry get\\\]; \
598 set __valueb \\\[\$winFrame.color.back_color.entry.b.entry get\\\]; \
599 set __valueg \\\[\$winFrame.color.back_color.entry.g.entry get\\\]; \
600 set __value \\\"\\\$__valuer \\\$__valueg \\\$__valueb\\\"; \
601 \$service Send UPDATE_BACK_COLOR_CONTROL \\\$__value ;# \" \n"
602 append cmd "pack \$winFrame.color.back_color.entry.b.label -side left \n"
603 append cmd "pack \$winFrame.color.back_color.entry.b.entry -side right \
604 -expand 1 -fill both \n"
605
606 append cmd "pack \$winFrame.color.back_color.entry.r -side left \n"
607 append cmd "pack \$winFrame.color.back_color.entry.g -side left \n"
608 append cmd "pack \$winFrame.color.back_color.entry.b -side left \n"
609 append cmd "pack \$winFrame.color.back_color.label -side top \n"
610 append cmd "pack \$winFrame.color.back_color.entry -side top \
611 -expand 1 -fill both \n"
612 append cmd "pack \$winFrame.color.back_color -side top -expand 1 -fill both \n"
613
614 # Trancperancy
615 append cmd "frame \$winFrame.transperancy \n"
616
617 # master_alpha
618 append cmd "global __master_alpha \n"
619 append cmd "if {!\[info exist __master_alpha\]} {set __master_alpha 1.0} \n"
620
621 append cmd "frame \$winFrame.transperancy.master_alpha \n"
622 append cmd "label \$winFrame.transperancy.master_alpha.label \
623 -text \"master_alpha\" \n"
624 append cmd "scale \$winFrame.transperancy.master_alpha.entry -orient horizontal \
625 -variable __master_alpha \
626 -from 0.0 -to 1.0 -resolution \[expr (0.0-1.0) / 100.0\] -command \" \
627 \$service Send UPDATE_MASTER_ALPHA_CONTROL \" \n"
628 append cmd "pack \$winFrame.transperancy.master_alpha.label \
629 -side left -anchor n \n"
630 append cmd "pack \$winFrame.transperancy.master_alpha.entry -side right \
631 -expand 1 -fill both \n"
632 append cmd "pack \$winFrame.transperancy.master_alpha -side top \
633 -expand 1 -fill both \n"
634
635 # back_alpha
636 append cmd "global __back_alpha \n"
637 append cmd "if {!\[info exist __back_alpha\]} {set __back_alpha 0.0} \n"
638
639 append cmd "frame \$winFrame.transperancy.back_alpha \n"
640 append cmd "label \$winFrame.transperancy.back_alpha.label \
641 -text \"back_alpha\" \n"
642 append cmd "scale \$winFrame.transperancy.back_alpha.entry -orient horizontal \
643 -variable __back_alpha \
644 -from 0.0 -to 1.0 -resolution \[expr (0.0-1.0) / 100.0\] -command \"\
645 \$service Send UPDATE_BACK_ALPHA_CONTROL \" \n"
646 append cmd "pack \$winFrame.transperancy.back_alpha.label \
647 -side left -anchor n \n"
648 append cmd "pack \$winFrame.transperancy.back_alpha.entry -side right \
649 -expand 1 -fill both \n"
650 append cmd "pack \$winFrame.transperancy.back_alpha -side top \
651 -expand 1 -fill both \n"
652
653 append cmd "pack \$winFrame.tab -side top -expand 1 -fill both \n"
654 append cmd "pack \$winFrame.inputs -side top -expand 1 -fill both \n"
655
656
657
658 } elseif {$m_specialFx_name == "H261FadeSubprogram"} {
659 # Tab Buttons
660 append cmd "frame \$winFrame.tab \n"
661
662 # Inputs Button
663 append cmd "button \$winFrame.tab.inputs -text \"Inputs\" \
664 -command \"pack forget \$winFrame.inputs; pack forget \$winFrame.factor; \
665 \$winFrame.tab.inputs configure -fg black; \
666 \$winFrame.tab.factor configure -fg grey; \
667 pack \$winFrame.inputs -side top -expand 1 -fill both\" \n"
668 append cmd "pack \$winFrame.tab.inputs -side left \n"
669
670 # Factor Button
671 append cmd "button \$winFrame.tab.factor -text \"Factor\" \
672 -command \"pack forget \$winFrame.inputs; pack forget \$winFrame.factor; \
673 \$winFrame.tab.inputs configure -fg grey; \
674 \$winFrame.tab.factor configure -fg black; \
675 pack \$winFrame.factor -side top -expand 1 -fill both\" \n"
676 append cmd "pack \$winFrame.tab.factor -side left \n"
677
678 # Inputs
679 append cmd "frame \$winFrame.inputs \n"
680
681 # i1
682 append cmd "frame \$winFrame.inputs.1 \n"
683 append cmd "global __i1 \n"
684 # append cmd "set __i1 \[lindex \$liSourceId 0\] \n"
685 append cmd "global __i1 \n"
686 append cmd "set __i1 $m_specialFx_source1 \n"
687 append cmd "frame \$winFrame.inputs.1.i1 \n"
688 append cmd "label \$winFrame.inputs.1.i1.label -text \"i1\" \n"
689 append cmd "menubutton \$winFrame.inputs.1.i1.entry -textvariable __i1 \
690 -menu \$winFrame.inputs.1.i1.entry.menu -relief raised \n"
691 append cmd "menu \$winFrame.inputs.1.i1.entry.menu \n"
692 append cmd "pack \$winFrame.inputs.1.i1.label -side left \n"
693 append cmd "pack \$winFrame.inputs.1.i1.entry -side right \
694 -expand 1 -fill both \n"
695 append cmd "pack \$winFrame.inputs.1.i1 -side left -expand 1 -fill both \n"
696
697 append cmd "foreach item \" $m_specialFx_liSourceId \" { \
698 \$winFrame.inputs.1.i1.entry.menu add radio -label \$item \
699 -variable __i1 -command \"global __i1; puts \\\"i1 is \\\$__i1 \n\\\"; \
700 \$service Send UPDATE_I1_CONTROL \\\$__i1 \" \
701 } \n"
702
703 # i2
704 append cmd "global __i2 \n"
705 # append cmd "set __i2 \[lindex \$liSourceId 0\] \n"
706 append cmd "global __i2 \n"
707 append cmd "set __i2 $m_specialFx_source2 \n"
708 append cmd "frame \$winFrame.inputs.1.i2 \n"
709 append cmd "label \$winFrame.inputs.1.i2.label -text \"i2\" \n"
710 append cmd "menubutton \$winFrame.inputs.1.i2.entry -textvariable __i2 \
711 -menu \$winFrame.inputs.1.i2.entry.menu -relief raised \n"
712 append cmd "menu \$winFrame.inputs.1.i2.entry.menu \n"
713 append cmd "pack \$winFrame.inputs.1.i2.label -side left \n"
714 append cmd "pack \$winFrame.inputs.1.i2.entry -side right \
715 -expand 1 -fill both \n"
716 append cmd "pack \$winFrame.inputs.1.i2 -side left -expand 1 -fill both \n"
717 append cmd "pack \$winFrame.inputs.1 -side top -expand 1 -fill both \n"
718
719 append cmd "foreach item \" $m_specialFx_liSourceId \" { \
720 \$winFrame.inputs.1.i2.entry.menu add radio -label \$item \
721 -variable __i2 -command \"global __i2; puts \\\"i2 is \\\$__i2\n\\\"; \
722 \$service Send UPDATE_I2_CONTROL \\\$__i2 \" \
723 } \n"
724
725
726 # latency
727 append cmd "frame \$winFrame.inputs.2 \n"
728 append cmd "frame \$winFrame.inputs.2.latency \n"
729 append cmd "label \$winFrame.inputs.2.latency.label -text \"latency\" \n"
730 append cmd "scale \$winFrame.inputs.2.latency.entry -orient horizontal \
731 -from 0.0 -to 1.0 -resolution \[expr (0.0-1.0) / 100.0\] \
732 -command \"\$service Send UPDATE_LATENCY_CONTROL \" \n"
733 append cmd "pack \$winFrame.inputs.2.latency.label -side left \n"
734 append cmd "pack \$winFrame.inputs.2.latency.entry -side right \
735 -expand 1 -fill both \n"
736 append cmd "pack \$winFrame.inputs.2.latency -side left -expand 1 -fill both \n"
737 append cmd "pack \$winFrame.inputs.2 -side top -expand 1 -fill both \n"
738
739 # Factor
740 append cmd "frame \$winFrame.factor \n"
741
742 # factor
743 append cmd "frame \$winFrame.factor.factor \n"
744 append cmd "scale \$winFrame.factor.factor.entry -orient horizontal \
745 -from 0.0 -to 1.0 -resolution \[expr (0.0-1.0) / 100.0\] \
746 -command \"\$service Send UPDATE_FACTOR_CONTROL \" \n"
747 append cmd "label \$winFrame.factor.factor.label -text \"factor\" \n"
748 append cmd "pack \$winFrame.factor.factor.label -side left \n"
749 append cmd "pack \$winFrame.factor.factor.entry -side right \
750 -expand 1 -fill both \n"
751 append cmd "pack \$winFrame.factor.factor -side top -expand 1 -fill both \n"
752
753
754 append cmd "pack \$winFrame.tab -side top -expand 1 -fill both \n"
755 append cmd "pack \$winFrame.inputs -side top -expand 1 -fill both \n"
756 }
757
758
759 # the play/pause button
760 # append cmd "global playPause\$__name \n"
761 # append cmd "set playPause\$__name $m_szPlayPauseState \n"
762 # append cmd "button \$winFrame.playPauseButton \
763 # -textvariable playPause\$__name \
764 # -command \"\$service Send PLAY_PAUSE \\\"\\\" \" \n"
765 #
766 # append cmd "pack \$winFrame.playPauseButton -fill y -side right \n"
767 #
768 # # the progress slider
769 # append cmd "global slider\$__name \n"
770 # append cmd "set slider\$__name [expr int($m_iOffset)] \n"
771 # append cmd "scale \$winFrame.slider -orient horizontal \
772 # -from 0 -to [expr int($m_tmEnd - $m_tmStart)] \
773 # -tickinterval [expr int(0.49 * ($m_tmEnd - $m_tmStart))] \
774 # -showvalue true \
775 # -variable slider\$__name \
776 # -command \"\$service Send MOVE_SLIDER\" \n"
777 # append cmd "pack \$winFrame.slider -side left -fill y -expand 1 \n"
778
779 #DEBUG
780 # return $cmd
781
782 $service Send CONTROL_UI $cmd
783 }
784
785 ##############################################################################
786 #
787 # CSpecialFxProxyApplication private ActivateUI { arguments }
788 #
789 # Input:
790 # service - the service that called this function
791 # arguments - the ui commands that will be evaluated to update the ui
792 #
793 # Output:
794 # none
795 #
796 # Description:
797 #
798 ##############################################################################
799 CSpecialFxProxyApplication public ActivateUI { arguments } {
800 $self instvar m_szPlayPauseState
801 $self instvar m_iOffset
802 $self instvar m_specialfx_cntrl
803 $self instvar m_i1
804 $self instvar m_i2
805 $self instvar m_o1
806 $self instvar m_latency
807 $self instvar m_text
808 $self instvar m_font
809 $self instvar m_point_size
810 $self instvar m_xpos
811 $self instvar m_ypos
812 $self instvar m_text_color
813 $self instvar m_back_color
814 $self instvar m_master_alpha
815 $self instvar m_back_alpha
816 $self instvar m_factor
817 $self instvar m_specialFx_source1
818 $self instvar m_specialFx_source2
819 $self instvar m_specialFx_name
820 $self instvar m_inetMStudioAddr
821 $self instvar m_iMStudioPort
822
823
824 set varname [lindex $arguments 0]
825 puts "in Activate UI"
826 puts "varname is $varname"
827 flush stdout
828
829 if {$varname == "i1"} {
830 if {$m_i1 == 0} {
831 puts "i1 now activated with value $m_inetMStudioAddr/$m_iMStudioPort/$m_specialFx_source1 \n"
832 fx_set_input_spec $m_specialfx_cntrl i1 $m_inetMStudioAddr/$m_iMStudioPort/$m_specialFx_source1
833 set m_i1 1
834 }
835 } elseif {$varname == "i2"} {
836 if {$m_i2 == 0} {
837 puts "i2 now activated with value $m_inetMStudioAddr/$m_iMStudioPort/$m_specialFx_source2 \n"
838 fx_set_input_spec $m_specialfx_cntrl i2 $m_inetMStudioAddr/$m_iMStudioPort/$m_specialFx_source2
839 set m_i2 1
840 }
841 } elseif {$varname == "o1"} {
842 if {$m_o1 == 0} {
843 puts "output is $m_inetMStudioAddr/$m_iMStudioPort \n"
844 fx_set_output_spec $m_specialfx_cntrl o1 $m_inetMStudioAddr/$m_iMStudioPort
845 set m_o1 1
846 }
847 } elseif {$varname == "latency"} {
848 if {$m_latency == 0} {
849 puts "latency now activated with value 0.0 \n"
850 fx_set_parameter_value $m_specialfx_cntrl latency 0.0
851 set m_latency 1
852 }
853 } elseif {$varname == "text"} {
854 if {$m_text == 0} {
855 puts "text now activated with value \"\" \n"
856 fx_set_parameter_value $m_specialfx_cntrl text "Test"
857 set m_text 1
858 }
859 } elseif {$varname == "font"} {
860 if {$m_font == 0} {
861 puts "font now activated with value Times-Roman \n"
862 fx_set_parameter_value $m_specialfx_cntrl font Times-Roman
863 set m_font 1
864 }
865 } elseif {$varname == "point_size"} {
866 if {$m_point_size == 0} {
867 puts "point_size now activated with value 5 \n"
868 fx_set_parameter_value $m_specialfx_cntrl point_size 20
869 set m_point_size 1
870 }
871 } elseif {$varname == "xpos"} {
872 if {$m_xpos == 0} {
873 puts "xpos now activated with value 0.0 \n"
874 fx_set_parameter_value $m_specialfx_cntrl xpos 0.2
875 set m_xpos 1
876 }
877 } elseif {$varname == "ypos"} {
878 if {$m_ypos == 0} {
879 puts "ypos now activated with value 0.0 \n"
880 fx_set_parameter_value $m_specialfx_cntrl ypos 0.75
881 set m_ypos 1
882 }
883 } elseif {$varname == "text_color"} {
884 if {$m_text_color == 0} {
885 puts "text_color r is now activated with value 0 \n"
886 puts "text_color g is now activated with value 0 \n"
887 puts "text_color b is now activated with value 0 \n"
888 fx_set_parameter_value $m_specialfx_cntrl text_color {235 0 128}
889 set m_text_color 1
890 }
891 } elseif {$varname == "back_color"} {
892 if {$m_back_color == 0} {
893 puts "back_color r is now activated with value 0 \n"
894 puts "back_color g is now activated with value 0 \n"
895 puts "back_color b is now activated with value 0 \n"
896 fx_set_parameter_value $m_specialfx_cntrl back_color {16 0 128}
897 set m_back_color 1
898 }
899 } elseif {$varname == "master_alpha"} {
900 if {$m_master_alpha == 0} {
901 puts "master_alpha now activated with value 0.0 \n"
902 fx_set_parameter_value $m_specialfx_cntrl master_alpha 1
903 set m_master_alpha 1
904 }
905 } elseif {$varname == "back_alpha"} {
906 if {$m_back_alpha == 0} {
907 puts "back_alpha now activated with value 0.0 \n"
908 fx_set_parameter_value $m_specialfx_cntrl back_alpha 0.0
909 set m_back_alpha 1
910 }
911 } elseif {$varname == "factor"} {
912 if {$m_factor == 0} {
913 puts "factor now activated with value 0.0 \n"
914 fx_set_parameter_value $m_specialfx_cntrl factor 0.0
915 set m_factor 1
916 }
917 }
918
919 puts " got here; $m_specialFx_name"
920 flush stdout
921
922 if {$m_specialFx_name == "H261TitleSubprogram" } {
923 if {$m_o1 == 1 && \
924 $m_i1 == 1 && \
925 $m_latency == 1 && \
926 $m_text == 1 && \
927 $m_font == 1 && \
928 $m_point_size == 1 && \
929 $m_xpos == 1 && \
930 $m_ypos == 1 && \
931 $m_text_color == 1 && \
932 $m_back_color == 1 && \
933 $m_master_alpha == 1 && \
934 $m_back_alpha == 1} {
935 fx_set_output_srcid_cb $m_specialfx_cntrl o1 "$self GetServiceId "
936 fx_status $m_specialfx_cntrl on
937 }
938 } elseif {$m_specialFx_name == "H261FadeSubprogram"} {
939 if {$m_o1 == 1 && \
940 $m_i1 == 1 && \
941 $m_i2 == 1 && \
942 $m_latency == 1 &&\
943 $m_factor == 1} {
944 fx_set_output_srcid_cb $m_specialfx_cntrl o1 "$self GetServiceId "
945 fx_status $m_specialfx_cntrl on
946 }
947 }
948
949 }
950
951
952
953 ##############################################################################
954 #
955 # CSpecialFxProxyApplication private GetServiceId { service arguments }
956 #
957 # Input:
958 # service - the service that called this function
959 # arguments - the ui commands that will be evaluated to update the ui
960 #
961 # Output:
962 # none
963 #
964 # Description:
965 #
966 ##############################################################################
967 CSpecialFxProxyApplication private GetServiceId { arguments } {
968 # start the service
969
970 $self instvar m_serviceManager
971 $self instvar m_service
972 $self instvar m_inetClientAddr
973 $self instvar m_iClientPort
974
975
976 puts " got here GetServiceId Ouptut"
977
978
979 set iSourceId [lindex $arguments 0]
980
981
982 set m_service [$m_serviceManager NewService $m_inetClientAddr \
983 $m_iClientPort "VideoService" $iSourceId]
984
985 # start special effect right now
986 # do the message mapping between com messages and member functions
987 $m_service MapMessage "GET_UI_CONTROL" $self "GetUIControl"
988 $m_service MapMessage "UPDATE_I1_CONTROL " $self "UpdateI1Control"
989 $m_service MapMessage "UPDATE_I2_CONTROL" $self "UpdateI2Control"
990 $m_service MapMessage "UPDATE_LATENCY_CONTROL" $self "UpdateLatencyControl"
991 $m_service MapMessage "UPDATE_TEXT_CONTROL" $self "UpdateTextControl"
992 $m_service MapMessage "UPDATE_FONT_CONTROL" $self "UpdateFontControl"
993 $m_service MapMessage "UPDATE_POINT_SIZE_CONTROL" $self "UpdatePointSizeControl"
994 $m_service MapMessage "UPDATE_XPOS_CONTROL" $self "UpdateXposControl"
995 $m_service MapMessage "UPDATE_YPOS_CONTROL" $self "UpdateYposControl"
996 $m_service MapMessage "UPDATE_TEXT_COLOR_CONTROL" $self "UpdateTextColorControl"
997 $m_service MapMessage "UPDATE_BACK_COLOR_CONTROL" $self "UpdateBackColorControl"
998 $m_service MapMessage "UPDATE_MASTER_ALPHA_CONTROL" $self "UpdateMasterAlphaControl"
999 $m_service MapMessage "UPDATE_BACK_ALPHA_CONTROL" $self "UpdateBackAlphaControl"
1000 $m_service MapMessage "UPDATE_FACTOR_CONTROL" $self "UpdateFactorControl"
1001 $m_service MapMessage "CLOSE_LINK" $self "CloseService"
1002
1003 }
1004
1005
1006 ##############################################################################
1007 #
1008 # CSpecialFxProxyApplication private UpdateI1Control { service arguments }
1009 #
1010 # Input:
1011 # service - the service that called this function
1012 # arguments - the value that i1 needs to be updated to
1013 #
1014 # Output:
1015 # none
1016 #
1017 # Description:
1018 #
1019 ##############################################################################
1020 CSpecialFxProxyApplication private UpdateI1Control { service arguments } {
1021 $self instvar m_specialfx_cntrl
1022 $self instvar m_inetClientAddr
1023 $self instvar m_iClientPort
1024
1025 set $__source [lindex $arguments 0]
1026 set $__source1 "$m_inetClientAddr/$m_iClientPort/$__source"
1027 puts "source1 is $__source1"
1028
1029 fx_set_input_spec $m_specialfx_cntrl i1 $__source1
1030
1031 }
1032
1033
1034 ##############################################################################
1035 #
1036 # CSpecialFxProxyApplication private UpdateI2Control { service arguments }
1037 #
1038 # Input:
1039 # service - the service that called this function
1040 # arguments - the value that i2 needs to be updated to
1041 #
1042 # Output:
1043 # none
1044 #
1045 # Description:
1046 #
1047 ##############################################################################
1048 CSpecialFxProxyApplication private UpdateI2Control { service arguments } {
1049 $self instvar m_specialfx_cntrl
1050 $self instvar m_inetClientAddr
1051 $self instvar m_iClientPort
1052
1053 set __source [lindex $arguments 0]
1054 set __source2 "$m_inetClientAddr/$m_iClientPort/$__source"
1055 puts "source2 is $__source2"
1056
1057 fx_set_input_spec $m_specialfx_cntrl i2 $__source2
1058
1059 }
1060
1061
1062 ##############################################################################
1063 #
1064 # CSpecialFxProxyApplication private UpdateLatencyControl { service arguments }
1065 #
1066 # Input:
1067 # service - the service that called this function
1068 # arguments - the value that latency needs to be updated to
1069 #
1070 # Output:
1071 # none
1072 #
1073 # Description:
1074 #
1075 ##############################################################################
1076 CSpecialFxProxyApplication private UpdateLatencyControl { service arguments } {
1077 $self instvar m_specialfx_cntrl
1078
1079 set __value [lindex $arguments 0]
1080 puts "latency is $__value"
1081
1082 fx_set_parameter_value $m_specialfx_cntrl latency $__value
1083
1084 }
1085
1086
1087 ##############################################################################
1088 #
1089 # CSpecialFxProxyApplication private UpdateTextControl { service arguments }
1090 #
1091 # Input:
1092 # service - the service that called this function
1093 # arguments - the value that text needs to be updated to
1094 #
1095 # Output:
1096 # none
1097 #
1098 # Description:
1099 #
1100 ##############################################################################
1101 CSpecialFxProxyApplication private UpdateTextControl { service arguments } {
1102 $self instvar m_specialfx_cntrl
1103
1104 set __value $arguments
1105 puts "text is $__value"
1106
1107 fx_set_parameter_value $m_specialfx_cntrl text $__value
1108
1109 }
1110
1111
1112 ##############################################################################
1113 #
1114 # CSpecialFxProxyApplication private UpdateFontControl { service arguments }
1115 #
1116 # Input:
1117 # service - the service that called this function
1118 # arguments - the value that font needs to be updated to
1119 #
1120 # Output:
1121 # none
1122 #
1123 # Description:
1124 #
1125 ##############################################################################
1126 CSpecialFxProxyApplication private UpdateFontControl { service arguments } {
1127 $self instvar m_specialfx_cntrl
1128
1129 set __value [lindex $arguments 0]
1130 puts "font is $__value"
1131
1132 fx_set_parameter_value $m_specialfx_cntrl font $__value
1133
1134 }
1135
1136
1137 ##############################################################################
1138 #
1139 # CSpecialFxProxyApplication private UpdatePointSizeControl { service arguments }
1140 #
1141 # Input:
1142 # service - the service that called this function
1143 # arguments - the value that latency needs to be updated to
1144 #
1145 # Output:
1146 # none
1147 #
1148 # Description:
1149 #
1150 ##############################################################################
1151 CSpecialFxProxyApplication private UpdatePointSizeControl { service arguments } {
1152 $self instvar m_specialfx_cntrl
1153
1154 set __value [lindex $arguments 0]
1155 puts "point_size is $__value"
1156
1157 fx_set_parameter_value $m_specialfx_cntrl point_size $__value
1158
1159 }
1160
1161
1162 ##############################################################################
1163 #
1164 # CSpecialFxProxyApplication private UpdateXposControl { service arguments }
1165 #
1166 # Input:
1167 # service - the service that called this function
1168 # arguments - the value that xpos needs to be updated to
1169 #
1170 # Output:
1171 # none
1172 #
1173 # Description:
1174 #
1175 ##############################################################################
1176 CSpecialFxProxyApplication private UpdateXposControl { service arguments } {
1177 $self instvar m_specialfx_cntrl
1178
1179 set __value [lindex $arguments 0]
1180 puts "xpos is $__value"
1181
1182 fx_set_parameter_value $m_specialfx_cntrl xpos $__value
1183
1184 }
1185
1186
1187
1188 ##############################################################################
1189 #
1190 # CSpecialFxProxyApplication private UpdateYposControl { service arguments }
1191 #
1192 # Input:
1193 # service - the service that called this function
1194 # arguments - the value that ypos needs to be updated to
1195 #
1196 # Output:
1197 # none
1198 #
1199 # Description:
1200 #
1201 ##############################################################################
1202 CSpecialFxProxyApplication private UpdateYposControl { service arguments } {
1203 $self instvar m_specialfx_cntrl
1204
1205 set __value [lindex $arguments 0]
1206 puts "ypos is $__value"
1207
1208 fx_set_parameter_value $m_specialfx_cntrl ypos $__value
1209
1210 }
1211
1212
1213 ##############################################################################
1214 #
1215 # CSpecialFxProxyApplication private UpdateTextColorControl { service arguments }
1216 #
1217 # Input:
1218 # service - the service that called this function
1219 # arguments - the value that text_color needs to be updated to
1220 #
1221 # Output:
1222 # none
1223 #
1224 # Description:
1225 #
1226 ##############################################################################
1227 CSpecialFxProxyApplication private UpdateTextColorControl { service arguments } {
1228 $self instvar m_specialfx_cntrl
1229
1230 set __valuer [lindex $arguments 0]
1231 set __valueg [lindex $arguments 1]
1232 set __valueb [lindex $arguments 2]
1233
1234 set __valuey [expr int((.257 * $__valuer) + (.504 * $__valueg) + (.098 * $__valueb) + 16 )]
1235 if {$__valuey < 0} {
1236 set __valuey 0
1237 }
1238 if {$__valuey > 255} {
1239 set __valuey 255
1240 }
1241 set __valueu [expr int((.439 * $__valuer) - (.368 * $__valueg) - (.071 * $__valueb) + 128)]
1242 if {$__valueu < 0} {
1243 set __valueu 0
1244 }
1245 if {$__valueu > 255} {
1246 set __valueu 255
1247 }
1248 set __valuev [expr int((-.148 * $__valuer) - (.291 * $__valueg) + (.439 * $__valueb) + 128)]
1249 if {$__valuev < 0} {
1250 set __valuev 0
1251 }
1252 if {$__valuev > 255} {
1253 set __valuev 255
1254 }
1255
1256 set __value "$__valuey $__valueu $__valuev"
1257 puts "text_color is $__value"
1258
1259 fx_set_parameter_value $m_specialfx_cntrl text_color $__value
1260
1261 }
1262
1263
1264
1265 ##############################################################################
1266 #
1267 # CSpecialFxProxyApplication private UpdateBackColorControl { service arguments }
1268 #
1269 # Input:
1270 # service - the service that called this function
1271 # arguments - the value that back_color needs to be updated to
1272 #
1273 # Output:
1274 # none
1275 #
1276 # Description:
1277 #
1278 ##############################################################################
1279 CSpecialFxProxyApplication private UpdateBackColorControl { service arguments } {
1280 $self instvar m_specialfx_cntrl
1281
1282 set __valuer [lindex $arguments 0]
1283 set __valueg [lindex $arguments 1]
1284 set __valueb [lindex $arguments 2]
1285
1286 set __valuey [expr int((.257 * $__valuer) + (.504 * $__valueg) + (.098 * $__valueb) + 16 )]
1287 if {$__valuey < 0} {
1288 set __valuey 0
1289 }
1290 if {$__valuey > 255} {
1291 set __valuey 255
1292 }
1293 set __valueu [expr int((.439 * $__valuer) - (.368 * $__valueg) - (.071 * $__valueb) + 128)]
1294 if {$__valueu < 0} {
1295 set __valueu 0
1296 }
1297 if {$__valueu > 255} {
1298 set __valueu 255
1299 }
1300 set __valuev [expr int((-.148 * $__valuer) - (.291 * $__valueg) + (.439 * $__valueb) + 128)]
1301 if {$__valuev < 0} {
1302 set __valuev 0
1303 }
1304 if {$__valuev > 255} {
1305 set __valuev 255
1306 }
1307
1308 set __value "$__valuey $__valueu $__valuev"
1309 puts "back_color is $__value"
1310
1311 fx_set_parameter_value $m_specialfx_cntrl back_color $__value
1312
1313 }
1314
1315
1316 ##############################################################################
1317 #
1318 # CSpecialFxProxyApplication private UpdateMasterAlphaControl { service arguments }
1319 #
1320 # Input:
1321 # service - the service that called this function
1322 # arguments - the value that master_alpha needs to be updated to
1323 #
1324 # Output:
1325 # none
1326 #
1327 # Description:
1328 #
1329 ##############################################################################
1330 CSpecialFxProxyApplication private UpdateMasterAlphaControl { service arguments } {
1331 $self instvar m_specialfx_cntrl
1332
1333 set __value [lindex $arguments 0]
1334 puts "master_alpha is $__value"
1335
1336 fx_set_parameter_value $m_specialfx_cntrl master_alpha $__value
1337
1338 }
1339
1340
1341 ##############################################################################
1342 #
1343 # CSpecialFxProxyApplication private UpdateBackAlphaControl { service arguments }
1344 #
1345 # Input:
1346 # service - the service that called this function
1347 # arguments - the value that back_alpha needs to be updated to
1348 #
1349 # Output:
1350 # none
1351 #
1352 # Description:
1353 #
1354 ##############################################################################
1355 CSpecialFxProxyApplication private UpdateBackAlphaControl { service arguments } {
1356 $self instvar m_specialfx_cntrl
1357
1358 set __value [lindex $arguments 0]
1359 puts "back_alpha is $__value"
1360
1361 fx_set_parameter_value $m_specialfx_cntrl back_alpha $__value
1362
1363 }
1364
1365
1366 ##############################################################################
1367 #
1368 # CSpecialFxProxyApplication private UpdateFactorControl { service arguments }
1369 #
1370 # Input:
1371 # service - the service that called this function
1372 # arguments - the value that factor needs to be updated to
1373 #
1374 # Output:
1375 # none
1376 #
1377 # Description:
1378 #
1379 ##############################################################################
1380 CSpecialFxProxyApplication private UpdateFactorControl { service arguments } {
1381 $self instvar m_specialfx_cntrl
1382
1383 set __value [lindex $arguments 0]
1384 puts "factor is $__value"
1385
1386 fx_set_parameter_value $m_specialfx_cntrl factor $__value
1387
1388 }
1389
1390
1391 ##############################################################################
1392 #
1393 # CSpecialFxProxyApplication public CloseService { service arguments } {
1394 #
1395 # Input:
1396 # service - the service that called this function
1397 # arguments - the arguments associated with this call
1398 #
1399 # Output:
1400 # none
1401 #
1402 # Description:
1403 # This is called by the remote service client closes the service link.
1404 #
1405 ##############################################################################
1406 CSpecialFxProxyApplication public CloseService { service arguments } {
1407 exit
1408 }
1409
1410
This page was automatically generated by the
LXR engine.
Visit the LXR main site for more
information.