shithub: sox

Download patch

ref: b368a3e6e35629733493e867b09c8d0992e19635
parent: 70663ccd02f7a5179faaaf56fcbe8ccca5549927
author: Ulrich Klauer <ulrich@chirlu.de>
date: Wed Jan 4 14:55:17 EST 2012

Make oops an alias of remix

oops used to be an alias of the mixer effect that is now deprecated.
Make it an alias of remix instead.

--- a/sox.1
+++ b/sox.1
@@ -2477,6 +2477,7 @@
 difference between the left and right stereo channels.
 This is sometimes known as the `karaoke' effect as it often has the effect
 of removing most or all of the vocals from a recording.
+It is equivalent to \fBremix 1,2i 1,2i\fR.
 .TP
 \fBoverdrive\fR [\fIgain\fR(20) [\fIcolour\fR(20)]]
 Non linear distortion.
--- a/src/mixer.c
+++ b/src/mixer.c
@@ -551,23 +551,3 @@
   };
   return &handler;
 }
-
-/*------------------------------- oops effect --------------------------------*/
-
-static int oops_getopts(sox_effect_t * effp, int argc, char * * argv)
-{
-  char * args[] = {0, "1,1,-1,-1"};
-  args[0] = argv[0];
-  return --argc? lsx_usage(effp) : lsx_mixer_effect_fn()->getopts(effp, (int)array_length(args), args);
-}
-
-sox_effect_handler_t const * lsx_oops_effect_fn(void)
-{
-  static sox_effect_handler_t handler;
-  handler = *lsx_mixer_effect_fn();
-  handler.name = "oops";
-  handler.usage = NULL;
-  handler.flags &= ~SOX_EFF_DEPRECATED;
-  handler.getopts = oops_getopts;
-  return &handler;
-}
--- a/src/remix.c
+++ b/src/remix.c
@@ -260,3 +260,22 @@
   };
   return &handler;
 }
+
+/*------------------------- The `oops' effect alias --------------------------*/
+
+static int oops_getopts(sox_effect_t *effp, int argc, char **argv)
+{
+  char *args[] = {0, "1,2i", "1,2i"};
+  args[0] = argv[0];
+  return --argc? lsx_usage(effp) : create(effp, 3, args);
+}
+
+sox_effect_handler_t const * lsx_oops_effect_fn(void)
+{
+  static sox_effect_handler_t handler;
+  handler = *lsx_remix_effect_fn();
+  handler.name = "oops";
+  handler.usage = NULL;
+  handler.getopts = oops_getopts;
+  return &handler;
+}