From 7a43e7b2f7b483c0aee9cf01b8a15778dee69d5b Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sat, 3 Jan 2015 01:09:02 +0000 Subject: splitfx: add INDIR and INBASE environment variables These are intended to act like `$(@D)' and `$(@F)' in GNU make(1) and to ease managing temporary files for some effects (e.g. noiseprof + noisered in sox) for splitfx users. --- lib/dtas/splitfx.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'lib/dtas/splitfx.rb') diff --git a/lib/dtas/splitfx.rb b/lib/dtas/splitfx.rb index 36cdf9f..e31972a 100644 --- a/lib/dtas/splitfx.rb +++ b/lib/dtas/splitfx.rb @@ -187,7 +187,7 @@ class DTAS::SplitFX # :nodoc: comments.puts("#{k}=#{v}") end env["COMMENTS"] = "--comment-file=#{comments.path}" - env["INFILE"] = @infile + infile_env(env, @infile) env["OUTFMT"] = xs(outfmt.to_sox_arg) env["SUFFIX"] = outfmt.type env.merge!(t.env) @@ -342,4 +342,9 @@ class DTAS::SplitFX # :nodoc: require_relative 'cue_index' @cuebp = @tracks.map { |t| DTAS::CueIndex.new(1, "#{t.tstart}s") } end + + def infile_env(env, infile) + env["INFILE"] = infile + env["INDIR"], env["INBASE"] = File.split(File.expand_path(infile)) + end end -- cgit v1.2.3-24-ge0c7