Update of /cvsroot/pure-data/pd/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30075
Modified Files: Tag: devel_0_39 desire.tk Log Message: first step of seperating pdrc and ddrc gui config editor
Index: desire.tk =================================================================== RCS file: /cvsroot/pure-data/pd/src/Attic/desire.tk,v retrieving revision 1.1.2.168 retrieving revision 1.1.2.169 diff -C2 -d -r1.1.2.168 -r1.1.2.169 *** desire.tk 20 Apr 2006 18:18:52 -0000 1.1.2.168 --- desire.tk 21 Apr 2006 01:38:41 -0000 1.1.2.169 *************** *** 572,576 **** }
! def Client pdrc_editor {} {PrefsDialog new_as pdrc}
proc menu_pop_pd {} {raise .} --- 572,578 ---- }
! def Client pdrc_editor {} {ServerPrefsDialog new_as pdrc} ! def Client ddrc_editor {} {ClientPrefsDialog new_as ddrc} !
proc menu_pop_pd {} {raise .} *************** *** 589,592 **** --- 591,595 ---- set cmd "%W $text" set text [say $text] + puts "text == $text" } set accel [accel_munge $accel] *************** *** 612,615 **** --- 615,619 ---- {} {pdrc_editor {} "Ctrl+p"} + {ddrc_editor {} "Ctrl+l"} {send_message {} "Ctrl+m"} {paths {} ""} *************** *** 3370,3374 **** }
! proc properties_dialog {self w ok struct} { global _ #set label_width 0 --- 3374,3378 ---- }
! proc properties_dialog {self w ok which struct} { global _ #set label_width 0 *************** *** 3414,3418 **** pack [label $f.label -text [lindex $label 0]] $f -side left ! set m [menu .popupMenu -tearoff 0] foreach part [lrange $label 1 end] { $m add command -label $part -command [list dropmenu_set $f $part] --- 3418,3422 ---- pack [label $f.label -text [lindex $label 0]] $f -side left ! set m [menu .$which -tearoff 0] foreach part [lrange $label 1 end] { $m add command -label $part -command [list dropmenu_set $f $part] *************** *** 3424,3428 **** balloon $f.label_set "click to change setting" pack $f.label_set -side top -fill x ! bind $f.label_set <1> {tk_popup .popupMenu [expr %X - 100] %Y} } --- 3428,3432 ---- balloon $f.label_set "click to change setting" pack $f.label_set -side top -fill x ! bind $f.label_set <1> {tk_popup .$which [expr %X - 100] %Y} } *************** *** 3465,3469 **** } pack $f -side top -fill x ! catch {$f.label configure -width 45 -anchor nw} } } --- 3469,3473 ---- } pack $f -side top -fill x ! catch {$f.label configure -width 45 -anchor e} } } *************** *** 3621,3629 **** }
! class_new PrefsDialog {PagedDialog} ! def PrefsDialog cancel {} {$self _delete} ! def PrefsDialog apply {} {$self write}
! def PrefsDialog read {} { global pdrc_options pdrc_options_h cmdline set fd [open $cmdline(rcfilename) "RDONLY CREAT"] --- 3625,3633 ---- }
! class_new ServerPrefsDialog {PagedDialog} ! def ServerPrefsDialog cancel {} {$self _delete} ! def ServerPrefsDialog apply {} {$self write}
! def ServerPrefsDialog read {} { global pdrc_options pdrc_options_h cmdline set fd [open $cmdline(rcfilename) "RDONLY CREAT"] *************** *** 3655,3659 **** }
! def PrefsDialog write {} { global pdrc_options pdrc_options_h cmdline set fd [open $cmdline(rcfilename) w] --- 3659,3663 ---- }
! def ServerPrefsDialog write {} { global pdrc_options pdrc_options_h cmdline set fd [open $cmdline(rcfilename) w] *************** *** 3671,3675 **** }
! def PrefsDialog init {} { global pdrc_options $self read --- 3675,3679 ---- }
! def ServerPrefsDialog init {} { global pdrc_options $self read *************** *** 3683,3693 **** alias {} radio { ! properties_dialog $self $f.main.$section PrefsDialog_ok \ [list [lindex $name 0] "$desc" choice {}] } default { ! #properties_dialog $self $f.main.$section PrefsDialog_ok \ # [list $name "$name: $desc" $type {}] ! properties_dialog $self $f.main.$section PrefsDialog_ok \ [list $name $desc $type {}] } --- 3687,3697 ---- alias {} radio { ! properties_dialog $self $f.main.$section ServerPrefsDialog_ok server \ [list [lindex $name 0] "$desc" choice {}] } default { ! #properties_dialog $self $f.main.$section ServerPrefsDialog_ok \ # [list $name "$name: $desc" $type {}] ! properties_dialog $self $f.main.$section ServerPrefsDialog_ok server \ [list $name $desc $type {}] } *************** *** 3697,3701 **** }
! def PrefsDialog _delete {} {super; catch {destroy .popupMenu}}
############ other stuff ######### --- 3701,3853 ---- }
! def ServerPrefsDialog _delete {} {super; catch {destroy .server}} ! ! #################### ClientPrefsDialog ! ! set ddrc_options { ! section "" "DDRC" ! integer -r "sample rate" ! devlist -soundindev|-audioindev "audio in devices" ! devlist -soundoutdev|-audiooutdev "audio out devices" ! alias -sounddev|-audiodev {list -soundindev %1 -soundoutdev %1} ! devlist -inchannels "audio input channels (by device, like "2" or "16,8")" ! devlist -outchannels "number of audio out channels (same)" ! alias -channels {list -inchannels %1 -outchannels %1} ! integer -audiobuf|-soundbuf "specify size of audio buffer in msec" ! integer -blocksize "specify audio I/O block size in sample frames" ! integer -sleepgrain "specify number of milliseconds to sleep when idle" ! void -nodac "suppress audio output" ! void -noadc "suppress audio input" ! alias -noaudio|-nosound {list -nodac -noadc} ! radio {"" -alsa -jack -mmio -portaudio|-pa|-asio -oss} { ! "Sound API: " ! "default" ! "use ALSA audio API" ! "use JACK audio API" ! "use MMIO audio API (default for Windows)" ! "use ASIO audio driver (via Portaudio)" ! "use OSS audio API" ! } ! void -32bit "allow 32 bit OSS audio (for RME Hammerfall)" ! ! section "" "MIDI" ! void -nomidiin "suppress MIDI input" ! void -nomidiout "suppress MIDI output" ! alias -nomidi {list -nomidiin -nomidiout} ! devlist -midiindev "midi in device list; e.g., "1,3" for first and third" ! devlist -midioutdev "midi out device list, same format" ! alias -mididev {list -midindev %1 -midioutdev %1} ! ! section "" "Externals" ! folders -path "add to file search path" ! folders -helppath "add to help file search path" ! files -lib "load object library(s)" ! ! section "" "Gooey" ! void -nogui "suppress starting the GUI (caution)" ! string -guicmd "substitute another GUI program (e.g., rsh)" ! integer -console "console scrollback lines (0 = disable console)" ! folder -look "folder containing buttonbar icons" ! void -statusbar "enable statusbar" ! integer -font "specify default font size in points" ! ! section "" "Other" ! files -open "open file(s) on startup" ! void -verbose "extra printout on startup and when searching for files" ! integer -d "debug level" ! void -noloadbang "disable the effect of [loadbang]" ! string -send "send a message at startup (after patches are loaded)" ! void -listdev "list audio and MIDI devices upon startup" ! void -rt|-realtime "use real-time priority (needs root privilege)" ! ! section "" "Look" ! files -open "open file(s) on startup" ! void -verbose "extra printout on startup and when searching for files" ! integer -d "debug level" ! void -noloadbang "disable the effect of [loadbang]" ! string -send "send a message at startup (after patches are loaded)" ! void -listdev "list audio and MIDI devices upon startup" ! void -rt|-realtime "use real-time priority (needs root privilege)" ! } ! ! ! class_new ClientPrefsDialog {PagedDialog} ! def ClientPrefsDialog cancel {} {$self _delete} ! def ClientPrefsDialog apply {} {$self write} ! ! def ClientPrefsDialog read {} { ! global ddrc_options ddrc_options_h cmdline ! set fd [open $cmdline(rcfilename) "RDONLY CREAT"] ! set contents [split [string map {"\n" " "} [read $fd]] " "] ! close $fd ! foreach {type name desc} $ddrc_options { ! set @$name "" ! foreach subname [split $name |] { ! set ddrc_options_h($subname) [list $type $name $desc] ! } ! } ! set i 0 ! while {$i < [llength $contents]} { ! set op [lindex $contents $i] ! puts "op=$op" ! if {[string length $op]==0} {break} ! if {![info exists ddrc_options_h($op)]} { ! error "unknown option: $op" ! } ! foreach {type name desc} $ddrc_options_h($op) {} ! switch $type { ! folders {incr i; lappend @$name [lindex $contents $i]} ! files {incr i; lappend @$name [lindex $contents $i]} ! void {set @$name 1} ! default {incr i; set @$name [lindex $contents $i]} ! } ! incr i ! } ! } ! ! def ClientPrefsDialog write {} { ! global ddrc_options ddrc_options_h cmdline ! set fd [open $cmdline(rcfilename) w] ! foreach {type name desc} $ddrc_options { ! set v $@$name ! set op [lindex [split $name |] 0] ! switch $type { ! folders {foreach x $v {puts $fd "$op $x"}} ! files {foreach x $v {puts $fd "$op $x"}} ! void {if {[string length $v]} {if {$v} {puts $fd $op}}} ! default {if {[string length $v]} {puts $fd "$op $v"}} ! } ! } ! close $fd ! } ! ! def ClientPrefsDialog init {} { ! global ddrc_options ! $self read ! super ! set f .$self.1 ! set section 0 ! foreach {type name desc} $ddrc_options { ! switch $type { void { set type toggle }} ! switch $type { ! section {$self add_section [incr section] $desc} ! alias {} ! radio { ! properties_dialog $self $f.main.$section ClientPrefsDialog_ok client \ ! [list [lindex $name 0] "$desc" choice {}] ! } ! default { ! #properties_dialog $self $f.main.$section ClientPrefsDialog_ok \ ! # [list $name "$name: $desc" $type {}] ! properties_dialog $self $f.main.$section ClientPrefsDialog_ok client \ ! [list $name $desc $type {}] ! } ! } ! } ! $self page_select 1 ! } ! ! def ClientPrefsDialog _delete {} {super; catch {destroy .client}} !
############ other stuff #########