[PD-cvs] pd/src desire.tk,1.1.2.583,1.1.2.584

chunlee chunlee at users.sourceforge.net
Wed Nov 22 18:11:17 CET 2006


Update of /cvsroot/pure-data/pd/src
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8018

Modified Files:
      Tag: devel_0_39
	desire.tk 
Log Message:
necessary widgets in pdrc editor now updates after sending pd audio-setapi


Index: desire.tk
===================================================================
RCS file: /cvsroot/pure-data/pd/src/Attic/desire.tk,v
retrieving revision 1.1.2.583
retrieving revision 1.1.2.584
diff -C2 -d -r1.1.2.583 -r1.1.2.584
*** desire.tk	22 Nov 2006 02:52:37 -0000	1.1.2.583
--- desire.tk	22 Nov 2006 17:11:13 -0000	1.1.2.584
***************
*** 6070,6077 ****
  	set trim_name [string trimleft $name "-"]
  	if {[lsearch $choices $v] < 0} {set v [lindex $choices 0]}
! 	label $f.butt -text [say $v] -relief raised -width 20
  	balloon $f.butt "click to change setting"
  	pack $f.label $f.butt -side left
! 	bind $f.butt <1> [list $self dropmenu_open $f]
  
  }
--- 6070,6078 ----
  	set trim_name [string trimleft $name "-"]
  	if {[lsearch $choices $v] < 0} {set v [lindex $choices 0]}
! 	#label $f.butt -text [say $v] -relief raised -width 20
! 	label $f.butt -textvariable _($self:${name}2) -relief raised -width 20
  	balloon $f.butt "click to change setting"
  	pack $f.label $f.butt -side left
! 	bind $f.butt <1> [list $self dropmenu_open $f $name $part]
  
  }
***************
*** 6205,6212 ****
  		incr i
  	}
! 	label $f.butt -text [lindex $@$trim_name 0] -relief raised -width 20
  	balloon $f.butt "click to change setting"
  	pack $f.label $f.butt -side left
! 	bind $f.butt <1> [list $self dropmenu_open $f]
  }
  
--- 6206,6214 ----
  		incr i
  	}
! 	#label $f.butt -text [lindex $@$trim_name 0] -relief raised -width 20
! 	label $f.butt -textvariable _($self:${trim_name}0) -relief raised -width 20
  	balloon $f.butt "click to change setting"
  	pack $f.label $f.butt -side left
! 	bind $f.butt <1> [list $self dropmenu_open $f $name $part]
  }
  
***************
*** 6513,6517 ****
  def Dialog dropmenu_set {frame var part val say} {
  	if {$say} {set text [say $part]} else {set text $part}
! 	$frame.butt configure -text $text
  	set @$var $val
  }
--- 6515,6519 ----
  def Dialog dropmenu_set {frame var part val say} {
  	if {$say} {set text [say $part]} else {set text $part}
! 	#$frame.butt configure -text $text
  	set @$var $val
  }
***************
*** 6658,6663 ****
--- 6660,6669 ----
  
  def ServerPrefsDialog audio_properties {indevlist indevs inchans outdevlist outdevs outchans sr dspblock advance multi} {
+ 	global pd_apilist2
  	set @audioindev $indevlist
  	set @audiooutdev $outdevlist
+ 	# the following @audioindev* is used as -textvariable for devlist
+ 	set @audioindev0 [lindex $@audioindev 0]
+ 	set @audiooutdev0 [lindex $@audiooutdev 0]
  	set @inchannels $inchans
  	set @outchannels $outchans
***************
*** 6670,6673 ****
--- 6676,6680 ----
  	mset [list @inchannels0 @inchannels1 @inchannels2 @inchannels3] $@inchannels
  	mset [list @outchannels0 @outchannels1 @outchannels2 @outchannels3] $@outchannels
+ 	set @audio_api_choice2 [say [lindex $pd_apilist2 $@audio_api_choice]]
  	if {![winfo exists .$self.1.main.1]} {
  		$self init_content
***************
*** 6678,6687 ****
  
  def ServerPrefsDialog read_one {type name contents i} {
! 	global pdrc_options_h
  	switch -- $type {
  		folders   {incr i; lappend @$name [lindex $contents $i]}
  		libraries {incr i; lappend @$name [lindex $contents $i]}
  		files     {incr i; lappend @$name [lindex $contents $i]}
! 		choice    {        set     @$name [lindex $contents $i]}
  		void      {        set @$name 1}
  		default   {incr i; set @$name [lindex $contents $i]}
--- 6685,6700 ----
  
  def ServerPrefsDialog read_one {type name contents i} {
! 	global pdrc_options_h pd_apilist2
  	switch -- $type {
  		folders   {incr i; lappend @$name [lindex $contents $i]}
  		libraries {incr i; lappend @$name [lindex $contents $i]}
  		files     {incr i; lappend @$name [lindex $contents $i]}
! 		choice    {
! 			if {$name == "audio_api_choice"} {
! 				set @$name [lsearch $pd_apilist2 [lindex $contents $i]]
! 			} else {
! 				set @$name [lindex $contents $i]
! 			}
! 		}
  		void      {        set @$name 1}
  		default   {incr i; set @$name [lindex $contents $i]}
***************
*** 6771,6775 ****
  
  def ServerPrefsDialog update_content {} {
! 	puts " update........."
  }
  
--- 6784,6805 ----
  
  def ServerPrefsDialog update_content {} {
! 	$self update_channels
! }
! 
! def ServerPrefsDialog update_channels {} {
! 	set indev_len [llength $@audioindev]
! 	set outdev_len [llength $@audiooutdev]
! 	set i 0
! 	foreach chan $@inchannels {
! 		if {$i < $indev_len} {set s "readonly"} else {set s "disabled"}
! 		.$self.1.main.1.-inchannels.$i configure -state $s
! 		incr i
! 	}
! 	set i 0
! 	foreach chan $@outchannels {
! 		if {$i < $outdev_len} {set s "readonly"} else {set s "disabled"}
! 		.$self.1.main.1.-outchannels.$i configure -state $s
! 		incr i
! 	}
  }
  
***************
*** 6784,6797 ****
  
  def ServerPrefsDialog dropmenu_set {frame var part val say} {
! 	global pd_apilist pd_apilist2
! 	foreach api $pd_apilist {
! 		if {[lsearch $api [string trimleft $part "-"]] >= 0} {
! 			pd pd audio-setapi [lindex $api 1]
! 			after 1 pd pd audio-properties 
  		}
! 	}
! 	super $frame $var $part $val $say
  }
  
  
  #################### ClientPrefsDialog
--- 6814,6847 ----
  
  def ServerPrefsDialog dropmenu_set {frame var part val say} {
! 	global pd_apilist pd_apilist2 _
! 	set trim_part [string trimleft $part "-"]
! 	set trim_var [string trimleft $var "-"]
! 	if {$var == "audio_api_choice"} {
! 		foreach api $pd_apilist {
! 			if {$trim_part == [string tolower [lindex $api 0]]} {
! 				pd pd audio-setapi [lindex $api 1]
! 				after 1 pd pd audio-properties 
! 			}
  		}
! 	} else {
! 		set _($self:${trim_var}0) $part
! 	      } 
! 	 super $frame $var $part $val $say
  }
  
+ def ServerPrefsDialog dropmenu_open {f name part} {
+ 	global pd_apilist pd_apilist2 _
+ 	set trim_name [string trimleft $name "-"]
+ 	if {$trim_name != "audio_api_choice"} {
+ 		set i 0
+ 		set m $f.menu
+ 		$m delete 0 end
+ 		foreach part $@$trim_name {
+ 			$m add command -label $part -command [list $self dropmenu_set $f $name $part $i 0]
+ 			incr i
+ 		}
+ 	}
+ 	super $f
+ }
  
  #################### ClientPrefsDialog





More information about the Pd-cvs mailing list