Class: DTAS::SplitFX::T

Inherits:
Struct
  • Object
show all
Defined in:
lib/dtas/splitfx.rb

Overview

:nodoc:

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#commentsObject

Returns the value of attribute comments

Returns:

  • (Object)

    the current value of comments



22
23
24
# File 'lib/dtas/splitfx.rb', line 22

def comments
  @comments
end

#envObject

Returns the value of attribute env

Returns:

  • (Object)

    the current value of env



22
23
24
# File 'lib/dtas/splitfx.rb', line 22

def env
  @env
end

#fade_inObject

Returns the value of attribute fade_in

Returns:

  • (Object)

    the current value of fade_in



22
23
24
# File 'lib/dtas/splitfx.rb', line 22

def fade_in
  @fade_in
end

#fade_outObject

Returns the value of attribute fade_out

Returns:

  • (Object)

    the current value of fade_out



22
23
24
# File 'lib/dtas/splitfx.rb', line 22

def fade_out
  @fade_out
end

#tstartObject

Returns the value of attribute tstart

Returns:

  • (Object)

    the current value of tstart



22
23
24
# File 'lib/dtas/splitfx.rb', line 22

def tstart
  @tstart
end

Instance Method Details

#commit(advance_track_samples) ⇒ Object



23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# File 'lib/dtas/splitfx.rb', line 23

def commit(advance_track_samples)
  tlen = advance_track_samples - tstart
  trimfx = "trim #{tstart}s #{tlen}s"
  if fade_in
    trimfx << " #{fade_in}"
  end
  if fade_out
    tmp = fade_out.dup
    fade_out_len = tmp.pop or
                     raise ArgumentError, "fade_out needs a time value"
    fade_type = tmp.pop # may be nil
    fade = " fade #{fade_type} 0 #{tlen}s #{fade_out_len}"
    trimfx << fade
  end
  env["TRIMFX"] = trimfx
end