[PD-cvs] pd/src desire.tk,1.1.2.600.2.381,1.1.2.600.2.382

chunlee chunlee at users.sourceforge.net
Thu Aug 16 18:21:10 CEST 2007


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

Modified Files:
      Tag: desiredata
	desire.tk 
Log Message:
subpatcherize2.001


Index: desire.tk
===================================================================
RCS file: /cvsroot/pure-data/pd/src/Attic/desire.tk,v
retrieving revision 1.1.2.600.2.381
retrieving revision 1.1.2.600.2.382
diff -C2 -d -r1.1.2.600.2.381 -r1.1.2.600.2.382
*** desire.tk	16 Aug 2007 08:37:01 -0000	1.1.2.600.2.381
--- desire.tk	16 Aug 2007 16:21:02 -0000	1.1.2.600.2.382
***************
*** 3988,3991 ****
--- 3988,4003 ----
  }
  
+ def Canvas subpatcherize_iopos {orig io} {
+ 	for {set x 0} {$x < [llength $orig]} {incr x} {
+ 		mset {from k1 io1} [lindex $orig $x]; mset {k2 io2} [lindex $io $x]
+ 		set obj1 [$@objects get $k1]
+ 		mset {x1 y1 x2 y2} [$obj1 io_bbox $from $io1]; set x1 [expr int($x1)]
+ 		lappend pos $x1; lappend tab [list $k1 $x1 [list $k2 $io2]]
+ 	}
+ 	set tab [lsort -index 1 -real $tab]; set foo ""
+ 	foreach item $tab {mset {k1 val foo2} $item; if {$foo2 != $foo} {lappend result $foo2}; set foo $foo2}
+ 	return $result
+ }
+ 
  def Canvas subpatcherize {} {
  	set center [$self selection_center]
***************
*** 3993,3997 ****
  	set ins {}; set outs {}
  	foreach obj [$@objectsel values] {
- 		puts "\t \t \t \t obj:: $obj"
  		for {set i 0} {$i < [$obj ninlets]} {incr i} {
  			mset {brk_wires brk_quads} [$self broken_wires2 i [$@objects search $obj] $i $self]
--- 4005,4008 ----
***************
*** 4006,4016 ****
  	foreach c $broken {
  		mset {type f o t i} $c
! 		if {$type == "i"} {lappend ins [list $t $i]} {lappend outs [list $f $o]}
  	}
! 	# $inlets/$outlets gives the totall number of inlets/outlets to create
! 	set ins [lsort -unique $ins]; set outs [lsort -unique $outs]
  	# iolist stores in/outlets to be conected inside the subpatch
- 	puts "ins ::: $ins"
- 	puts "out ::: $outs"
  	foreach in $ins {mset {idx p} $in; lappend iolist [list i [$self idx_map $idx] $p]}
  	foreach out $outs {mset {idx p} $out; lappend iolist [list o [$self idx_map $idx] $p]}
--- 4017,4032 ----
  	foreach c $broken {
  		mset {type f o t i} $c
! 		if {$type == "i"} {
! 			lappend ins [list $t $i];lappend toins [list o $f $o]
! 		} else {
! 			lappend outs [list $f $o]; lappend fromouts [list i $t $i]
! 		}
  	}
! 	
! 	# figures out the inlet/outlet positioning and num of in/outlet to create
! 	set ins [$self subpatcherize_iopos $toins $ins]
! 	set outs [$self subpatcherize_iopos $fromouts $outs]
! 	
  	# iolist stores in/outlets to be conected inside the subpatch
  	foreach in $ins {mset {idx p} $in; lappend iolist [list i [$self idx_map $idx] $p]}
  	foreach out $outs {mset {idx p} $out; lappend iolist [list o [$self idx_map $idx] $p]}





More information about the Pd-cvs mailing list