1 # ui-grabber.tcl --
2 #
3 # This file contains stubs for building any grabber specific controls.
4 #
5 # Copyright (c) 1993-2002 The Regents of the University of California.
6 # All rights reserved.
7 #
8 # Redistribution and use in source and binary forms, with or without
9 # modification, are permitted provided that the following conditions are met:
10 #
11 # A. Redistributions of source code must retain the above copyright notice,
12 # this list of conditions and the following disclaimer.
13 # B. Redistributions in binary form must reproduce the above copyright notice,
14 # this list of conditions and the following disclaimer in the documentation
15 # and/or other materials provided with the distribution.
16 # C. Neither the names of the copyright holders nor the names of its
17 # contributors may be used to endorse or promote products derived from this
18 # software without specific prior written permission.
19 #
20 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
21 # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22 # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23 # ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR
24 # ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25 # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
26 # SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
27 # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
28 # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30
31
32 #
33 # This file contains stubs for building any grabber specific controls.
34 # If a device is named foo, then create define build.foo proc here
35 # that builds UI. If this proc doesn't exist, then it will be ommitted.
36 # If there are multiple devices with the same name, they should be
37 # called foo-1, foo-2, etc. and you'll only need build.foo
38 #
39
40 #
41 ControlMenu instproc build.lml33 { w } {
42 # puts "build.lml33 START"
43 $self instvar vpipe_
44 # puts "trying to extract device"
45 # set dev [$vpipe_ set device_]
46 # puts "trying to use puts"
47 # puts [$dev info procs]
48 # puts [$dev info class]
49 # puts [$dev info commands]
50 # set clas [$dev info class]
51 # puts "class instprocs: "
52 # puts [$clas info instprocs]
53 # puts "heritage:"
54 # puts [$clas info heritage]
55 # puts "nickname:"
56 # puts [$dev nickname]
57 # puts "attributes:"
58 # puts [$dev attributes]
59 # puts {hue: }
60 # puts [$dev get_attribute hue]
61 # puts {contrast: }
62 # puts [$dev contrast]
63 # puts {color: }
64 # puts [$dev color]
65 # puts "build.lml33 END"
66
67 set f [$self get_option smallfont]
68 label $w.title -text "Video Input"
69 frame $w.f -relief sunken -borderwidth 2
70
71 frame $w.f.ll -relief flat
72
73 label $w.f.ll.clabel -font $f -text "Contrast" -anchor s
74
75 label $w.f.ll.blabel -font $f -text "Brightness" -anchor s
76 pack $w.f.ll.clabel $w.f.ll.blabel \
77 -side left -fill x -expand 1
78
79 frame $w.f.l -relief flat
80
81 scale $w.f.l.cscale -orient horizontal -width 12 -relief groove \
82 -showvalue 0 -from 0 -to 65500 \
83 -command "$vpipe_ hardware contrast"
84
85 scale $w.f.l.bscale -orient horizontal -width 12 -relief groove \
86 -showvalue 0 -from 0 -to 65500 \
87 -command "$vpipe_ hardware brightness"
88 pack $w.f.l.cscale $w.f.l.bscale -side left -fill x -expand 1
89
90 frame $w.f.cl -relief flat
91
92 label $w.f.cl.glabel -font $f -text "Hue" -anchor n
93
94 label $w.f.cl.slabel -font $f -text "Color" -anchor n
95 pack $w.f.cl.glabel $w.f.cl.slabel \
96 -side left -fill x -expand 1
97
98 frame $w.f.c -relief flat
99
100 scale $w.f.c.hscale -orient horizontal -width 12 -relief groove \
101 -showvalue 0 -from 0 -to 65500 \
102 -command "$vpipe_ hardware hue"
103
104 scale $w.f.c.cscale -orient horizontal -width 12 -relief groove \
105 -showvalue 0 -from 0 -to 65500 \
106 -command "$vpipe_ hardware color"
107 pack $w.f.c.hscale $w.f.c.cscale -side left -fill x -expand 1
108
109 pack $w.f.ll $w.f.l $w.f.c $w.f.cl \
110 -fill x -expand 1 -padx 1m
111
112
113 pack $w.title $w.f -fill x -expand 1
114
115 $w.f.l.cscale set 27648
116 $w.f.l.bscale set 32768
117 $w.f.c.hscale set 32768
118 $w.f.c.cscale set 32512
119
120 # if [have grabber] {
121 #$vpipe_ hardware
122 # $w.f.l.cscale set [$vt grabber -contrast]
123 # $w.f.l.bscale set [$vt grabber -brightness]
124 # $w.f.c.hscale set [$vt grabber -hue]
125 # $w.f.c.cscale set [$vt grabber -color]
126 # } else {
127 # }
128
129 }
130
131 ControlMenu instproc build.slicvideo { w } {
132 $self instvar vpipe_
133 set f [$self get_option smallfont]
134 label $w.title -text "Video Input"
135 frame $w.f -relief sunken -borderwidth 2
136
137 frame $w.f.h -relief flat
138
139 label $w.f.h.label -font $f -anchor e -text "Hue"
140
141 scale $w.f.h.scale -orient horizontal -width 12 -length 20 \
142 -relief groove -showvalue 0 -from -128 -to 127 \
143 -command "$vpipe_ hardware set HUE"
144 pack $w.f.h.label $w.f.h.scale -side left -fill x -expand 1
145
146 frame $w.f.ll -relief flat
147
148 label $w.f.ll.label -font $f -text "Luma" -anchor s
149
150 label $w.f.ll.clabel -font $f -text "Contrast" -anchor s
151
152 label $w.f.ll.blabel -font $f -text "Brightness" -anchor s
153 pack $w.f.ll.clabel $w.f.ll.label $w.f.ll.blabel \
154 -side left -fill x -expand 1
155
156 frame $w.f.l -relief flat
157
158 scale $w.f.l.cscale -orient horizontal -width 12 -relief groove \
159 -showvalue 0 -from 0 -to 127 \
160 -command "$vpipe_ hardware set LUMA_CONTRAST"
161
162 scale $w.f.l.bscale -orient horizontal -width 12 -relief groove \
163 -showvalue 0 -from 0 -to 255 \
164 -command "$vpipe_ hardware set LUMA_BRIGHTNESS"
165 pack $w.f.l.cscale $w.f.l.bscale -side left -fill x -expand 1
166
167 frame $w.f.cl -relief flat
168
169 label $w.f.cl.label -font $f -text "Chroma" -anchor n
170
171 label $w.f.cl.glabel -font $f -text "Gain" -anchor n
172
173 label $w.f.cl.slabel -font $f -text "Saturation" -anchor n
174 pack $w.f.cl.glabel $w.f.cl.label $w.f.cl.slabel \
175 -side left -fill x -expand 1
176
177 frame $w.f.c -relief flat
178
179 scale $w.f.c.gscale -orient horizontal -width 12 -relief groove \
180 -showvalue 0 -from 0 -to 255 \
181 -command "$vpipe_ hardware set CHROMA_GAIN"
182
183 scale $w.f.c.sscale -orient horizontal -width 12 -relief groove \
184 -showvalue 0 -from 0 -to 127 \
185 -command "$vpipe_ hardware set CHROMA_SATURATION"
186 pack $w.f.c.gscale $w.f.c.sscale -side left -fill x -expand 1
187
188
189 pack $w.f.h $w.f.ll $w.f.l $w.f.c $w.f.cl \
190 -fill x -expand 1 -padx 1m
191
192
193 pack $w.title $w.f -fill x -expand 1
194
195 $w.f.h.scale set 0
196 $w.f.l.cscale set 64
197 $w.f.l.bscale set 128
198 $w.f.c.gscale set 44
199 $w.f.c.sscale set 64
200 }
201
202 #
203 ControlMenu instproc build.still { w } {
204
205 set f [$self get_option smallfont]
206 label $w.title -text "Video Input"
207
208 frame $w.f -relief sunken -borderwidth 2
209
210 label $w.f.label -font $f -anchor e -text "File"
211
212 mk.entry $w.f set.still.frame "frame"
213
214 pack $w.title $w.f -fill x -expand 1
215
216 pack $w.f.label -side left
217 pack $w.f.entry -side left -fill x -expand 1
218 }
219
220 #
221 ControlMenu instproc set.still.frame {w s } {
222 $self instvar last_device_
223 $last_device_ file $s
224 }
225
226 #
227 ControlMenu instproc build.qcam { w } {
228 $self instvar vpipe_
229 global qcamwindow
230
231 set f [$self get_option smallfont]
232 label $w.title -text "Video Input"
233
234 frame $w.f -relief sunken -borderwidth 2
235
236 frame $w.f.s -relief flat
237
238 frame $w.f.s.l -relief flat
239 label $w.f.s.l.bright -font $f -anchor w -text "Brightness"
240 label $w.f.s.l.cont -font $f -anchor w -text "Contrast"
241 label $w.f.s.l.wbal -font $f -anchor w -text "White balance"
242 pack $w.f.s.l.bright $w.f.s.l.cont $w.f.s.l.wbal \
243 -side top -fill x -expand 1
244
245 frame $w.f.s.s -relief flat
246 scale $w.f.s.s.bright -orient horizontal -width 12 \
247 -relief groove -showvalue 0 -from 1 -to 254 \
248 -command "$vpipe_ hardware set BRIGHT"
249 scale $w.f.s.s.cont -orient horizontal -width 12 \
250 -relief groove -showvalue 0 \
251 -from 0 -to 1.0 -resolution 0.002 \
252 -command "$vpipe_ hardware contrast"
253
254 frame $w.f.s.s.wbal -relief flat
255 scale $w.f.s.s.wbal.scale -orient horizontal -width 12 \
256 -relief groove -showvalue 0 -from 1 -to 254 \
257 -command "$vpipe_ hardware set WBAL"
258 button $w.f.s.s.wbal.button -font $f -text Auto \
259 -command "$vpipe_ hardware set WBAL auto"
260 pack $w.f.s.s.wbal.scale $w.f.s.s.wbal.button \
261 -side left -fill x -expand 1
262
263 pack $w.f.s.s.bright $w.f.s.s.cont $w.f.s.s.wbal \
264 -side top -fill x -expand 1
265
266 pack $w.f.s.l $w.f.s.s -side left -fill x -expand 1
267
268 frame $w.f.bpp -relief flat
269 label $w.f.bpp.label -font $f -anchor w -text "Pixel depth"
270 radiobutton $w.f.bpp.bpp4 -font $f -text "4-bit" \
271 -variable qcambpp -value 4 -command "$vpipe_ hardware set BPP 4"
272 radiobutton $w.f.bpp.bpp6 -font $f -text "6-bit" \
273 -variable qcambpp -value 6 -command "$vpipe_ hardware set BPP 6"
274 pack $w.f.bpp.label $w.f.bpp.bpp4 $w.f.bpp.bpp6 \
275 -side left -fill x -expand 1
276
277 pack $w.f.s $w.f.bpp \
278 -fill x -expand 1 -padx 1m
279
280 pack $w.title $w.f -fill x -expand 1
281
282 set qcamwindow(setbright) "$w.f.s.s.bright set"
283 set qcamwindow(setcont) "$w.f.s.s.cont set"
284 set qcamwindow(setwbal) "$w.f.s.s.wbal.scale set"
285 set qcamwindow(setbpp) "set qcambpp"
286 }
287
288 #
289 ControlMenu instproc build.brooktree848 { w } {
290 $self instvar vpipe_
291 set f [$self get_option smallfont]
292 label $w.title -text "Video Input"
293 frame $w.f -relief sunken -borderwidth 2
294
295 frame $w.f.h -relief flat
296
297 label $w.f.h.label -font $f -anchor e -text "Hue"
298
299 scale $w.f.h.scale -orient horizontal -width 12 -length 20 \
300 -relief groove -showvalue 0 -from -128 -to 127 \
301 -command "$vpipe_ hardware set HUE"
302 pack $w.f.h.label $w.f.h.scale -side left -fill x -expand 1
303
304 frame $w.f.ll -relief flat
305
306 label $w.f.ll.label -font $f -text "Luma" -anchor s
307
308 label $w.f.ll.clabel -font $f -text "Contrast" -anchor s
309
310 label $w.f.ll.blabel -font $f -text "Brightness" -anchor s
311 pack $w.f.ll.clabel $w.f.ll.label $w.f.ll.blabel \
312 -side left -fill x -expand 1
313
314 frame $w.f.l -relief flat
315
316 scale $w.f.l.cscale -orient horizontal -width 12 -relief groove \
317 -showvalue 0 -from 0 -to 127 \
318 -command "$vpipe_ hardware set contrast"
319
320 scale $w.f.l.bscale -orient horizontal -width 12 -relief groove \
321 -showvalue 0 -from 0 -to 255 \
322 -command "$vpipe_ hardware brightness"
323 pack $w.f.l.cscale $w.f.l.bscale -side left -fill x -expand 1
324
325 frame $w.f.cl -relief flat
326
327 label $w.f.cl.label -font $f -text "Chroma" -anchor n
328
329 label $w.f.cl.glabel -font $f -text "Gain" -anchor n
330
331 label $w.f.cl.slabel -font $f -text "Saturation" -anchor n
332 pack $w.f.cl.glabel $w.f.cl.label $w.f.cl.slabel \
333 -side left -fill x -expand 1
334
335 frame $w.f.c -relief flat
336
337 scale $w.f.c.gscale -orient horizontal -width 12 -relief groove \
338 -showvalue 0 -from 0 -to 255 \
339 -command "$vpipe_ hardware set CHROMA_GAIN"
340
341 scale $w.f.c.sscale -orient horizontal -width 12 -relief groove \
342 -showvalue 0 -from 0 -to 127 \
343 -command "$vpipe_ hardware set CHROMA_SATURATION"
344 pack $w.f.c.gscale $w.f.c.sscale -side left -fill x -expand 1
345
346
347 checkbutton $w.f.b -text PAL -variable signalFormat -onvalue pal \
348 -offvalue ntsc -command \
349 "$vpipe_ hardware format \$signalFormat"
350
351 pack $w.f.h $w.f.ll $w.f.l $w.f.c $w.f.cl $w.f.b \
352 -fill x -expand 1 -padx 1m
353
354
355
356 pack $w.title $w.f -fill x -expand 1
357
358 $w.f.h.scale set 0
359 $w.f.l.cscale set 64
360 $w.f.l.bscale set 128
361 $w.f.c.gscale set 44
362 $w.f.c.sscale set 64
363 }
364
365 #
366 ControlMenu instproc build.brooktree848 w {
367 $self instvar vpipe_
368 set f [$self get_option smallfont]
369 # label $w.title -text "Video Input"
370
371 frame $w.f -relief sunken -borderwidth 2
372
373 frame $w.f.h -relief flat
374 label $w.f.h.label -font $f -text "Hue" -width 12
375 scale $w.f.h.hscale -orient horizontal \
376 -relief groove -showvalue 0 -from -128 -to 127 \
377 -command "$vpipe_ hardware hue"
378 pack $w.f.h.label -side left
379 pack $w.f.h.hscale -side left -fill x -expand 1
380
381 frame $w.f.l -relief flat
382
383 frame $w.f.l.l
384 label $w.f.l.l.clabel -font $f -text "Contrast" -width 12
385 scale $w.f.l.l.cscale -orient horizontal -relief groove -width 12 \
386 -showvalue 0 -from 0 -to 127 \
387 -command "$vpipe_ hardware contrast"
388 pack $w.f.l.l.clabel -side left
389 pack $w.f.l.l.cscale -side left -fill x -expand 1
390
391 frame $w.f.l.r
392 label $w.f.l.r.blabel -font $f -text "Brightness" -width 12
393 scale $w.f.l.r.bscale -orient horizontal -relief groove -width 12 \
394 -showvalue 0 -from -128 -to 127 \
395 -command "$vpipe_ hardware brightness"
396 pack $w.f.l.r.blabel -side left
397 pack $w.f.l.r.bscale -side left -fill x -expand 1
398
399 pack $w.f.l.l $w.f.l.r -side top -fill x -expand 1
400
401 frame $w.f.cl -relief flat
402
403 frame $w.f.cl.l
404 label $w.f.cl.l.glabel -font $f -text "Chroma Gain" -width 12
405 scale $w.f.cl.l.gscale -orient horizontal -relief groove -width 12 \
406 -showvalue 0 -from 0 -to 255 \
407 -command "$vpipe_ hardware uvgain"
408 pack $w.f.cl.l.glabel -side left
409 pack $w.f.cl.l.gscale -side left -fill x -expand 1
410
411 frame $w.f.cl.r
412 label $w.f.cl.r.slabel -font $f -text "Saturation" -width 12
413 scale $w.f.cl.r.sscale -orient horizontal -relief groove -width 12 \
414 -showvalue 0 -from 0 -to 127 \
415 -command "$vpipe_ hardware saturation"
416 pack $w.f.cl.r.slabel -side left
417 pack $w.f.cl.r.sscale -side left -fill x -expand 1
418
419 pack $w.f.cl.r $w.f.cl.l -side top -fill x -expand 1
420
421 #FIXME
422 checkbutton $w.f.b -text PAL -variable signalFormat -onvalue pal \
423 -offvalue ntsc -command \
424 "$vpipe_ hardware format \$signalFormat"
425
426
427 pack $w.f.l $w.f.h $w.f.cl $w.f.b -side top -fill both -expand 1
428 pack $w.f -fill both -expand 1
429
430 # if [have grabber] {
431 # $w.f.h.hscale set [grabber hue]
432 # $w.f.l.l.cscale set [grabber contrast]
433 # $w.f.l.r.bscale set [grabber brightness]
434 # $w.f.cl.l.gscale set [grabber uvgain]
435 # $w.f.cl.r.sscale set [grabber saturation]
436 # } else {
437 $w.f.h.hscale set 0
438 $w.f.l.l.cscale set 64
439 $w.f.l.r.bscale set 0
440 $w.f.cl.l.gscale set 44
441 $w.f.cl.r.sscale set 64
442 # }
443 }
444
445
446 #
447 # X11 Grabber controls
448 #
449 ControlMenu instproc x11grabUpdatePos {x y w h} {
450
451 global x11grabcontrols
452 set w $x11grabcontrols
453
454 if {[string compare $x [$w.x11grab.row1.pos.x.e get]] != 0} {
455 $w.x11grab.row1.pos.x.e delete 0 end
456 $w.x11grab.row1.pos.x.e insert 0 $x
457 }
458 if {[string compare $y [$w.x11grab.row1.pos.y.e get]] != 0} {
459 $w.x11grab.row1.pos.y.e delete 0 end
460 $w.x11grab.row1.pos.y.e insert 0 $y
461 }
462 if {[string compare $w [$w.x11grab.row1.pos.w.e get]] != 0} {
463 $w.x11grab.row1.pos.w.e delete 0 end
464 $w.x11grab.row1.pos.w.e insert 0 $w
465 }
466 if {[string compare $h [$w.x11grab.row1.pos.h.e get]] != 0} {
467 $w.x11grab.row1.pos.h.e delete 0 end
468 $w.x11grab.row1.pos.h.e insert 0 $h
469 }
470 }
471
472 ControlMenu instproc x11cmd.update.geo w {
473 $self instvar vpipe_
474 $vpipe_ hardware fixed [$w.row.x get] [$w.row.y get]
475 }
476
477
478
479 ControlMenu instproc x11cmd.fixed {} {
480 global x11Source x11grabcontrols
481 set w $x11grabcontrols
482 $w.label configure -text "$x11Source"
483 if [winfo exists $w.row] {
484 destroy $w.row
485 }
486 frame $w.row
487 pack append $w.row \
488 [label $w.row.xl -text "X:" -width 2 -anchor e] {left filly} \
489 [entry $w.row.x -relief flat -width 4] {left filly} \
490 [label $w.row.yl -text "Y:" -width 2 -anchor e] {left filly} \
491 [entry $w.row.y -relief flat -width 4] {left filly}
492 bind $w.row.x <Return> "$self x11cmd.update.geo $w"
493 bind $w.row.y <Return> "$self x11cmd.update.geo $w"
494
495 pack $w.row -after $w.label
496 }
497
498 ControlMenu instproc x11cmd.pointer {} {
499 $self instvar vpipe_
500 global x11Source x11grabcontrols
501 set w $x11grabcontrols
502 $w.label configure -text "$x11Source"
503 if [winfo exists $w.row] {
504 destroy $w.row
505 }
506 frame $w.row
507 pack append $w.row \
508 [button $w.row.s -text "Follow pointer" \
509 -command "$vpipe_ hardware pointer"] { left filly }
510 pack $w.row -after $w.label
511 }
512
513 ControlMenu instproc x11cmd.window {} {
514 $self instvar vpipe_
515 global x11Source x11grabcontrols
516 puts "x11cmd -- x11Source $x11Source"
517 set w $x11grabcontrols
518 $w.label configure -text "$x11Source"
519 if [winfo exists $w.row] {
520 destroy $w.row
521 }
522 frame $w.row
523 pack append $w.row \
524 [button $w.row.s -text "Select window" \
525 -command "$vpipe_ hardware window"] { left filly }
526 pack $w.row -after $w.label
527 }
528
529 ControlMenu instproc build.x11 w {
530 global x11grabcontrols x11Source
531 set f [$self get_option smallfont]
532
533 label $w.title -text "X11 Grabber controls"
534 frame $w.x11grab -relief sunken -borderwidth 2
535 set x11grabcontrols $w.x11grab
536 set x11Source "Fixed"
537 set w1 $w.x11grab
538
539
540 set m $w1.menu
541 set m1 $m.m1
542 menubutton $w1.menu -menu $m1 -text "Source:" \
543 -relief raised -width 7 -font $f
544 label $w1.label -width 6 -font $f
545 frame $w1.row
546 menu $m1
547 $m1 add radiobutton -label Fixed \
548 -state active \
549 -command "$self x11cmd.fixed" -font $f -variable x11Source
550 # $m1 add radiobutton -label Pointer \
551 # -command "$self x11cmd.pointer" -font $f -variable x11Source
552 # $m1 add radiobutton -label Window \
553 # -command "$self x11cmd.window" -font $f -variable x11Source
554
555 pack append $w1 \
556 $w1.menu {left} \
557 $w1.label {left} \
558 $w1.row {left}
559
560 pack $w $w.title $w1 -fill x -expand 1
561
562 $self x11cmd.fixed
563 }
564
565 ControlMenu instproc build.v4l { w } {
566 $self instvar vpipe_
567
568 set f [$self get_option smallfont]
569
570 # the title of the frame
571 label $w.title -text "Video4Linux grabber controls"
572 pack $w.title -fill x -expand 1
573
574 frame $w.f -relief sunken -borderwidth 2
575
576 # the reset button goes to the left
577 frame $w.f.left -relief flat
578 button $w.f.left.reset -font $f -width 10 -text "Reset" \
579 -command "$w.f.right.top.c.cscale set 128; \
580 $w.f.right.top.b.bscale set 128; \
581 $w.f.right.bottom.h.hscale set 128; \
582 $w.f.right.bottom.s.sscale set 128; \
583 $vpipe_ hardware controls reset" \
584 -padx 1 -pady 1
585 pack $w.f.left.reset
586 frame $w.f.right -relief flat
587 frame $w.f.right.top -relief flat
588
589 # the contrast slider
590 frame $w.f.right.top.c -relief flat -borderwidth 2
591 scale $w.f.right.top.c.cscale -orient horizontal -font $f -relief groove \
592 -width 12 \
593 -showvalue 0 -from 0 -to 255 \
594 -label Contrast \
595 -command "$vpipe_ hardware contrast"
596 $w.f.right.top.c.cscale set 128;
597 pack $w.f.right.top.c.cscale -fill x -expand 1
598
599 # the brightness slider
600 frame $w.f.right.top.b -relief flat -borderwidth 2
601 scale $w.f.right.top.b.bscale -orient horizontal -font $f -relief groove \
602 -width 12 \
603 -showvalue 0 -from 0 -to 255 \
604 -label Brightness \
605 -command "$vpipe_ hardware brightness"
606 pack $w.f.right.top.b.bscale -fill x -expand 1
607 $w.f.right.top.b.bscale set 128;
608 frame $w.f.right.bottom -relief flat
609
610 # the hue slider
611 frame $w.f.right.bottom.h -relief flat -borderwidth 2
612 scale $w.f.right.bottom.h.hscale -orient horizontal -font $f -relief groove \
613 -width 12 \
614 -showvalue 0 -from 0 -to 255 \
615 -label Hue \
616 -command "$vpipe_ hardware hue"
617 $w.f.right.bottom.h.hscale set 128;
618 pack $w.f.right.bottom.h.hscale -fill x -expand 1
619
620 # the saturation (colour) slider
621 frame $w.f.right.bottom.s -relief flat -borderwidth 2
622 scale $w.f.right.bottom.s.sscale -orient horizontal -font $f -relief groove \
623 -width 12 \
624 -showvalue 0 -from 0 -to 255 \
625 -label Saturation \
626 -command "$vpipe_ hardware saturation"
627 $w.f.right.bottom.s.sscale set 128;
628 pack $w.f.right.bottom.s.sscale -fill x -expand 1
629
630 # pack everything
631 pack $w.f.right.top.b $w.f.right.top.c -side right
632 pack $w.f.right.bottom.s $w.f.right.bottom.h -side right
633 pack $w.f.right.top $w.f.right.bottom -side top -fill x -expand 1
634 pack $w.f.left $w.f.right -side left -expand 1 -fill x
635 pack $w.f -expand 1 -fill x
636 }
637
638 ControlMenu instproc build.videum { w } {
639 $self instvar vpipe_
640
641 set f [$self get_option smallfont]
642
643 # the title of the frame
644 label $w.title -text "Win32 grabber controls"
645 pack $w.title -fill x -expand 1
646
647 frame $w.f -relief sunken -borderwidth 2
648
649 # the reset button goes to the left
650 frame $w.f.left -relief flat
651 button $w.f.left.reset -font $f -width 10 -text "Reset" \
652 -command "$w.f.right.top.c.cscale set 128; \
653 $w.f.right.top.b.bscale set 128; \
654 $w.f.right.bottom.h.hscale set 128; \
655 $w.f.right.bottom.s.sscale set 128; \
656 $vpipe_ hardware controls reset" \
657 -padx 1 -pady 1
658 pack $w.f.left.reset
659 frame $w.f.right -relief flat
660 frame $w.f.right.top -relief flat
661
662 # the contrast slider
663 frame $w.f.right.top.c -relief flat -borderwidth 2
664 scale $w.f.right.top.c.cscale -orient horizontal -font $f -relief groove \
665 -width 12 \
666 -showvalue 0 -from 0 -to 255 \
667 -label Contrast \
668 -command "$vpipe_ hardware contrast"
669 $w.f.right.top.c.cscale set 128;
670 pack $w.f.right.top.c.cscale -fill x -expand 1
671
672 # the brightness slider
673 frame $w.f.right.top.b -relief flat -borderwidth 2
674 scale $w.f.right.top.b.bscale -orient horizontal -font $f -relief groove \
675 -width 12 \
676 -showvalue 0 -from 0 -to 255 \
677 -label Brightness \
678 -command "$vpipe_ hardware brightness"
679 pack $w.f.right.top.b.bscale -fill x -expand 1
680 $w.f.right.top.b.bscale set 128;
681 frame $w.f.right.bottom -relief flat
682
683 # the hue slider
684 frame $w.f.right.bottom.h -relief flat -borderwidth 2
685 scale $w.f.right.bottom.h.hscale -orient horizontal -font $f -relief groove \
686 -width 12 \
687 -showvalue 0 -from 0 -to 255 \
688 -label Hue \
689 -command "$vpipe_ hardware hue"
690 $w.f.right.bottom.h.hscale set 128;
691 pack $w.f.right.bottom.h.hscale -fill x -expand 1
692
693 # the saturation (colour) slider
694 frame $w.f.right.bottom.s -relief flat -borderwidth 2
695 scale $w.f.right.bottom.s.sscale -orient horizontal -font $f -relief groove \
696 -width 12 \
697 -showvalue 0 -from 0 -to 255 \
698 -label Saturation \
699 -command "$vpipe_ hardware saturation"
700 $w.f.right.bottom.s.sscale set 128;
701 pack $w.f.right.bottom.s.sscale -fill x -expand 1
702
703 # pack everything
704 pack $w.f.right.top.b $w.f.right.top.c -side right
705 pack $w.f.right.bottom.s $w.f.right.bottom.h -side right
706 pack $w.f.right.top $w.f.right.bottom -side top -fill x -expand 1
707 pack $w.f.left $w.f.right -side left -expand 1 -fill x
708 pack $w.f -expand 1 -fill x
709 }
710
711 ControlMenu instproc build.microsoft { w } {
712
713 set f [$self get_option smallfont]
714 $self tkvar deviceDialogsState_
715 set deviceDialogState_ 0
716
717 # title of the frame
718 label $w.title -text "Microsoft WDM grabber controls"
719 pack $w.title -fill x -expand 1
720
721 # specific test controls
722 frame $w.f -relief sunken -borderwidth 2
723
724 # check box to request display of device dialogs
725 checkbutton $w.f.deviceDialog -text "Display device settings dialogs" \
726 -font $f -relief flat -variable [$self tkvarname deviceDialogsState_]
727
728 # pack everything
729 pack $w.f.deviceDialog -expand 1 -fill x
730 pack $w.f -expand 1 -fill x
731 }
732
733
734 ControlMenu instproc build.test { w } {
735 $self instvar test_file_entry_
736
737 set f [$self get_option smallfont]
738
739 # title of the frame
740 label $w.title -text "Test capturer controls"
741 pack $w.title -fill x -expand 1
742
743 # specific test controls
744 frame $w.f -relief sunken -borderwidth 2
745
746 # file name
747 frame $w.f.file
748 button $w.f.file.select -text File -borderwidth 2 \
749 -anchor c -font $f -command "$self change_file"
750 set test_file_entry_ [new TextEntry "$self change_file" \
751 $w.f.file.name ""]
752 pack $w.f.file.select -side left
753 pack $w.f.file.name -side left -expand 1 -fill x -pady 2
754
755 # pack everything
756 pack $w.f.file -expand 1 -fill x
757 pack $w.f -expand 1 -fill x
758 }
759
760 ControlMenu instproc change_file { {filename ""} } {
761 $self instvar test_file_entry_
762
763 if { $filename == "" } {
764 set filename [tk_getOpenFile -filetypes {{{PPM Files} {.ppm}}}\
765 -title "Choose the testcard image"]
766 if { $filename == "" } { return }
767
768 $test_file_entry_ set-value $filename
769 }
770
771 $self set input_port_ file
772 $self set-port file:$filename
773
774 # this return is needed!
775 return 0
776 }
777
This page was automatically generated by the
LXR engine.
Visit the LXR main site for more
information.