[PD-cvs] pd/src desire.tk,1.1.2.600.2.369,1.1.2.600.2.370
chunlee
chunlee at users.sourceforge.net
Wed Aug 15 00:08:48 CEST 2007
Update of /cvsroot/pure-data/pd/src
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4871
Modified Files:
Tag: desiredata
desire.tk
Log Message:
wire creation command
Index: desire.tk
===================================================================
RCS file: /cvsroot/pure-data/pd/src/Attic/desire.tk,v
retrieving revision 1.1.2.600.2.369
retrieving revision 1.1.2.600.2.370
diff -C2 -d -r1.1.2.600.2.369 -r1.1.2.600.2.370
*** desire.tk 14 Aug 2007 19:14:27 -0000 1.1.2.600.2.369
--- desire.tk 14 Aug 2007 22:08:43 -0000 1.1.2.600.2.370
***************
*** 165,168 ****
--- 165,170 ----
}
}
+
+ proc lmake {start end} {for {set i $start} {$i<=$end} {incr i} {lappend l $i}; return $l}
#-----------------------------------------------------------------------------------#
set callback_list {}
***************
*** 2058,2062 ****
}
! def Canvas obj {x y} {
set c [$self widget]
set @curpos [list [$c canvasx $x] [$c canvasy $y]]
--- 2060,2064 ----
}
! def Canvas o {x y} {
set c [$self widget]
set @curpos [list [$c canvasx $x] [$c canvasy $y]]
***************
*** 2064,2067 ****
--- 2066,2102 ----
}
+ def Canvas c {from outlet to inlet} {
+ set out_objs [$self c_parse $from]
+ set in_objs [$self c_parse $to]
+ foreach out $out_objs {
+ foreach in $in_objs {
+ $self connect [list $out $outlet $in $inlet]
+ }
+ }
+ }
+
+ def Canvas pc {from outlet to inlet} {
+ set out_objs [$self c_parse $from]
+ set in_objs [$self c_parse $to]
+ if {[llength $out_objs] != [llength $in_objs]} {return "No can do :("}
+ for {set i 0} {$i < [llength $out_objs]} {incr i} {
+ $self connect [list [lindex $out_objs $i] $outlet [lindex $in_objs $i] $inlet]
+ }
+ }
+
+
+ def Canvas c_parse {val} {
+ set objs {}
+ foreach obj [split $val ","] {
+ if {[regexp {\d+-\d+} $obj range]} {
+ set l [split $range "-"]
+ set objs [concat $objs [lmake [lindex $l 0] [lindex $l 1]]]
+ continue
+ }
+ lappend objs $obj
+ }
+ return $objs
+ }
+
def Canvas new_object {sel args} {
$self editmode= 1
More information about the Pd-cvs
mailing list