Changeset 2254

Show
Ignore:
Timestamp:
02/23/99 22:22:11 (15 years ago)
Author:
ucacoxh
Message:

- Removed output channels from audio device settings. Format user selects

in the audio panel is the input format. The actual device format rat uses
is derived from the input format and whether 3d rendering is enabled.

- Put catch statement around script with a bomb out at the end to catch

errors in syntax of script with suitable error message.

Location:
rat/trunk
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • rat/trunk/ui.c

    r2238 r2254  
    454454                debug_msg("Could not get ifmt\n"); 
    455455        } 
    456          
    457         af = audio_get_ofmt(sp->audio_device); 
    458         if (af && audio_format_name(af, fmt_buf, 64)) { 
    459                 mbes = mbus_encode_str(fmt_buf); 
    460                 mbus_qmsg(sp->mbus_engine, mbus_name_ui, "tool.rat.format.out", mbes, TRUE); 
    461                 xfree(mbes); 
    462         } else { 
    463                 debug_msg("Could not get ofmt\n"); 
    464         } 
    465456} 
    466457 
  • rat/trunk/ui_audiotool.tcl

    r2155 r2254  
     1catch { 
    12# 
    23# Copyright (c) 1995-99 University College London 
     
    179180                tool.rat.sync                   {eval mbus_recv_tool.rat.sync $args} 
    180181                tool.rat.format.in              {eval mbus_recv_tool.rat.format.in $args} 
    181                 tool.rat.format.out              {eval mbus_recv_tool.rat.format.out $args} 
    182182                tool.rat.codec                  {eval mbus_recv_tool.rat.codec $args} 
    183183                tool.rat.rate                   {eval mbus_recv_tool.rat.rate $args} 
     
    260260    set m1 .prefs.pane.audio.dd.sampling.ch_in.mb.m  
    261261    $m1 delete 0 last 
    262     set m2 .prefs.pane.audio.dd.sampling.ch_out.mb.m  
    263     $m2 delete 0 last 
    264      
    265262    set s [lsearch -glob $channel_support *$freq*] 
    266263     
    267264    foreach i [lrange [split [lindex $channel_support $s] ","] 1 2] { 
    268265         $m1 add command -label "$i" -command "set ichannels $i; change_sampling" 
    269          $m2 add command -label "$i" -command "set ochannels $i; change_sampling" 
    270266    } 
    271267} 
     
    399395    set ichannels [lindex $e 2] 
    400396    puts "tool.rat.format.in \"$freq\" \"$ichannels\"" 
    401 } 
    402  
    403 proc mbus_recv_tool.rat.format.out {arg} { 
    404     global freq ochannels 
    405     set e [split $arg ","] 
    406      
    407     set freq      [lindex $e 1] 
    408     set ochannels [lindex $e 2] 
    409     puts "tool.rat.format.out \"$freq\" \"$ochannels\"" 
    410397} 
    411398 
     
    13881375frame $i.dd.sampling.freq 
    13891376frame $i.dd.sampling.ch_in 
    1390 frame $i.dd.sampling.ch_out 
    1391 pack $i.dd.sampling.freq $i.dd.sampling.ch_in $i.dd.sampling.ch_out -side left -fill x 
     1377pack $i.dd.sampling.freq $i.dd.sampling.ch_in -side left -fill x 
    13921378 
    13931379label $i.dd.sampling.freq.l   -text "Sample Rate:   " 
    1394 label $i.dd.sampling.ch_in.l  -text "Input Channels:" 
    1395 label $i.dd.sampling.ch_out.l -text "Output Channels:" 
    1396 pack $i.dd.sampling.freq.l $i.dd.sampling.ch_in.l $i.dd.sampling.ch_out.l -fill x 
     1380label $i.dd.sampling.ch_in.l  -text "Channels:" 
     1381pack $i.dd.sampling.freq.l $i.dd.sampling.ch_in.l -fill x 
    13971382 
    13981383menubutton $i.dd.sampling.freq.mb -menu $i.dd.sampling.freq.mb.m -indicatoron 1 \ 
     
    14051390pack $i.dd.sampling.ch_in.mb -side left -fill x -expand 1 
    14061391menu $i.dd.sampling.ch_in.mb.m  
    1407  
    1408 menubutton $i.dd.sampling.ch_out.mb -menu $i.dd.sampling.ch_out.mb.m -indicatoron 1 \ 
    1409                                   -textvariable ochannels -relief raised  
    1410 pack $i.dd.sampling.ch_out.mb -side left -fill x -expand 1 
    1411 menu $i.dd.sampling.ch_out.mb.m  
    14121392 
    14131393frame $i.cks -relief sunken 
     
    17601740    save_setting $f audioFrequency         freq 
    17611741    save_setting $f audioChannelsIn        ichannels 
    1762     save_setting $f audioChannelsOut       ochannels 
    17631742    save_setting $f audioPrimary           prenc 
    17641743    save_setting $f audioUnits             upp 
     
    19151894    load_setting attr audioFrequency         freq          "8-kHz" 
    19161895    load_setting attr audioChannelsIn        ichannels     "Mono" 
    1917     load_setting attr audioChannelsOut       ochannels     "Mono" 
    19181896    load_setting attr audioPrimary           prenc         "GSM" 
    19191897    load_setting attr audioUnits             upp           "2" 
     
    24122390add_help $i.dd.sampling.ch_in.mb \ 
    24132391                        "Changes between mono and stereo audio input." 
    2414 add_help $i.dd.sampling.ch_out.mb \ 
    2415                         "Changes between mono and stereo audio output." 
    24162392add_help $i.cks.f.f.silence\ 
    24172393                         "Prevents silence from being transmitted when the speaker is silent\n\ 
     
    24852461                         is good quality, orange medium quality, and\n red poor quality audio." 
    24862462 
     2463} script_error 
     2464 
     2465if { $script_error != "" } { 
     2466    puts "Error: \"$script_error\"" 
     2467    destroy . 
     2468    exit -1 
     2469}