1 # app-mbv2.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 # @(#) $Header: /usr/mash/src/repository/mash/mash-1/tcl/applications/mbv2/app-mbv2.tcl,v 1.12 2002/02/03 04:21:59 lim Exp $
32
33
34 import RTPApplication MTrace MBv2UI MBv2Session mashutils
35
36 Class MBv2App -superclass RTPApplication
37
38
39 #
40 # Initialize the global variables we need
41 # Creates a frame using the provided <i>path</i> and
42 # packs the mediaboard into it.
43 #
44 MBv2App public init { path argv } {
45 $self instvar mbui_
46 $self next mb
47
48 set o [$self options]
49 $self init_args $o
50 $self init_resources $o
51 $o load_preferences "mb"
52 set argv [$o parse_args $argv]
53 if { [llength $argv] == 0 && [$self get_option mbSessionSpec]=={} } {
54 set argv 224.2.55.77/8000
55 }
56
57 if { [llength $argv] > 0 } {
58 $self add_option mbSessionSpec [lindex $argv 0]
59 if { [llength $argv] > 1 } {
60 set extra [lindex $argv 1]
61 $self fatal "extra arguments (starting with $extra)"
62 }
63 }
64
65 MTrace init {trcMB}
66 #{trcMB trcVerbose}
67 catch {srm_trace_flags 0}
68
69 # check if we have the rtpName and rtpEmail definitions
70 $self check_rtp_sdes
71
72 $self init_ui $path
73
74 set title "mbv2: [$self get_option conferenceName] ([$self get_option \
75 mbSessionSpec])"
76 wm title [winfo toplevel $path] $title
77 $self init_srm_session [$self get_option mbSessionSpec]
78 }
79
80
81 #
82 MBv2App instproc init_args {o} {
83 # temporary parameter for debugging
84 $o register_option -u mbv2CnamePrefix
85 $o register_option -cnameprefix mbv2CnamePrefix
86 $o register_option -myname rtpName
87
88 # session address
89 $o register_option -sa mbSessionSpec
90 $o register_option -C conferenceName
91 $o register_option -K sessionKey
92
93 $o register_boolean_option -recvonly mbRecvOnly
94 $o register_option -geometry geometry
95 }
96
97
98 #
99 # These can be overridden.
100 #
101 MBv2App instproc init_resources {o} {
102 option add *Radiobutton.relief flat startupFile
103 }
104
105
106 MBv2App public init_ui { path } {
107 $self instvar ui_
108 set ui_ [new MBv2UI $path]
109 pack $path -fill both -expand 1 -side bottom
110
111 # create the menu bar
112 $ui_ create_menu $path
113 }
114
115
116 MBv2App public init_srm_session { spec } {
117 $self instvar session_
118 set session_ [new MBv2Session $spec [$self get_option mbv2CnamePrefix]]
119 $self instvar ui_
120 $ui_ session $session_
121
122 set cname [$self get_option cname]
123 if { $cname == "" } {
124 set cname [$self get_option mbv2CnamePrefix]
125 if { $cname == "" } { set cname [user_heuristic] }
126 set cname ${cname}@[localaddr]
127 }
128 $session_ app_info [$session_ sender] [$self get_option rtpName] $cname
129 return
130 }
131
This page was automatically generated by the
LXR engine.
Visit the LXR main site for more
information.