diff options
Diffstat (limited to 'examples/list_change.tcl')
-rw-r--r-- | examples/list_change.tcl | 31 |
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 + } +} |