~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~ [ freetext search ] ~ [ file search ] ~

Open Mash Cross Reference
mash/tcl/mat/archive-mat.tcl

Component: ~ [ mash ] ~ [ apps ] ~ [ gsm ] ~ [ lib ] ~ [ otcl ] ~ [ srm ] ~ [ tcl8.3 ] ~ [ tclcl ] ~ [ tk8.3 ] ~ [ tutorials ] ~

  1 # archive-mat.tcl --
  2 #
  3 #       FIXME: This file needs a description here.
  4 #
  5 # Copyright (c) 1998-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 import ArchiveSystem ArchiveSystem/Record ArchiveSystem/Play
 32 
 33 Class Rec
 34 
 35 Rec public init module {
 36         $self next
 37         $self set module_ $module
 38 }
 39 
 40 Rec instproc start {} {
 41         global aspec vspec
 42         $self instvar as_ module_
 43         set as_ [new ArchiveSystem/Record]
 44         set archive [$self get_option archive]
 45         $as_ open $archive $module_
 46         set vspec [$self get_option videoSpec]
 47         set aspec [$self get_option audioSpec]
 48         set mbspec [$self get_option mbSpec]
 49         $as_ record_rtp_session $vspec video video
 50         $as_ record_rtp_session $aspec audio audio
 51         $as_ record_mb_session $mbspec mb
 52 }
 53 
 54 Rec instproc stop {} {
 55         $self instvar as_
 56         delete $as_
 57         unset as_
 58 }
 59 
 60 Rec instproc goto { t } {
 61         $self instvar as_
 62         $as_ goto $t
 63 }
 64 
 65 set dir .
 66 set audioOff 0
 67 set videoOff 0
 68 set mbOff 0
 69 set namOff 0
 70 set loopback 0
 71 
 72 Class Playback
 73 
 74 Playback public init module {
 75         $self next
 76         $self set module_ $module
 77 }
 78 
 79 Playback public start { ui } {
 80         $self instvar as_ module_ ui_
 81         set as_ [new ArchiveSystem/Play]
 82         set archive [$self get_option archive]
 83         $as_ open $archive $module_
 84         set vspec [$self get_option videoSpec]
 85         set aspec [$self get_option audioSpec]
 86         set mbspec [$self get_option mbSpec]
 87         $as_ play_session $vspec video
 88         $as_ play_session $aspec audio
 89         $as_ play_session $mbspec mediaboard
 90         $as_ start
 91         set ui_ $ui
 92         $self instvar urls_
 93         set urls_ ""
 94         set file $archive/$module_/[$self get_option slideOutputFile]
 95         if [file isfile $file] {
 96                 set fd [open $file r]
 97                 if { $fd < 0 } {
 98                     return
 99                 }
100                 while 1 {
101                         if [eof $fd] {
102                                 break
103                         }
104                         gets $fd line
105                         if { [llength $line] > 0 } {
106                                 lappend urls_ $line
107                         }
108                 }
109                 close $fd
110         }
111         $self set curl_ 0
112         $self sched_next
113 }
114 
115 Playback public stop {} {
116         $self instvar as_
117         delete $as_
118         unset as_
119 }
120 
121 
122 Playback instproc sched_next {} {
123         $self instvar urls_ curl_
124         if { $curl_ < [llength $urls_] } {
125                 set r [lindex $urls_ $curl_]
126                 $self instvar as_
127                 $as_ at [lindex $r 0] "$self dispatch [lindex $r 1]"
128         }
129 }
130 
131 Playback instproc dispatch url {
132         $self instvar curl_ ui_
133         $ui_ show $url
134         incr curl_
135         $self sched_next
136 }
137 
138 Playback instproc goto { t } {
139         $self instvar as_
140         $as_ goto $t
141 }
142 
143 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~ [ freetext search ] ~ [ file search ] ~

This page was automatically generated by the LXR engine.
Visit the LXR main site for more information.