Update of /cvsroot/pure-data/pd/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3939
Modified Files: Tag: devel_0_39 desire.tk Log Message: more on audio_dialog. now uses spinbox to set in/out channels and audio_api_choice shows correctly
Index: desire.tk =================================================================== RCS file: /cvsroot/pure-data/pd/src/Attic/desire.tk,v retrieving revision 1.1.2.581 retrieving revision 1.1.2.582 diff -C2 -d -r1.1.2.581 -r1.1.2.582 *** desire.tk 21 Nov 2006 07:57:21 -0000 1.1.2.581 --- desire.tk 21 Nov 2006 17:20:50 -0000 1.1.2.582 *************** *** 2183,2190 ****
def Canvas raise {} { ! set w [$self window] ! $w raise ! $w focus ! $w deiconify }
--- 2183,2190 ----
def Canvas raise {} { ! # set w [$self window] ! # $w raise ! # $w focus ! # $w deiconify }
*************** *** 6054,6057 **** --- 6054,6058 ---- }
+ def Dialog add_choice {f name label choices options} { $self add_stuff $f $name $label *************** *** 6064,6074 **** incr i } ! if {[llength $v]==0} {set v 0; set @$name 0} ;# hack ! label $f.butt -text [say [lindex $choices $v]] -relief raised -width 20 balloon $f.butt "click to change setting" pack $f.label $f.butt -side left bind $f.butt <1> [list $self dropmenu_open $f] }
def Dialog add_key {f name label} { set text "" --- 6065,6077 ---- incr i } ! if {[lsearch $choices $v] < 0} {set v [lindex $choices 0]} ! label $f.butt -text [say $v] -relief raised -width 20 balloon $f.butt "click to change setting" pack $f.label $f.butt -side left bind $f.butt <1> [list $self dropmenu_open $f] + }
+ def Dialog add_key {f name label} { set text "" *************** *** 6195,6209 **** set trim_name [string trimleft $name "-"] foreach part $@$trim_name { ! $f.menu add command -label "[expr $i+1]. $part" \ ! -command [list $self dropmenu_set $f $name $part $i] incr i } ! label $f.butt -text " 1. [lindex $@$trim_name 0]" -relief raised -width 20 balloon $f.butt "click to change setting" pack $f.label $f.butt -side left bind $f.butt <1> [list $self dropmenu_open $f] - }
def Dialog listbox_up {listbox} {$self listbox_swap $listbox -1} --- 6198,6235 ---- set trim_name [string trimleft $name "-"] foreach part $@$trim_name { ! $f.menu add command -label $part \ ! -command [list $self dropmenu_set $f $name $part $i 0] incr i } ! label $f.butt -text [lindex $@$trim_name 0] -relief raised -width 20 balloon $f.butt "click to change setting" pack $f.label $f.butt -side left bind $f.butt <1> [list $self dropmenu_open $f] }
+ def Dialog add_spins {f name label option} { + global _ + $self add_stuff $f $name $label + set i 0 + set trim_name [string trimleft $name "-"] + set n [llength $@$option] + foreach part $@$trim_name { + if {$i < $n} {set s "readonly"} else {set s "disabled"} + set v "_($self:$trim_name${i})" + spinbox $f.$i -width 2 -command "$self spinning %d $v" -state $s \ + -textvariable $v + pack $f.$i -side left + balloon $f.$i "Device [expr $i+1]" + incr i + } + } + + def Dialog spinning {mode v} { + puts " mode:: $mode" + switch $mode { + up {incr $v; puts " incr $v"} + down {incr $v -1} + } + }
def Dialog listbox_up {listbox} {$self listbox_swap $listbox -1} *************** *** 6234,6237 **** --- 6260,6264 ---- libraries {$self add_libraries $f $name $label} devlist {$self add_devlist $f $name $label} + spins {$self add_spins $f $name $label $options} section {label $f -text $label -bg "#0000aa" -fg "#ffff55" -font {helvetica -10 bold}} subsection {label $f -text $label -bg "#0000aa" -fg "#ffff55" -font {helvetica -10 bold}} *************** *** 6482,6487 **** }
! def Dialog dropmenu_set {frame var part val} { ! $frame.butt configure -text [say $part] set @$var $val } --- 6509,6515 ---- }
! def Dialog dropmenu_set {frame var part val say} { ! if {$say} {set text [say $part]} else {set text $part} ! $frame.butt configure -text $text set @$var $val } *************** *** 6560,6565 **** devlist -audioindev|-soundindev devlist -audiooutdev|-soundoutdev ! integer -inchannels ! integer -outchannels integer -audiobuf|-soundbuf integer -blocksize --- 6588,6593 ---- devlist -audioindev|-soundindev devlist -audiooutdev|-soundoutdev ! spins {-inchannels audioindev} ! spins {-outchannels audiooutdev} integer -audiobuf|-soundbuf integer -blocksize *************** *** 6635,6638 **** --- 6663,6668 ---- set @midiindev "midione" set @midioutdev "miditwo" + mset [list @inchannels0 @inchannels1 @inchannels2 @inchannels3] $@inchannels + mset [list @outchannels0 @outchannels1 @outchannels2 @outchannels3] $@outchannels $self init_window } *************** *** 6644,6648 **** libraries {incr i; lappend @$name [lindex $contents $i]} files {incr i; lappend @$name [lindex $contents $i]} ! choice { set @$name [lsearch $name [lindex $contents $i]]} void { set @$name 1} default {incr i; set @$name [lindex $contents $i]} --- 6674,6679 ---- libraries {incr i; lappend @$name [lindex $contents $i]} files {incr i; lappend @$name [lindex $contents $i]} ! choice2 { set @$name [lsearch $name [lindex $contents $i]];} ! choice { set @$name [lindex $contents $i];} void { set @$name 1} default {incr i; set @$name [lindex $contents $i]} *************** *** 6724,6728 **** [list $name choice -choices [lrange $names 1 end]]} devlist { ! $self add $f.main.$section [list $name devlist -devlist] } default { --- 6755,6762 ---- [list $name choice -choices [lrange $names 1 end]]} devlist { ! $self add $f.main.$section [list $name devlist] ! } ! spins { ! $self add $f.main.$section [list $name spins [lindex $names 1]] } default {