From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS22989 209.51.188.0/24 X-Spam-Status: No, score=-4.2 required=3.0 tests=AWL,BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_LOW, SPF_HELO_NONE,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id 8607E1F5AD for ; Thu, 9 Apr 2020 20:14:49 +0000 (UTC) Received: from localhost ([::1]:54938 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jMdZY-0006be-OQ for e@80x24.org; Thu, 09 Apr 2020 16:14:48 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35395) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jMdXN-0006Bv-EN for dtas-all@nongnu.org; Thu, 09 Apr 2020 16:12:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jMdXM-0008LO-F9 for dtas-all@nongnu.org; Thu, 09 Apr 2020 16:12:33 -0400 Received: from dcvr.yhbt.net ([64.71.152.64]:56392) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1jMdXM-0008Kx-A6 for dtas-all@nongnu.org; Thu, 09 Apr 2020 16:12:32 -0400 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 88D461F610 for ; Thu, 9 Apr 2020 20:12:22 +0000 (UTC) From: Eric Wong To: dtas-all@nongnu.org Subject: [PATCH 2/2] splitfx: support --err-suffix option Date: Thu, 9 Apr 2020 20:12:22 +0000 Message-Id: <20200409201222.24112-3-e@yhbt.net> In-Reply-To: <20200409201222.24112-1-e@yhbt.net> References: <20200409201222.24112-1-e@yhbt.net> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 64.71.152.64 X-Mailman-Approved-At: Thu, 09 Apr 2020 16:14:47 -0400 X-BeenThere: dtas-all@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: duct tape audio suite List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dtas-all-bounces+e=80x24.org@nongnu.org Sender: "dtas-all" Write the contents of "stderr". This is useful for capturing the per-track output of the sox(1) "stats" effect when combined with parallel "--jobs". --- Documentation/dtas-splitfx.pod | 6 ++++++ bin/dtas-splitfx | 7 +++++++ lib/dtas/splitfx.rb | 5 ++++- 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/Documentation/dtas-splitfx.pod b/Documentation/dtas-splitfx.= pod index 54a633e..f10c6a3 100644 --- a/Documentation/dtas-splitfx.pod +++ b/Documentation/dtas-splitfx.pod @@ -41,6 +41,12 @@ Silent operation, commands are not printed as executed Disable automatic setting of the DITHERFX env. This also passes the option to L via SOX_OPTS. =20 +=3Ditem -E, --err-suffix SUFFIX + +Write the contents of C. This is useful for capturing +the per-track output of the L C effect when +combined with parallel C<--jobs>. + =3Ditem -O, --outdir OUTDIR =20 Set output directory instead of current directory. diff --git a/bin/dtas-splitfx b/bin/dtas-splitfx index d041679..3ee812e 100755 --- a/bin/dtas-splitfx +++ b/bin/dtas-splitfx @@ -23,6 +23,9 @@ end op.on('-b', '--bits RATE', Integer) { |val| opts[:bits] =3D val } op.on('-t', '--trim POSITION') { |val| opts[:trim] =3D val.tr(',', ' '= ) } + op.on('-E', '--err-suffix SUFFIX') do |val| + opts[:err_suffix] =3D val.start_with?('.') ? val.freeze : ".#{val}" + end op.on('-p', '--sox-pipe') do opts[:sox_pipe] =3D true default_target =3D 'sox' @@ -30,6 +33,10 @@ op.parse!(ARGV) end =20 +if opts[:sox_pipe] && opts[:err_suffix] + abort '--err-suffix and --sox-pipe are mutually exclusive' +end + args =3D [] ARGV.each do |arg| case arg diff --git a/lib/dtas/splitfx.rb b/lib/dtas/splitfx.rb index 384df0f..58c8ff4 100644 --- a/lib/dtas/splitfx.rb +++ b/lib/dtas/splitfx.rb @@ -250,7 +250,10 @@ def splitfx_spawn(target, t, opts) command =3D 'true' if opts[:dryrun] # still gotta fork =20 # pgroup: false so Ctrl-C on command-line will immediately stop ever= ything - [ dtas_spawn(env, command, pgroup: false), comments ] + o =3D { pgroup: false } + e =3D opts[:err_suffix] and + o[:err] =3D [ "#{env['OUTDIR']}#{env['TRACKNUMBER']}#{e}", 'a' ] + [ dtas_spawn(env, command, o), comments ] end =20 def load_tracks!(hash)