OXYGENHUB
◆ main openmsx / share / scripts / _soundlog.tcl
1019 B · Tcl · last changed chore(): initial commit 1 month ago source blame history raw
e8555c89 Andy McCall 1
namespace eval soundlog {
2
3
# Backwards compatibility:
4
#  The 'soundlog' command used to be a built-in openmsx command.
5
#  Reimplemented now via the 'record -audioonly' command.
6
7
set_help_text soundlog \
8
{Controls sound logging: writing the openMSX sound to a wav file.
9
soundlog start              Log sound to file "openmsxNNNN.wav"
10
soundlog start <filename>   Log sound to indicated file
11
soundlog start -prefix foo  Log sound to file "fooNNNN.wav"
12
soundlog stop               Stop logging sound
13
soundlog toggle             Toggle sound logging state
14
}
15
16
set_tabcompletion_proc soundlog [namespace code soundlog_tab]
17
proc soundlog_tab {args} {
18
	if {[llength $args] == 2} {
19
		return [list "start" "stop" "toggle"]
20
	} elseif {[llength $args] == 3 && [lindex $args 2] eq "start"} {
21
		return [list "-prefix"]
22
	}
23
	return [list]
24
}
25
26
proc soundlog {args} {
27
	if {$args eq [list "stop"]} {
28
		record stop
29
	} else {
30
		record {*}$args -audioonly
31
	}
32
}
33
34
namespace export soundlog
35
36
} ;# namespace soundlog
37
38
namespace import soundlog::*