Changeset 2528
Legend:
- Unmodified
- Added
- Removed
-
rat/trunk/main.c
r2508 r2528 136 136 } 137 137 network_process_mbus(sp[0]); 138 139 if (sp[0]->new_config != NULL) { 140 network_process_mbus(sp[0]); 141 audio_device_reconfigure(sp[0]); 142 network_process_mbus(sp[0]); 143 } 144 145 ui_final_settings(sp[0]); 146 network_process_mbus(sp[0]); 138 147 139 148 if (tx_is_sending(sp[0]->tb) && (sp[0]->mode != AUDIO_TOOL)) { -
rat/trunk/ui.c
r2508 r2528 864 864 } 865 865 866 /* ui_final_settings: so we here we load things that get broken 867 * because we open null audio device first, and it has limited no of 868 * input and output ports. 869 */ 870 871 void 872 ui_final_settings(session_struct *sp) 873 { 874 int i, n; 875 char *mbes; 876 const char *settings[] = { 877 "audio.input.mute", 878 "audio.input.gain", 879 "audio.input.port", 880 "audio.output.mute", 881 "audio.output.gain", 882 "audio.output.port" 883 }; 884 885 n = sizeof(settings)/sizeof(settings[0]); 886 for(i = 0; i < n; i++) { 887 mbes = mbus_encode_str(settings[i]); 888 mbus_qmsg(sp->mbus_engine, mbus_name_ui, "tool.rat.load.setting", mbes, TRUE); 889 xfree(mbes); 890 } 891 } 892 866 893 static void 867 894 ui_3d_options(session_struct *sp) -
rat/trunk/ui.h
r2346 r2528 64 64 void ui_controller_init(struct session_tag *s, u_int32 ssrc, char *name_engine, char *name_ui, char *name_video); 65 65 void ui_initial_settings(struct session_tag *s); 66 void ui_final_settings(struct session_tag *s); 66 67 void ui_quit(struct session_tag *s); 67 68 -
rat/trunk/ui_audiotool.tcl
r2524 r2528 170 170 mbus.quit {eval mbus_recv_mbus.quit $args} 171 171 tool.rat.load.settings {eval mbus_recv_tool.rat.load.settings $args} 172 tool.rat.load.setting {eval mbus_recv_tool.rat.load.setting $args} 172 173 tool.rat.sampling.supported {eval mbus_recv_tool.rat.sampling.supported $args} 173 174 tool.rat.converter {eval mbus_recv_tool.rat.converter $args} … … 262 263 } 263 264 265 proc mbus_recv_tool.rat.load.setting {sname} { 266 global attr 267 # Note when settings get loaded the get set in attr and not updated. So we 268 # use this as a cache for desired values. This is necessary as when the 269 # settings first get loaded we have null audio device and can't set 270 # anything on it meaningfully - i.e. it only has 1 port for input and 1 for output. 271 # 272 switch $sname { 273 audio.input.mute { mbus_send "R" $sname $attr(audioInputMute) } 274 audio.input.gain { mbus_send "R" $sname $attr(audioInputGain) } 275 audio.input.port { mbus_send "R" $sname [mbus_encode_str $attr(audioInputPort)] } 276 audio.output.mute { mbus_send "R" $sname $attr(audioOutputMute) } 277 audio.output.gain { mbus_send "R" $sname $attr(audioOutputGain) } 278 audio.output.port { mbus_send "R" $sname [mbus_encode_str $attr(audioOutputPort)] } 279 default { puts "setting requested has no handler"} 280 } 281 } 282 264 283 proc change_freq {new_freq} { 265 284 global freq … … 2206 2225 # who has the tcl manual? is the only way to pass arrays thru upvar... 2207 2226 if {$win32} { 2208 if {[string first "rtp" "$field"] == -1} {2209 catch {2210 set tmp "[registry get HKEY_CURRENT_USER\\Software\\$V(class)\\$V(app) *$field]"2211 set tmp [string trim $tmp \"]2212 set nerr 02213 } fail2214 } else {2215 catch {2216 set tmp "[registry get HKEY_CURRENT_USER\\Software\\$V(class)\\common *$field]"2217 set tmp [string trim $tmp \"]2218 set nerr 02219 } fail2220 }2221 if {$fail != 0} {2222 puts "Failed to get $field\n";2223 set tmp ""2224 } else {2225 puts "$field $var $tmp"2226 }2227 if {[string first "rtp" "$field"] == -1} { 2228 catch { 2229 set tmp "[registry get HKEY_CURRENT_USER\\Software\\$V(class)\\$V(app) *$field]" 2230 set tmp [string trim $tmp \"] 2231 set nerr 0 2232 } fail 2233 } else { 2234 catch { 2235 set tmp "[registry get HKEY_CURRENT_USER\\Software\\$V(class)\\common *$field]" 2236 set tmp [string trim $tmp \"] 2237 set nerr 0 2238 } fail 2239 } 2240 if {$fail != 0} { 2241 puts "Failed to get $field\n"; 2242 set tmp "" 2243 } else { 2244 puts "$field $var $tmp" 2245 } 2227 2246 } else { 2228 2247 set tmp [option get . $field rat] … … 2239 2258 } 2240 2259 set $var $tmp 2260 set attr($field) $tmp 2241 2261 } 2242 2262 … … 2253 2273 2254 2274 proc load_settings {} { 2255 global rtpfname win32 my_ssrc TOOL 2275 global rtpfname win32 my_ssrc TOOL attr 2256 2276 2257 2277 set attr(zero) "" 2258 2278 if {$win32 == 0} { 2259 if {[file readable $rtpfname]} {2260 set f [open $rtpfname]2261 while {[eof $f] == 0} {2262 gets $f line2263 set field [string trim [lindex $line 0] "*:"]2264 set value [lrange $line 1 end]2265 set attr($field) "$value"2266 }2267 close $f2268 }2279 if {[file readable $rtpfname]} { 2280 set f [open $rtpfname] 2281 while {[eof $f] == 0} { 2282 gets $f line 2283 set field [string trim [lindex $line 0] "*:"] 2284 set value [lrange $line 1 end] 2285 set attr($field) "$value" 2286 } 2287 close $f 2288 } 2269 2289 } 2270 2290 … … 2274 2294 load_setting attr rtpPhone rtcp_phone "" 2275 2295 load_setting attr rtpLoc rtcp_loc "" 2276 load_setting attr audioTool audio_tool ""2296 load_setting attr audioTool audio_tool "" 2277 2297 2278 2298 # If the version of the saved settings is different … … 2294 2314 load_setting attr audioMaxPlayout max_var "2000" 2295 2315 load_setting attr audioLecture lecture_var "0" 2296 load_setting attr audio3dRendering 3d_audio_var "0"2316 load_setting attr audio3dRendering 3d_audio_var "0" 2297 2317 load_setting attr audioAutoConvert convert_var "first" 2298 2318 #security
