From: Andre Noll Date: Sat, 27 Oct 2012 13:36:22 +0000 (+0200) Subject: write: Make wav-related config options modular. X-Git-Tag: v0.4.12~4^2~5 X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=commitdiff_plain;h=d5dc1cb250dfb44d25293e1a01b4c2583df2352a;ds=sidebyside write: Make wav-related config options modular. The --channels, --sample-rate and --sample-format options will also be used by the resample filter. This moves these options to separate files which are included from write.m4. This allows to include them also from the config file of the resample filter. --- diff --git a/m4/gengetopt/channels.m4 b/m4/gengetopt/channels.m4 new file mode 100644 index 00000000..64c2518b --- /dev/null +++ b/m4/gengetopt/channels.m4 @@ -0,0 +1,14 @@ + +option "channels" c +#~~~~~~~~~~~~~~~~~~ +"specify number of channels" +int typestr = "num" +default = "2" +optional +details = " + It is only necessary to specify this option for raw audio. If + it is not given, the channel count is queried from the parent + buffer tree nodes (e.g. the decoder) or the wav header. Only + if this fails, the default value applies. +" + diff --git a/m4/gengetopt/makefile b/m4/gengetopt/makefile index c81eda46..af70a6f4 100644 --- a/m4/gengetopt/makefile +++ b/m4/gengetopt/makefile @@ -27,7 +27,10 @@ $(ggo_dir)/filter.ggo: $(m4_ggo_dir)/loglevel.m4 $(ggo_dir)/fsck.ggo: $(m4_ggo_dir)/loglevel.m4 $(ggo_dir)/gui.ggo: $(m4_ggo_dir)/loglevel.m4 $(m4_ggo_dir)/config_file.m4 $(ggo_dir)/recv.ggo: $(m4_ggo_dir)/loglevel.m4 -$(ggo_dir)/write.ggo: $(m4_ggo_dir)/loglevel.m4 +$(ggo_dir)/write.ggo: $(m4_ggo_dir)/loglevel.m4 \ + $(m4_ggo_dir)/channels.m4 \ + $(m4_ggo_dir)/sample_rate.m4 \ + $(m4_ggo_dir)/sample_format.m4 $(ggo_dir)/client.ggo: \ $(m4_ggo_dir)/loglevel.m4 \ $(m4_ggo_dir)/config_file.m4 \ diff --git a/m4/gengetopt/sample_format.m4 b/m4/gengetopt/sample_format.m4 new file mode 100644 index 00000000..0a100333 --- /dev/null +++ b/m4/gengetopt/sample_format.m4 @@ -0,0 +1,13 @@ + +option "sample-format" f +#~~~~~~~~~~~~~~~~~~~~~~~ +"specify sample format" +# This must match the enum sample_format of para.h +values = "S8", "U8", "S16_LE", "S16_BE", "U16_LE", "U16_BE" enum +default = "S16_LE" +optional +details = " + It is only neccessary to specify this for raw audio. See the + discussion of the --channels option. +" + diff --git a/m4/gengetopt/sample_rate.m4 b/m4/gengetopt/sample_rate.m4 new file mode 100644 index 00000000..b3d107db --- /dev/null +++ b/m4/gengetopt/sample_rate.m4 @@ -0,0 +1,12 @@ + +option "sample-rate" s +#~~~~~~~~~~~~~~~~~~~~~ +"do not guess the input sample rate" +int typestr = "num" +default = "44100" +optional +details = " + It is only neccessary to specify this for raw audio. See the + discussion of the --channels option. +" + diff --git a/m4/gengetopt/write.m4 b/m4/gengetopt/write.m4 index 56698e18..c022bc8f 100644 --- a/m4/gengetopt/write.m4 +++ b/m4/gengetopt/write.m4 @@ -15,31 +15,6 @@ details=" more than once. " -text " - The following options are only necessary for raw audio. When - playing wav files this information is obtained from the - wave header. -" - -option "channels" c -#~~~~~~~~~~~~~~~~~~ -"specify number of channels" -int typestr = "num" -default = "2" -optional - -option "sample-rate" s -#~~~~~~~~~~~~~~~~~~~~~ -"force given sample rate" -int typestr = "num" -default = "44100" -optional - -option "sample-format" f -#~~~~~~~~~~~~~~~~~~~~~~~ -"specify sample format" -# This must match the enum sample_format of para.h -values = "S8", "U8", "S16_LE", "S16_BE", "U16_LE", "U16_BE" enum -default = "S16_LE" -optional - +include(channels.m4) +include(sample_rate.m4) +include(sample_format.m4)