Update of /cvsroot/pure-data/pd/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28077
Modified Files: Tag: devel_0_39 desire.tk Log Message: chage audio related runtime settings should work now
Index: desire.tk =================================================================== RCS file: /cvsroot/pure-data/pd/src/Attic/desire.tk,v retrieving revision 1.1.2.584 retrieving revision 1.1.2.585 diff -C2 -d -r1.1.2.584 -r1.1.2.585 *** desire.tk 22 Nov 2006 17:11:13 -0000 1.1.2.584 --- desire.tk 23 Nov 2006 16:01:03 -0000 1.1.2.585 *************** *** 6469,6473 **** }
! def Dialog ok {} {$self apply; $self cancel} def Dialog cancel {} {$self delete} def Dialog close {} {$self delete} --- 6469,6476 ---- }
! def Dialog ok {} { ! if {$self == "pdrc"} {$self write} else {$self apply} ! $self cancel ! } def Dialog cancel {} {$self delete} def Dialog close {} {$self delete} *************** *** 6645,6649 ****
class_new ServerPrefsDialog {PagedDialog} ! def ServerPrefsDialog apply {} {$self write}
def ServerPrefsDialog init_reverse_hash {} { --- 6648,6656 ----
class_new ServerPrefsDialog {PagedDialog} ! ! def ServerPrefsDialog apply {} { ! set audio_props [$self audio_properties=?] ! pd pd audio-dialog $audio_props ! }
def ServerPrefsDialog init_reverse_hash {} { *************** *** 6651,6655 **** foreach {type names} $pdrc_options { set name [lindex $names 0] ! set @$name "" foreach alias $names {set pdrc_options_h($alias) [list $type $name]} if {$name == "audio_api_choice"} { --- 6658,6666 ---- foreach {type names} $pdrc_options { set name [lindex $names 0] ! if {[info exists @$name]} { ! if {$name != "audio_api_choice"} {set @$name ""} ! } else { ! set @$name "" ! } foreach alias $names {set pdrc_options_h($alias) [list $type $name]} if {$name == "audio_api_choice"} { *************** *** 6674,6677 **** --- 6685,6689 ---- set @midiindev "midione" set @midioutdev "miditwo" + # below are also used as -textvariable mset [list @inchannels0 @inchannels1 @inchannels2 @inchannels3] $@inchannels mset [list @outchannels0 @outchannels1 @outchannels2 @outchannels3] $@outchannels *************** *** 6684,6687 **** --- 6696,6709 ---- }
+ def ServerPrefsDialog audio_properties=? {} { + set indev0 [lsearch $@audioindev $@audioindev0] + set outdev0 [lsearch $@audiooutdev $@audiooutdev0] + return [list $indev0 0 0 0 \ + $@inchannels0 $@inchannels1 $@inchannels2 $@inchannels3 \ + $outdev0 0 0 0 \ + $@outchannels0 $@outchannels1 $@outchannels2 $@outchannels3 \ + $@r $@blocksize $@audiobuf] + } + def ServerPrefsDialog read_one {type name contents i} { global pdrc_options_h pd_apilist2 *************** *** 6692,6696 **** --- 6714,6720 ---- choice { if {$name == "audio_api_choice"} { + if {$@$name == ""} { set @$name [lsearch $pd_apilist2 [lindex $contents $i]] + } } else { set @$name [lindex $contents $i] *************** *** 6730,6739 ****
def ServerPrefsDialog write {} { ! global pdrc_options pdrc_options_h cmdline set fd [open $cmdline(rcfilename) w] #set fd stdout; puts "WOULD SAVE:" foreach {type names} $pdrc_options { set name [lindex [split [lindex $names 0] "|"] 0] ! set v $_($self:$name) ;# bug in objective.tcl ? switch $type { folders {foreach item [$v get 0 end] {puts $fd "$name $item"}} --- 6754,6763 ----
def ServerPrefsDialog write {} { ! global pdrc_options pdrc_options_h cmdline pd_apilist2 set fd [open $cmdline(rcfilename) w] #set fd stdout; puts "WOULD SAVE:" foreach {type names} $pdrc_options { set name [lindex [split [lindex $names 0] "|"] 0] ! if {[info exists _($self:$name)]} {set v $_($self:$name)} ;# bug in objective.tcl ? switch $type { folders {foreach item [$v get 0 end] {puts $fd "$name $item"}} *************** *** 6742,6748 **** void {if {$v != ""} {if {$v} {puts $fd $name}}} choice { ! set vv [lindex $names [expr 1+$v]] ! if {$vv != "default"} {puts $fd $vv} } default {if {[string length $v]} {puts $fd "$name $v"}} } --- 6766,6778 ---- void {if {$v != ""} {if {$v} {puts $fd $name}}} choice { ! if {$name != "audio_api_choice"} { ! set vv [lindex $names [expr 1+$v]] ! if {$vv != "default"} {puts $fd $vv} ! } else { ! set vv [lindex $pd_apilist2 $v] ! if {$vv != "default"} {puts $fd $vv} ! } } + devlist {} default {if {[string length $v]} {puts $fd "$name $v"}} }