Update of /cvsroot/pure-data/pd/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25535
Modified Files: Tag: devel_0_39 desire.tk Log Message: can load simple file, only canvas and obj, no sub-patch next: need to make sure the related variables also gets updated too
Index: desire.tk =================================================================== RCS file: /cvsroot/pure-data/pd/src/Attic/desire.tk,v retrieving revision 1.1.2.16 retrieving revision 1.1.2.17 diff -C2 -d -r1.1.2.16 -r1.1.2.17 *** desire.tk 29 Aug 2005 18:40:43 -0000 1.1.2.16 --- desire.tk 30 Aug 2005 09:33:47 -0000 1.1.2.17 *************** *** 331,334 **** --- 331,335 ----
global pd_opendir offset_canvas_file offset_wire_file offset_obj_file _ font + global wire_from wire_to
set directory [string range $filename 0 [expr [string last / $filename] - 1]] *************** *** 336,339 **** --- 337,341 ---- set basename [string range $filename [expr [string last / $filename] + 1] end] if {[string last .pd $filename] >= 0} { + #pd "pd open [pdtk_enquote $basename] [pdtk_enquote $directory] ;" set fl [open $filename r] *************** *** 348,351 **** --- 350,354 ---- set canvas 0 + set obj_list {} *************** *** 371,374 **** --- 374,379 ---- set canvas $canvas_id set offset_canvas_file [expr $offset_canvas_file + 1] + + set _($canvas_id:obj_list) {}
puts "new canvas id -> $canvas_id" *************** *** 389,393 **** set object_id [format %x [expr 0x1111111 + $offset_obj_file]] set offset_obj_file [expr $offset_obj_file + 1] ! puts "create obj" set obj_name [lrange $line 4 end] --- 394,400 ---- set object_id [format %x [expr 0x1111111 + $offset_obj_file]] set offset_obj_file [expr $offset_obj_file + 1] ! lappend _($canvas:obj_list) $object_id ! ! puts "obj_list ::: $_($canvas:obj_list)" puts "create obj" set obj_name [lrange $line 4 end] *************** *** 422,425 **** --- 429,469 ---- puts "create wires" + + #X connect 0 0 1 0; + puts "from obj [lindex $line 2] outlet [lindex $line 3]" + puts "to obj [lindex $line 4] inlet [lindex $line 5]" + + set wire_id [format %x [expr 0x2222222 + $offset_wire_file]]; + set wire_id l$wire_id + set offset_wire_file [expr $offset_wire_file + 1] + + #d = 81168af 0 81168ae 0 0 + + #set d {} + #lappend d [lindex $line 2] + #lappend d [lindex $line 3] + + set d [lrange $line 2 end] + set lsize [expr [llength $line] - 1] + set last_str [string trimright [lindex $line $lsize] ";"] + set d [lreplace $d end end] + set d [lappend d $last_str] + set d [lappend d 0] + set d [lreplace $d 0 0 [lindex $_($canvas:obj_list) [lindex $line 2]]] + set d [lreplace $d 2 2 [lindex $_($canvas:obj_list) [lindex $line 4]]] + + #set from [lindex $wire_from 0] + #set outlet_number [lindex $wire_from 1] + #set to [lindex $wire_to 0] + #set inlet_number [lindex $wire_to 1] + #set inlet_flag 0 + #set outlet_flag 1 + + set wire_from [list [lindex $_($canvas:obj_list) [lindex $line 2]] [lindex $line 3]]] + set wire_to [list [lindex $_($canvas:obj_list) [lindex $line 4]] [lindex $line 5]]] + + puts "d = $d" + wire_update $wire_id $d; + wire_draw2 $wire_id $canvas.c; } *************** *** 429,439 **** } - #foreach item [lindex $lines 0] { - # - # puts "$item" - # - #} } }
--- 473,481 ---- } } + + #puts "$canvas.obj" + }
*************** *** 2240,2243 **** --- 2282,2287 ---- lappend d 0 + + #my wire code #$_($id:outlets) -> number of outlets an object has