aboutsummaryrefslogtreecommitdiff
path: root/list_change.tcl
blob: 34ffe9abdf715a4cc1c31acb5ff8b96f5116c9bb (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
32
source pdlib.tcl

pd::class list_change {
#    inlet float
    outlet list
#    outlet float

    constructor {
        if [pd::args] {
            set n [pd::arg_int 0]
            for {set i 0} {$i < $n} {incr i} {
                pd::add_inlet $self float
            }
        }
        set @curlist {}
    }

    0_list {
        set newlist $args
        if {$newlist != $@curlist} {
            pd::outlet $self 0 list $newlist
        }
        set @curlist $newlist

        pd::outlet $self 1 float [pd::inlet $self 1]
    }

    0_bang {
        pd::post "right value is: [pd::inlet $self 1]"
    }
}