home *** CD-ROM | disk | FTP | other *** search
/ PC World 2002 May / PCWorld_2002-05_cd.bin / Software / TemaCD / activetcltk / ActiveTcl8.3.4.1-8.win32-ix86.exe / ActiveTcl8.3.4.1-win32-ix86 / demos / Snack / mapChan.tcl < prev    next >
Encoding:
Text File  |  2001-10-22  |  1.2 KB  |  49 lines

  1. #!/bin/sh
  2. # the next line restarts using wish \
  3. exec wish8.3 "$0" "$@"
  4.  
  5. package require -exact snack 2.1
  6.  
  7. snack::sound s
  8.  
  9. set v(0) 1
  10. set v(1) 0
  11. set v(2) 0
  12. set v(3) 1
  13. set f [snack::filter map $v(0) $v(1) $v(2) $v(3)]
  14.  
  15. pack [label .l -text "In (L,R)"] -anchor e
  16. pack [frame .f]
  17. pack [label .f.l -text Out] -side left
  18. pack [frame .f.f] -side left
  19. pack [frame .f.f.t]
  20. pack [frame .f.f.b]
  21. pack [label .f.f.t.l -text L] -side left
  22. pack [checkbutton .f.f.t.a -var v(0) -command Config] -side left
  23. pack [checkbutton .f.f.t.b -var v(1) -command Config] -side left
  24. pack [label .f.f.b.l -text R] -side left
  25. pack [checkbutton .f.f.b.a -var v(2) -command Config] -side left
  26. pack [checkbutton .f.f.b.b -var v(3) -command Config] -side left
  27. pack [frame .fb]
  28. snack::createIcons
  29. pack [button .fb.a -image snackOpen -command Load] -side left
  30. pack [button .fb.b -bitmap snackPlay -command Play] -side left
  31. pack [button .fb.c -bitmap snackStop -command "s stop"] -side left
  32.  
  33. proc Config {} {
  34.     global f v
  35.     $f configure $v(0) $v(1) $v(2) $v(3)
  36. }
  37.  
  38. proc Play {} {
  39.     global f
  40.     s stop
  41.     s play -devicechannels 2 -filter $f
  42. }
  43.  
  44. proc Load {} {
  45.  set file [snack::getOpenFile -initialdir [file dirname [s cget -file]]]
  46.  if {$file == ""} return
  47.  s config -file $file
  48. }
  49.