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

Open Mash Cross Reference
mash/tcl/fca/application-fca.tcl

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

  1 # application-fca.tcl --
  2 #
  3 #       FIXME: This file needs a description here.
  4 #
  5 # Copyright (c) 1997-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 Class FCApp -superclass Application
 33 
 34 FCApp instproc init argv {
 35         set config [new Configuration]
 36         $self set options_ $config
 37 
 38     $self next fca
 39     $self init_args $config
 40     $self init_resources $config
 41     $self parse_args $argv
 42     $self init_net
 43     $self init_ui
 44 }
 45 
 46 
 47 FCApp instproc init_args o {
 48     $self register_option $o -m moderators
 49 }
 50 
 51 
 52 FCApp instproc init_resources o {
 53     $o add_default sessionAddr "224.2.55.100/5000"
 54 }
 55 
 56 
 57 FCApp instproc init_net {} {
 58     $self instvar mgr_ uiMgr_ session_ localSrc_
 59 
 60     puts "come into init_net"
 61 
 62 # floor control policy: manual, 1 moderator, 15 max rqs, 3 floors max
 63 #                       and default floors
 64 # the policy should be obtained from SDR plug in
 65 #!! chairs are the initial floor holders
 66 
 67     set moderatorIds [$self resource moderators]
 68     DbgOut "moderatorIds = { $moderatorIds }"
 69     set addr [$self resource sessionAddr]
 70     DbgOut "session addr: $addr"
 71 
 72     set policy [new FCAPolicy 0 1 5]
 73     $policy addFloor 1 1
 74     $policy addFloor 2 1
 75     $policy addFloor 3 1
 76 
 77     set mgr_ [new SRMAppMgr/FCA/Tcl $policy $moderatorIds]
 78     set session_ [Session/SRM create-session $mgr_ $addr]
 79     set localSrc_ [$session_ default-local]
 80     puts "*$localSrc_*"
 81     $mgr_ attach_session_ $session_
 82     $mgr_ setLocalSrcId [$localSrc_ srcid]
 83     $mgr_ create_dynamics
 84     # must call create_dynamics only after we've attached the local src
 85 
 86     DbgOut "local srcid: [$localSrc_ srcid]"
 87 
 88     [$session_ data-net] loopback 1
 89     [$session_ ctrl-net] loopback 1
 90 
 91     set uiMgr_ [new FCA_UIMgr .main_frame $mgr_]
 92     $mgr_ attach_uiMgr $uiMgr_
 93 
 94     $uiMgr_ add_floor 1 Audio Audio_Icon
 95     $uiMgr_ add_floor 2 Video Video_Icon
 96     $uiMgr_ add_floor 3 Mediaboard Mediaboard_Icon
 97 
 98     set sm [$session_ set sm_]
 99     $sm attach_src_update_handler $uiMgr_
100     pack .main_frame -expand 1 -fill both
101 }
102 
103 
104 FCApp instproc init_ui {} {
105 }
106 

~ [ 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.