/usr/share/tcltk/transcriber/tcl/Episode.tcl is in transcriber 1.5.1.1-10.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 | # RCS: @(#) $Id: Episode.tcl,v 1.3 2002/09/04 08:31:29 barras Exp $
# Copyright (C) 1998-2000, DGA - part of the Transcriber program
# distributed under the GNU General Public License (see COPYING file)
################################################################
# Called from: NewTrans
proc InitEpisode {} {
global v
$v(trans,root) setAttr "scribe" $v(scribe,name)
UpdateFilename
set v(trans,version) 0
UpdateVersion
}
# Called from: OpenAudioFile, InitEpisode
proc UpdateFilename {} {
global v
if {![info exist v(trans,root)] || $v(trans,root)==""} return
if {[info exists v(multiwav,files)] && [llength $v(multiwav,files)] > 1} {
$v(trans,root) setAttr "audio_filename" [join $v(multiwav,files) ";"]
} else {
$v(trans,root) setAttr "audio_filename" [file root [file tail $v(sig,name)]]
}
}
proc GetFilename {} {
global v
if {![info exist v(trans,root)] || $v(trans,root)==""} {
return {}
}
return [split [$v(trans,root) getAttr "audio_filename"] ";"]
}
# called from: ReadTrans
proc GetVersion {} {
global v
if {[catch {
set ver [$v(trans,root) getAttr "version"]
}]} {
set ver 0
}
set v(trans,version) $ver
}
proc IncrementTime {ti} {
global v
set new [expr [$v(trans,root) getAttr "elapsed_time"]+$ti]
$v(trans,root) setAttr "elapsed_time" $new
return $new
}
# Called from: SaveTrans, InitEpisode (<= NewTrans), EditEpisode
proc UpdateVersion {} {
global v
$v(trans,root) setAttr "version" [expr $v(trans,version)+1]
$v(trans,root) setAttr "version_date" [clock format [clock seconds] -format "%y%m%d"]
}
proc EditEpisode {} {
global v dial
if {[HasModifs]} {
UpdateVersion
}
set episode [$v(trans,root) getChilds "element" "Episode"]
set w [CreateModal .epi "Episode attributes"]
set f [frame $w.top -relief raised -bd 1]
pack $f -fill both -expand true -side top
if {$v(chatMode)} {
set namlist {
{"Audio filename" "Transcriber's name" "Version" "Last modification date" "Principal language" "CH_Coder" "CH_Coding" "CH_Filename" "CH_Font" "CH_Warning"}
{"Program" "Recording date"}
}
set attlist {
{"audio_filename" "scribe" "version" "version_date" "xml:lang" "coder" "coding" "filename" "font" "warning"}
{"program" "air_date"}
}
} else {
set namlist {
{"Audio filename" "Transcriber's name" "Version" "Last modification date" "Principal language"}
{"Program" "Recording date"}
}
set attlist {
{"audio_filename" "scribe" "version" "version_date" "xml:lang"}
{"program" "air_date"}
}
}
foreach names $namlist atts $attlist item [list $v(trans,root) $episode] {
foreach att $atts name $names {
set dial($att) [$item getAttr $att]
EntryFrame $f.[string tolower $att] $name dial($att)
}
}
#pack $f.xml:lang -side bottom
set e $f.xml:lang
menubutton $e.men -indicatoron 1 -menu $e.men.menu -relief raised -bd 2 -highlightthickness 2 -anchor c -width 20
menu $e.men.menu -tearoff 0
foreach subl $v(language) {
foreach {i name} $subl {}
if {$name == ""} {
set name $i
}
if {$i == $dial(xml:lang)} {
$e.men configure -text [Local $name]
}
$e.men.menu add radiobutton -label [Local $name] -variable dial(xml:lang) -value $i -command [list $e.men configure -text [Local $name]]
}
pack $e.men -side right -padx 3m
foreach name {"version" "version_date"} {
FrameState $f.$name 0
}
set result [OkCancelModal $w $w]
if {$result != "OK"} {
return
}
DoModif "EPISODE"
foreach atts $attlist item [list $v(trans,root) $episode] {
foreach att $atts {
$item setAttr $att $dial($att)
}
}
# may call MW_Update in some way
}
|