Update of /cvsroot/pure-data/extensions/gui/ix In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7008
Modified Files: kbd.wid Log Message: .CVSUX ----------------------------------------------------------------------
Index: kbd.wid =================================================================== RCS file: /cvsroot/pure-data/extensions/gui/ix/kbd.wid,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** kbd.wid 24 May 2005 22:28:08 -0000 1.2 --- kbd.wid 24 May 2005 22:42:42 -0000 1.3 *************** *** 2,20 **** proc kbd_play {t m b x y} { variable _ ! foreach a {{rs {0 sunken 1 raised}} {sr {0 raised 1 sunken}} {v {0 0 1 {($y - [winfo rooty $w]) / ([winfo height $w] + 0.0)}}}} {array set [lindex $a 0] [lindex $a 1]} ! set w [winfo containing $x $y]; set tp $t.rp ! if {$m != 1 && $_($t:lp) != -1 && $_($t:lp) ne $w} { ! $_($t:lp) config -relief raised;pd "$tp _cb [winfo name $_($t:lp)] 0 ;"} ! if {[$w cget -relief] eq $rs($b)} { ! eval $w config -relief $sr($b); pd "$tp _cb [winfo name $w] [eval expr $v($b)] ;"} set _($t:lp) $w}
proc kbd_off {p t octaves} { for {set o 0} {$o < $octaves} {incr o} { for {set on 0} {$on < 12} {incr on} { set no [expr $o * 12 + $on] ! if {[$p.f$o.$no cget -relief] eq "sunken"} { ! $p.f$o.$no config -relief raised ! pd "$t.rp _cb $no 0 ;"}}}}
proc kbd {path t octaves b f} { --- 2,21 ---- proc kbd_play {t m b x y} { variable _ ! foreach a {{rs {0 sunken 1 raised}} {v {0 0 1 {($y - [winfo rooty $w]) / ([winfo height $w] + 0.0)}}}} {array set [lindex $a 0] [lindex $a 1]} ! set w [winfo containing $x $y] ! if {$m != 1 && $_($t:lp) != -1 && $_($t:lp) ne $w} {kbd_action $_($t:lp) $t 0} ! if {[$w cget -relief] eq $rs($b)} {kbd_action $w $t [eval expr $v($b)]} set _($t:lp) $w}
+ proc kbd_action {w t v} { + if {$v == 0} {set relief raised} {set relief sunken} + $w config -relief $relief + pd [concat $t.rp _cb [winfo name $w] $v ;]} + proc kbd_off {p t octaves} { for {set o 0} {$o < $octaves} {incr o} { for {set on 0} {$on < 12} {incr on} { set no [expr $o * 12 + $on] ! if {[$p.f$o.$no cget -relief] eq "sunken"} {kbd_action $p.f$o.$no $t 0}}}}
proc kbd {path t octaves b f} {