- Timestamp:
- Jan 27, 2011, 12:48:57 AM (14 years ago)
- Location:
- trunk/gui/scripts
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gui/scripts/videochooser.tcl
r2067 r2069 22 22 itk_option define -height height Height 300 23 23 itk_option define -variable variable Variable "" 24 itk_option define -thumbsdir thumbsdir Thumbsdir "" 24 25 25 26 constructor { args } { … … 82 83 83 84 set ci [Rappture::VideoChooserInfo $f.vi${_vcnt} \ 84 -variable ${_variable}] 85 -variable ${_variable} \ 86 -thumbsdir $itk_option(-thumbsdir)] 85 87 $ci load $path "" 86 88 pack $ci -expand yes -fill both -side left -
trunk/gui/scripts/videochooserinfo.tcl
r2067 r2069 23 23 itk_option define -selectedheight selectedheight Selectedheight 63 24 24 itk_option define -variable variable Variable "" 25 itk_option define -thumbsdir thumbsdir Thumbsdir "" 25 26 26 27 constructor { args } { … … 94 95 95 96 set _path $path 96 97 set movie [Rappture::Video file ${_path}] 98 $movie seek 60 97 set preview_fname "" 98 set selected_fname "" 99 99 100 100 set _preview [image create photo] 101 101 set _selected [image create photo] 102 103 if {[string compare "" $itk_option(-thumbsdir)] != 0} { 104 set root [file tail [file rootname ${_path}]] 105 set preview_fname [file join $itk_option(-thumbsdir) ${root}_${_width}x${_height}.png] 106 set selected_fname [file join $itk_option(-thumbsdir) ${root}_${_selectedwidth}x${_selectedheight}.png] 107 108 if {[file readable $preview_fname] && [file readable $selected_fname]} { 109 set fid [open $preview_fname r] 110 fconfigure $fid -translation binary 111 ${_preview} put [read $fid] 112 close $fid 113 114 set fid [open $selected_fname r] 115 fconfigure $fid -translation binary 116 ${_selected} put [read $fid] 117 close $fid 118 } 119 } else { 120 # there are some incomplete movies that don't open up 121 set err [catch { 122 set movie [Rappture::Video file ${_path}] 123 $movie seek 60 124 125 ${_preview} put [$movie get image ${_width} ${_height}] 126 ${_selected} put [$movie get image ${_selectedwidth} ${_selectedheight}] 127 128 $movie release 129 }] 130 if {$err} { 131 puts stderr "Error while opening movie: $movie" 132 return 133 } 134 } 102 135 103 136 set cw [expr round(${_selectedwidth}/2.0)] … … 109 142 -tags preview 110 143 111 ${_preview} put [$movie get image ${_width} ${_height}]112 ${_selected} put [$movie get image ${_selectedwidth} ${_selectedheight}]113 114 $movie release115 116 144 $itk_component(main) bind preview <ButtonPress-1> [itcl::code $this _bindings b1press] 117 145 $itk_component(main) bind preview <Enter> [itcl::code $this _bindings enter]
Note: See TracChangeset
for help on using the changeset viewer.