_soundlog.tcl 1019 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. namespace eval soundlog {
  2. # Backwards compatibility:
  3. # The 'soundlog' command used to be a built-in openmsx command.
  4. # Reimplemented now via the 'record -audioonly' command.
  5. set_help_text soundlog \
  6. {Controls sound logging: writing the openMSX sound to a wav file.
  7. soundlog start Log sound to file "openmsxNNNN.wav"
  8. soundlog start <filename> Log sound to indicated file
  9. soundlog start -prefix foo Log sound to file "fooNNNN.wav"
  10. soundlog stop Stop logging sound
  11. soundlog toggle Toggle sound logging state
  12. }
  13. set_tabcompletion_proc soundlog [namespace code soundlog_tab]
  14. proc soundlog_tab {args} {
  15. if {[llength $args] == 2} {
  16. return [list "start" "stop" "toggle"]
  17. } elseif {[llength $args] == 3 && [lindex $args 2] eq "start"} {
  18. return [list "-prefix"]
  19. }
  20. return [list]
  21. }
  22. proc soundlog {args} {
  23. if {$args eq [list "stop"]} {
  24. record stop
  25. } else {
  26. record {*}$args -audioonly
  27. }
  28. }
  29. namespace export soundlog
  30. } ;# namespace soundlog
  31. namespace import soundlog::*