diff options
author | mescalinum <mescalinum@users.sourceforge.net> | 2009-09-13 15:50:31 +0000 |
---|---|---|
committer | mescalinum <mescalinum@users.sourceforge.net> | 2009-09-13 15:50:31 +0000 |
commit | 69118070c6c46b2c097b8b2e6fd0870c634b7114 (patch) | |
tree | 6a9b277b993645f57b05a209c1cecc73d42fd073 /pdlib.tcl | |
parent | a4305ad7f5ea71ea826a2a514b21d4b33a6d1192 (diff) |
added support for pd_bind/pd_unbind; added destructor call in tclpd_free
svn path=/trunk/externals/tclpd/; revision=12330
Diffstat (limited to 'pdlib.tcl')
-rw-r--r-- | pdlib.tcl | 21 |
1 files changed, 16 insertions, 5 deletions
@@ -18,13 +18,17 @@ namespace eval ::pd { tclpd_add_proxyinlet [tclpd_get_instance $self] } - proc add_outlet {self sel} { + proc add_outlet {self {sel {}}} { if $::verbose {post [info level 0]} - if {[lsearch -exact {bang float list symbol} $sel] == -1} { + variable _ + if {$sel == {}} { + set o [outlet_new [tclpd_get_object $self] [null_symbol]] + } else { + if {[lsearch -exact {bang float list symbol} $sel] == -1} { return -code error [error_msg "unsupported selector: $sel"] + } + set o [outlet_new [tclpd_get_object $self] [gensym $sel]] } - variable _ - set o [outlet_new [tclpd_get_object $self] [gensym $sel]] lappend _($self:x_outlet) $o return $o } @@ -57,7 +61,14 @@ namespace eval ::pd { outlet_bang $outlet } default { - return -code error [error_msg "unknown selector: $sel"] + set v [lindex $args 0] + set sz [llength $v] + set aa [new_atom_array $sz] + for {set i 0} {$i < $sz} {incr i} { + set_atom_array $aa $i [lindex $v $i] + } + outlet_anything $outlet [gensym $sel] $sz $aa + delete_atom_array $aa $sz } } } |