Update of /cvsroot/pure-data/pd/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24732
Modified Files: Tag: desiredata desire.tk Log Message: first attempt at handling object creation serials in client
Index: desire.tk =================================================================== RCS file: /cvsroot/pure-data/pd/src/Attic/desire.tk,v retrieving revision 1.1.2.600 retrieving revision 1.1.2.600.2.1 diff -C2 -d -r1.1.2.600 -r1.1.2.600.2.1 *** desire.tk 28 Nov 2006 20:05:39 -0000 1.1.2.600 --- desire.tk 30 Nov 2006 02:22:46 -0000 1.1.2.600.2.1 *************** *** 214,217 **** --- 214,239 ---- }
+ set serial 0 + + proc serial {n obj} { + global serial replyset + if {$n > $serial} {error "object creation serial number is in the future"} + eval [concat $replyset($serial) [list $obj]] + array unset replyset $serial + } + + proc pd {args} {netsend [join $args]} + + proc netsend {message {callback nonesuch}} { + global serial replyset sock + if {$sock == ""} {error "connection to server needed for doing this"} + if {[string compare $callback nonesuch]} { + set replyset($serial) $callback + incr serial + } + puts $sock "$message;" + puts "<- $message;" + } + #-----------------------------------------------------------------------------------# # object class just to make a variable watchable...? *************** *** 578,582 **** } bind . <Motion> { ! .debug configure -text "widget = %W" } } --- 600,604 ---- } bind . <Motion> { ! .debug.1 configure -text "widget = %W" } } *************** *** 637,641 **** pack [button .controls.switches.dio -text [say io_errors] -command {pd pd audiostatus}] pack .controls.switches -side right ! pack [label .debug -anchor w -text ""] -side bottom -fill x . configure -menu .mbar wm title . "DesireData" --- 659,667 ---- pack [button .controls.switches.dio -text [say io_errors] -command {pd pd audiostatus}] pack .controls.switches -side right ! frame .debug ! pack [label .debug.1 -anchor w -text ""] ! pack [entry .debug.3 -textvariable ::serial] -side right ! pack [label .debug.2 -text "serial: "] -side right ! pack .debug -side bottom -fill x . configure -menu .mbar wm title . "DesireData" *************** *** 975,988 **** set pd_apilist "{ALSA 1}" set pd_apilist2 "default" - proc pd {args} { - global sock - if {$sock == ""} {error "connection to server needed for doing this"} - set s [join $args " "] - puts $sock "$s;" - #flush $sock - #if {[info level]} {set info [info level -1]} {set info "(toplevel)"} - #puts "<- $s; \033[0;1;33m(from $info)\033[0m" - puts "<- $s;" - }
#-----------------------------------------------------------------------------------# --- 1001,1004 ----