aboutsummaryrefslogtreecommitdiff
path: root/list_change.tcl
blob: 2c70937829bae1780e59ce9576556467431e5540 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
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
    }
}