aboutsummaryrefslogtreecommitdiff
path: root/examples/list_change.tcl
diff options
context:
space:
mode:
Diffstat (limited to 'examples/list_change.tcl')
-rw-r--r--examples/list_change.tcl47
1 files changed, 24 insertions, 23 deletions
diff --git a/examples/list_change.tcl b/examples/list_change.tcl
index 2c70937..26190e4 100644
--- a/examples/list_change.tcl
+++ b/examples/list_change.tcl
@@ -1,31 +1,32 @@
-package require Tclpd 0.2.1
-package require TclpdLib 0.17
+package require Tclpd 0.2.3
+package require TclpdLib 0.19
-pd::class list_change {
- constructor {
- # add second inlet (first created by default)
- pd::add_inlet $self list
+proc+ list_change::constructor {self args} {
+ # add second inlet (first created by default)
+ pd::add_inlet $self list
- # add outlet
- pd::add_outlet $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
- }
- }
+ set @curlist {}
+}
- 0_bang {
+proc+ list_change::0_list {self args} {
+ # HOT inlet
+ if {$args != $@curlist} {
+ set @curlist $args
pd::outlet $self 0 list $@curlist
}
+}
- 1_list {
- # COLD inlet
- set @curlist $args
- }
+proc+ list_change::0_bang {self} {
+ if {$@curlist == {}} return
+ pd::outlet $self 0 list $@curlist
}
+
+proc+ list_change::1_list {self args} {
+ # COLD inlet
+ set @curlist $args
+}
+
+pd::class list_change