Update of /cvsroot/pure-data/pd/src
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23918
Modified Files:
Tag: desiredata
desire.tk
Log Message:
subpatcherize supports [inlet~] and [outlet~]
Index: desire.tk
===================================================================
RCS file: /cvsroot/pure-data/pd/src/Attic/desire.tk,v
retrieving revision 1.1.2.600.2.413
retrieving revision 1.1.2.600.2.414
diff -C2 -d -r1.1.2.600.2.413 -r1.1.2.600.2.414
*** desire.tk 17 Oct 2007 00:13:11 -0000 1.1.2.600.2.413
--- desire.tk 18 Oct 2007 12:22:42 -0000 1.1.2.600.2.414
***************
*** 3011,3015 ****
$self motion $x $y $f [$self identify_target $x $y $f]
}
! set @motion_after_id [after 100 "$self motion_update"]
}
--- 3011,3015 ----
$self motion $x $y $f [$self identify_target $x $y $f]
}
! set @motion_after_id [after 50 "$self motion_update"]
}
***************
*** 4043,4053 ****
mset {x y} $center; set inx 0; set outx 0
for {set i 0} {$i < [llength $iolist]} {incr i} {
! mset {type io port} [lindex $iolist $i]
if {$type == "i"} {
! netsend [list #X obj [expr ($inx+1)*100] 0 inlet]
netsend [list #X connect $offset 0 $io $port]
incr inx
} else {
! netsend [list #X obj [expr ($outx+1)*100] [expr $y*2] outlet]
netsend [list #X connect $io $port $offset 0]
incr outx
--- 4043,4055 ----
mset {x y} $center; set inx 0; set outx 0
for {set i 0} {$i < [llength $iolist]} {incr i} {
! mset {type io port dsp} [lindex $iolist $i]
if {$type == "i"} {
! if {$dsp} {set inlet "inlet~"} {set inlet "inlet"}
! netsend [list #X obj [expr ($inx+1)*100] 0 $inlet]
netsend [list #X connect $offset 0 $io $port]
incr inx
} else {
! if {$dsp} {set outlet "outlet~"} {set outlet "outlet"}
! netsend [list #X obj [expr ($outx+1)*100] [expr $y*2] $outlet]
netsend [list #X connect $io $port $offset 0]
incr outx
***************
*** 4060,4067 ****
set tab {}; set result {}
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 ""
--- 4062,4070 ----
set tab {}; set result {}
for {set x 0} {$x < [llength $orig]} {incr x} {
! mset {from k1 io1 dsp} [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 $dsp]]
! #lappend pos $x1; lappend tab [list $k1 $x1 [list $k2 $io2]]
}
set tab [lsort -index 1 -real $tab]; set foo ""
***************
*** 4077,4104 ****
for {set i 0} {$i < [$obj ninlets]} {incr i} {
mset {brk_wires brk_quads} [$self broken_wires i [$@objects search $obj] $i $self]
! if {[llength $brk_wires]} {foreach wire $brk_quads {lappend broken [concat i $wire ]}}
}
for {set o 0} {$o < [$obj noutlets]} {incr o} {
mset {brk_wires brk_quads} [$self broken_wires o [$@objects search $obj] $o $self]
! if {[llength $brk_wires]} {foreach wire $brk_quads {lappend broken [concat o $wire]}}
}
}
# $broken stores totall number of broken connections, i= need [inlet] o = need [outlet]
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]}
puts "\t \t Cutting..............."
$self cut
--- 4080,4117 ----
for {set i 0} {$i < [$obj ninlets]} {incr i} {
mset {brk_wires brk_quads} [$self broken_wires i [$@objects search $obj] $i $self]
! if {[llength $brk_wires]} {
! foreach wire $brk_quads {
! set out_obj_name [[$@objects get [lindex $wire 0]] text]
! if {[regexp {~} $out_obj_name]} {set dsp 1} {set dsp 0}
! lappend broken [concat i $wire $dsp]
! }
! }
}
for {set o 0} {$o < [$obj noutlets]} {incr o} {
mset {brk_wires brk_quads} [$self broken_wires o [$@objects search $obj] $o $self]
! if {[llength $brk_wires]} {
! foreach wire $brk_quads {
! set out_obj_name [[$@objects get [lindex $wire 0]] text]
! if {[regexp {~} $out_obj_name]} {set dsp 1} {set dsp 0}
! lappend broken [concat o $wire $dsp]
! }
! }
}
}
# $broken stores totall number of broken connections, i= need [inlet] o = need [outlet]
foreach c $broken {
! mset {type f o t i dsp} $c
if {$type == "i"} {
! lappend ins [list $t $i];lappend toins [list o $f $o $dsp]
} else {
! lappend outs [list $f $o]; lappend fromouts [list i $t $i $dsp]
}
}
# 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 dsp} $in; lappend iolist [list i [$self idx_map $idx] $p $dsp]}
! foreach out $outs {mset {idx p dsp} $out; lappend iolist [list o [$self idx_map $idx] $p $dsp]}
puts "\t \t Cutting..............."
$self cut
***************
*** 4122,4132 ****
set obj $@subpatcherize_id
foreach wire $wires {
! mset {type f o t i} $wire
! puts "wire:::: $wire"
if {$type == "i"} {
! set idx [lsearch $inlist [list $t $i]]
$self connect [list $f $o [$@objects search $obj] $idx]
} else {
! set idx [lsearch $outlist [list $f $o]]
$self connect [list [$@objects search $obj] $idx $t $i]
}
--- 4135,4144 ----
set obj $@subpatcherize_id
foreach wire $wires {
! mset {type f o t i dsp} $wire
if {$type == "i"} {
! set idx [lsearch $inlist [list $t $i $dsp]]
$self connect [list $f $o [$@objects search $obj] $idx]
} else {
! set idx [lsearch $outlist [list $f $o $dsp]]
$self connect [list [$@objects search $obj] $idx $t $i]
}