From 37eae22446feb5a805d9cd59f6ad54362829189f Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Wed, 28 Jan 2015 07:44:05 +0000 Subject: player: support the "trim" parameter This feature is intended to allow users to "zoom-in" on a particular portion of a track to tweak parameters (either with dtas-sourceedit(1) or via playback of splitfx YAML files). This may be combined with looping the tracklist (via "tl repeat"). --- lib/dtas/source/splitfx.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'lib/dtas/source/splitfx.rb') diff --git a/lib/dtas/source/splitfx.rb b/lib/dtas/source/splitfx.rb index 680ad8b..b7b9b86 100644 --- a/lib/dtas/source/splitfx.rb +++ b/lib/dtas/source/splitfx.rb @@ -20,7 +20,7 @@ class DTAS::Source::SplitFX < DTAS::Source::Sox # :nodoc: @sox = sox end - def try(ymlfile, offset = nil) + def try(ymlfile, offset = nil, trim = nil) @splitfx = @ymlhash = nil st = File.stat(ymlfile) return false if !st.file? || st.size > MAX_YAML_SIZE @@ -41,8 +41,8 @@ class DTAS::Source::SplitFX < DTAS::Source::Sox # :nodoc: end @splitfx = sfx @infile = ymlfile - sox = @sox.try(sfx.infile, offset) or return false - rv = source_file_dup(ymlfile, offset) + sox = @sox.try(sfx.infile, offset, trim) or return false + rv = source_file_dup(ymlfile, offset, trim) rv.sox = sox rv.env = sfx.env rv.sfx = sfx @@ -66,7 +66,7 @@ class DTAS::Source::SplitFX < DTAS::Source::Sox # :nodoc: @sfx.infile_env(e, @sox.infile) # make sure these are visible to the "current" command... - e["TRIMFX"] = @offset ? "trim #@offset" : nil + e["TRIMFX"] = trimfx e["RGFX"] = rg_state.effect(self) || nil e.merge!(@rg.to_env) if @rg -- cgit v1.2.3-24-ge0c7