Add truncate option to PCM file plugin

Addeed a new option "truncate" to indicate the behavior of creating
the output file.  When it's true (the default), the file is overwritten
and truncated at creation.  When false, the plugin tries to open a
unique file with a number suffix.

The global behavior of "file" and "tee" PCMs is defined via
defaults.pcm.file_truncate option.  You can overwrite it in ~/.asoundrc.
This commit is contained in:
Takashi Iwai 2008-03-12 16:30:26 +01:00
parent fe8bb13400
commit 3d0dae9099
2 changed files with 51 additions and 4 deletions

View file

@ -95,6 +95,8 @@ defaults.pcm.iec958.card defaults.pcm.card
defaults.pcm.iec958.device defaults.pcm.device
defaults.pcm.modem.card defaults.pcm.card
defaults.pcm.modem.device defaults.pcm.device
# truncate files via file or tee PCM
defaults.pcm.file_truncate true
defaults.rawmidi.card 0
defaults.rawmidi.device 0
defaults.rawmidi.subdevice -1
@ -270,6 +272,10 @@ pcm.tee {
slave.pcm $SLAVE
file $FILE
format $FORMAT
truncate {
@func refer
name defaults.pcm.file_truncate
}
}
pcm.file {
@ -285,6 +291,10 @@ pcm.file {
slave.pcm null
file $FILE
format $FORMAT
truncate {
@func refer
name defaults.pcm.file_truncate
}
}
pcm.null {