shithub: sox

Download patch

ref: f5af200cef7352195994ee670c35a0f348d73732
parent: b89950db81515cd28efff0966af14e894b6bf010
author: Ulrich Klauer <ulrich@chirlu.de>
date: Mon Dec 26 03:14:29 EST 2011

Prepare removal of deprecated features

Collect previously deprecated features for 14.4.0 changelog.

Warn user about deprecated -1/-2/-3/-4/-8 and -s/-u/-f/-A/-U/-o/
-i/-a/-g options, remove said options from help message. Correct
the description of -A and -U in the man page (had been interchanged).

--- a/ChangeLog
+++ b/ChangeLog
@@ -14,6 +14,26 @@
   -------  ----------------------  ----------------------
   14.3.0   O --interactive         --no-clobber
 
+Previously deprecated features (to be removed in future):
+
+  Deprec-  Feature    [O(ption)]                           Removal
+  ated in  [F(ormat)] [E(ffect)]   Replacement             due after
+  -------  ----------------------  ----------------------  -------
+  14.3.1   F mp3: lame 3.97        lame > 3.97             14.3.2
+  14.3.1   F sndfile: sndfile 1.0.11 sndfile > 1.0.11      14.3.1
+  14.3.0   F flac: libFLAC 1.1.2,3 libFLAC > 1.1.3         14.3.1
+  14.3.0   PLAY_RATE_ARG           SOX_OPTS                (now)
+  14.3.0   E norm -b, norm -i      gain -B, gain -en       (now)
+  14.3.0   E filter                ~=sinc                  (now)
+  14.3.0   O -1/-2/-3/-4/-8        -b                      14.4.0
+  14.3.0   O -s/-u/-f              -e                      14.4.0
+  14.3.0   O -A/-U/-o/-i/-a/-g     -e                      14.4.0
+  14.2.0   E key alias             pitch                   (now)
+  14.2.0   E pan                   ~= mixer/remix          (now)
+  14.1.0   E resample alias        rate                    (now)
+  14.1.0   E polyphase alias       rate                    (now)
+  14.1.0   E rabbit alias          rate                    (now)
+
 File formats:
 
   o Mention in man pages that WAV files support floating point encodings.
--- a/sox.1
+++ b/sox.1
@@ -1228,7 +1228,7 @@
 .TP
 \fB\-s\fR\^/\fB\-u\fR\^/\fB\-f\fR\^/\fB\-A\fR\^/\fB\-U\fR\^/\fB\-o\fR\^/\fB\-i\fR\^/\fB\-a\fR\^/\fB\-g\fR
 Deprecated aliases for specifying the encoding types
-\fBsigned-integer\fR, \fBunsigned-integer\fR, \fBfloating-point\fR, \fBmu-law\fR, \fBa-law\fR, \fBoki-adpcm\fR, \fBima-adpcm\fR, \fBms-adpcm\fR, \fBgsm-full-rate\fR
+\fBsigned-integer\fR, \fBunsigned-integer\fR, \fBfloating-point\fR, \fBa-law\fR, \fBmu-law\fR, \fBoki-adpcm\fR, \fBima-adpcm\fR, \fBms-adpcm\fR, \fBgsm-full-rate\fR
 respectively (see
 .B \-e
 above).
--- a/src/sox.c
+++ b/src/sox.c
@@ -1886,11 +1886,10 @@
 "-v|--volume FACTOR       Input file volume adjustment factor (real number)",
 "--ignore-length          Ignore input file length given in header; read to EOF",
 "-t|--type FILETYPE       File type of audio",
-"-s/-u/-f/-U/-A/-i/-a/-g  Encoding type=signed-integer/unsigned-integer/floating",
-"                         point/mu-law/a-law/ima-adpcm/ms-adpcm/gsm-full-rate",
-"-e|--encoding ENCODING   Set encoding (ENCODING in above list)",
+"-e|--encoding ENCODING   Set encoding (ENCODING may be one of signed-integer,",
+"                         unsigned-integer, floating-point, mu-law, a-law,",
+"                         ima-adpcm, ms-adpcm, gsm-full-rate)",
 "-b|--bits BITS           Encoded sample size in bits",
-"-1/-2/-3/-4/-8           Encoded sample size in bytes",
 "-N|--reverse-nibbles     Encoded nibble-order",
 "-X|--reverse-bits        Encoded bit-order",
 "--endian little|big|swap Encoded byte-order; swap means opposite to default",
@@ -2383,29 +2382,33 @@
       }
       break;
 
-    case '1': f->encoding.bits_per_sample = 8;  break;
-    case '2': f->encoding.bits_per_sample = 16; break;
-    case '3': f->encoding.bits_per_sample = 24; break;
-    case '4': f->encoding.bits_per_sample = 32; break;
-    case '8': f->encoding.bits_per_sample = 64; break;
+#define DEPRECATED lsx_warn("Option `-%c' is deprecated, use `-b %i' instead.", c, (c-'0')*8)
+    case '1': f->encoding.bits_per_sample = 8;  DEPRECATED; break;
+    case '2': f->encoding.bits_per_sample = 16; DEPRECATED; break;
+    case '3': f->encoding.bits_per_sample = 24; DEPRECATED; break;
+    case '4': f->encoding.bits_per_sample = 32; DEPRECATED; break;
+    case '8': f->encoding.bits_per_sample = 64; DEPRECATED; break;
+#undef DEPRECATED
 
-    case 's': f->encoding.encoding = SOX_ENCODING_SIGN2;     break;
-    case 'u': f->encoding.encoding = SOX_ENCODING_UNSIGNED;  break;
-    case 'f': f->encoding.encoding = SOX_ENCODING_FLOAT;     break;
-    case 'a': f->encoding.encoding = SOX_ENCODING_MS_ADPCM;  break;
-    case 'i': f->encoding.encoding = SOX_ENCODING_IMA_ADPCM; break;
-    case 'o': f->encoding.encoding = SOX_ENCODING_OKI_ADPCM; break;
-    case 'g': f->encoding.encoding = SOX_ENCODING_GSM;       break;
+#define DEPRECATED(encname) lsx_warn("Option `-%c' is deprecated, use `-e %s' instead.", c, encname)
+    case 's': f->encoding.encoding = SOX_ENCODING_SIGN2;     DEPRECATED("signed-integer"); break;
+    case 'u': f->encoding.encoding = SOX_ENCODING_UNSIGNED;  DEPRECATED("unsigned-integer"); break;
+    case 'f': f->encoding.encoding = SOX_ENCODING_FLOAT;     DEPRECATED("floating-point"); break;
+    case 'a': f->encoding.encoding = SOX_ENCODING_MS_ADPCM;  DEPRECATED("ms-adpcm"); break;
+    case 'i': f->encoding.encoding = SOX_ENCODING_IMA_ADPCM; DEPRECATED("ima-adpcm"); break;
+    case 'o': f->encoding.encoding = SOX_ENCODING_OKI_ADPCM; DEPRECATED("oki-adpcm"); break;
+    case 'g': f->encoding.encoding = SOX_ENCODING_GSM;       DEPRECATED("gsm-full-rate"); break;
 
-    case 'U': f->encoding.encoding = SOX_ENCODING_ULAW;
+    case 'U': f->encoding.encoding = SOX_ENCODING_ULAW; DEPRECATED("mu-law");
       if (f->encoding.bits_per_sample == 0)
         f->encoding.bits_per_sample = 8;
       break;
 
-    case 'A': f->encoding.encoding = SOX_ENCODING_ALAW;
+    case 'A': f->encoding.encoding = SOX_ENCODING_ALAW; DEPRECATED("a-law");
       if (f->encoding.bits_per_sample == 0)
         f->encoding.bits_per_sample = 8;
       break;
+#undef DEPRECATED
 
     case 'L': case 'B': case 'x':
       if (f->encoding.reverse_bytes != SOX_OPTION_DEFAULT || f->encoding.opposite_endian)