Method: DTAS::Source::SplitFX#src_spawn

Defined in:
lib/dtas/source/splitfx.rb

#src_spawn(player_format, rg_state, opts) ⇒ Object



68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
# File 'lib/dtas/source/splitfx.rb', line 68

def src_spawn(player_format, rg_state, opts)
  raise "BUG: #{self.inspect}#src_spawn called twice" if @to_io
  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
  e.merge!(@rg.to_env) if @rg

  @pid = dtas_spawn(e, command_string, opts)
end