From 44f29524444a96d9e40a76f48750f17e2fdc2974 Mon Sep 17 00:00:00 2001 From: mescalinum Date: Sun, 2 Oct 2011 16:42:06 +0000 Subject: reorganize tree following template structure svn path=/trunk/externals/loaders/tclpd/; revision=15443 --- examples/list_change.tcl | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 examples/list_change.tcl (limited to 'examples/list_change.tcl') diff --git a/examples/list_change.tcl b/examples/list_change.tcl new file mode 100644 index 0000000..2c70937 --- /dev/null +++ b/examples/list_change.tcl @@ -0,0 +1,31 @@ +package require Tclpd 0.2.1 +package require TclpdLib 0.17 + +pd::class list_change { + constructor { + # add second inlet (first created by default) + pd::add_inlet $self list + + # add outlet + pd::add_outlet $self list + + set @curlist {} + } + + 0_list { + # HOT inlet + if {$args != $@curlist} { + set @curlist $args + pd::outlet $self 0 list $@curlist + } + } + + 0_bang { + pd::outlet $self 0 list $@curlist + } + + 1_list { + # COLD inlet + set @curlist $args + } +} -- cgit v1.2.1