From ae9a82827cea84c23e721178baa4a3445393f75a Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Thu, 3 Feb 2022 00:48:20 +0000 Subject: splitfx: disallow combining --trim and --filter They're two different ways of accomplishing roughly the same thing, but --filter can be more flexible given the use of per-track environment variables. --- lib/dtas/splitfx.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/dtas/splitfx.rb b/lib/dtas/splitfx.rb index 696b9ce..c7eaf42 100644 --- a/lib/dtas/splitfx.rb +++ b/lib/dtas/splitfx.rb @@ -1,4 +1,4 @@ -# Copyright (C) 2013-2020 all contributors +# Copyright (C) all contributors # License: GPL-3.0+ # frozen_string_literal: true require_relative '../dtas' @@ -357,7 +357,9 @@ class DTAS::SplitFX # :nodoc: @rate = opts[:rate] @bits = opts[:bits] trim = opts[:trim] and @tracks = [ UTrim.new(trim, @env, @comments) ] - + if trim && opts[:filter] + raise ArgumentError, 'trim and filter are mutually exclusive' + end fails = [] tracks = @tracks.dup (opts[:filter] || []).each do |re| -- cgit v1.2.3-24-ge0c7