diff options
Diffstat (limited to 'lib/dtas/source/splitfx.rb')
-rw-r--r-- | lib/dtas/source/splitfx.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/dtas/source/splitfx.rb b/lib/dtas/source/splitfx.rb index b7b9b86..02c3a9d 100644 --- a/lib/dtas/source/splitfx.rb +++ b/lib/dtas/source/splitfx.rb @@ -17,6 +17,7 @@ class DTAS::Source::SplitFX < DTAS::Source::Sox # :nodoc: def initialize(sox = DTAS::Source::Sox.new) command_init(SPLITFX_DEFAULTS) + @watch_extra = [] @sox = sox end @@ -65,6 +66,19 @@ class DTAS::Source::SplitFX < DTAS::Source::Sox # :nodoc: e = @env.merge!(player_format.to_env) @sfx.infile_env(e, @sox.infile) + # watch any scripts or files the command in the YAML file refers to + if c = @sfx.command + @sfx.expand_cmd(e, c).each do |f| + File.readable?(f) and @watch_extra << f + end + end + + # allow users to specify explicit depdendencies to watch for edit + case extra = @ymlhash['deps'] + when Array, String + @watch_extra.concat(Array(extra)) + end + # make sure these are visible to the "current" command... e["TRIMFX"] = trimfx e["RGFX"] = rg_state.effect(self) || nil |