write: Make wav-related config options modular.
authorAndre Noll <maan@systemlinux.org>
Sat, 27 Oct 2012 13:36:22 +0000 (15:36 +0200)
committerAndre Noll <maan@systemlinux.org>
Sun, 25 Nov 2012 13:08:55 +0000 (14:08 +0100)
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.

m4/gengetopt/channels.m4 [new file with mode: 0644]
m4/gengetopt/makefile
m4/gengetopt/sample_format.m4 [new file with mode: 0644]
m4/gengetopt/sample_rate.m4 [new file with mode: 0644]
m4/gengetopt/write.m4

diff --git a/m4/gengetopt/channels.m4 b/m4/gengetopt/channels.m4
new file mode 100644 (file)
index 0000000..64c2518
--- /dev/null
@@ -0,0 +1,14 @@
+<qu>
+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.
+"
+</qu>
index c81eda46dfa1816048133f20868322b769ea7296..af70a6f49601da8ff2f1a9cfeac3329d14969166 100644 (file)
@@ -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 (file)
index 0000000..0a10033
--- /dev/null
@@ -0,0 +1,13 @@
+<qu>
+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.
+"
+</qu>
diff --git a/m4/gengetopt/sample_rate.m4 b/m4/gengetopt/sample_rate.m4
new file mode 100644 (file)
index 0000000..b3d107d
--- /dev/null
@@ -0,0 +1,12 @@
+<qu>
+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.
+"
+</qu>
index 56698e187839786bdbb86558cc8c1171b945dba9..c022bc8f24c83d6ed490cde57159d64b7e571538 100644 (file)
@@ -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)