Class: DTAS::SplitFX::T
- Inherits:
-
Struct
- Object
- Struct
- DTAS::SplitFX::T
- Defined in:
- lib/dtas/splitfx.rb
Overview
a standard “track” for splitfx
Instance Attribute Summary collapse
-
#comments ⇒ Object
Returns the value of attribute comments.
-
#env ⇒ Object
Returns the value of attribute env.
-
#fade_in ⇒ Object
Returns the value of attribute fade_in.
-
#fade_out ⇒ Object
Returns the value of attribute fade_out.
-
#tbeg ⇒ Object
Returns the value of attribute tbeg.
Instance Method Summary collapse
Instance Attribute Details
#comments ⇒ Object
Returns the value of attribute comments
34 35 36 |
# File 'lib/dtas/splitfx.rb', line 34 def comments @comments end |
#env ⇒ Object
Returns the value of attribute env
34 35 36 |
# File 'lib/dtas/splitfx.rb', line 34 def env @env end |
#fade_in ⇒ Object
Returns the value of attribute fade_in
34 35 36 |
# File 'lib/dtas/splitfx.rb', line 34 def fade_in @fade_in end |
#fade_out ⇒ Object
Returns the value of attribute fade_out
34 35 36 |
# File 'lib/dtas/splitfx.rb', line 34 def fade_out @fade_out end |
#tbeg ⇒ Object
Returns the value of attribute tbeg
34 35 36 |
# File 'lib/dtas/splitfx.rb', line 34 def tbeg @tbeg end |
Instance Method Details
#commit(advance_track_samples) ⇒ Object
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 |
# File 'lib/dtas/splitfx.rb', line 35 def commit(advance_track_samples) tlen = advance_track_samples - tbeg trimfx = "trim #{tbeg}s #{tlen}s".dup if fade_in # generate fade-in effect # $1 = "t 4" => "fade t 4 0 0" tmp = fade_in.dup fade_in_len = tmp.pop or raise ArgumentError, 'fade_in needs a time value' fade_type = tmp.pop # may be nil fade = " fade #{fade_type} #{fade_in_len} 0 0" trimfx << fade 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 # raw sample counts (without 's' suffix) env["TBEG"] = tbeg.to_s env["TLEN"] = tlen.to_s env["TRIMFX"] = trimfx end |