From f3e255ddca6468b6adea0f10f30540c37cdde9ad Mon Sep 17 00:00:00 2001 From: "N.N." Date: Tue, 18 Sep 2007 17:19:03 +0000 Subject: first commit for tclpd external svn path=/trunk/externals/tclpd/; revision=8736 --- list_change.tcl | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 list_change.tcl (limited to 'list_change.tcl') diff --git a/list_change.tcl b/list_change.tcl new file mode 100644 index 0000000..34ffe9a --- /dev/null +++ b/list_change.tcl @@ -0,0 +1,32 @@ +source pdlib.tcl + +pd::class list_change { +# inlet float + outlet list +# outlet float + + constructor { + if [pd::args] { + set n [pd::arg_int 0] + for {set i 0} {$i < $n} {incr i} { + pd::add_inlet $self float + } + } + set @curlist {} + } + + 0_list { + set newlist $args + if {$newlist != $@curlist} { + pd::outlet $self 0 list $newlist + } + set @curlist $newlist + + pd::outlet $self 1 float [pd::inlet $self 1] + } + + 0_bang { + pd::post "right value is: [pd::inlet $self 1]" + } +} + -- cgit v1.2.1