aboutsummaryrefslogtreecommitdiff
path: root/examples/list_change.tcl
diff options
context:
space:
mode:
authormescalinum <mescalinum@users.sourceforge.net>2011-10-02 16:42:06 +0000
committermescalinum <mescalinum@users.sourceforge.net>2011-10-02 16:42:06 +0000
commit44f29524444a96d9e40a76f48750f17e2fdc2974 (patch)
tree179e086e72dd64cd130ee493e78d8535a74a76ec /examples/list_change.tcl
parent5a38f01421e93db2cf5b5c05afe84fb73eb89425 (diff)
reorganize tree following template structure
svn path=/trunk/externals/loaders/tclpd/; revision=15443
Diffstat (limited to 'examples/list_change.tcl')
-rw-r--r--examples/list_change.tcl31
1 files changed, 31 insertions, 0 deletions
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
+ }
+}