about summary refs log tree commit homepage
path: root/test/test_fadefx.rb
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2015-01-27 01:20:06 +0000
committerEric Wong <e@80x24.org>2015-02-04 02:14:44 +0000
commit74350addbafab84f016145323d6c37506d374d64 (patch)
tree9f65c89172ec187cfb56cdce3283c0b194423bd9 /test/test_fadefx.rb
parent9d63755abd4774c57f6d2d4cf4b3643b5877737c (diff)
downloaddtas-74350addbafab84f016145323d6c37506d374d64.tar.gz
We need to generate a coherent command set for wrapping
portions together, this sets us up for that.
Diffstat (limited to 'test/test_fadefx.rb')
-rw-r--r--test/test_fadefx.rb17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/test_fadefx.rb b/test/test_fadefx.rb
index 942a4b6..5c84578 100644
--- a/test/test_fadefx.rb
+++ b/test/test_fadefx.rb
@@ -2,6 +2,7 @@
 # License: GPLv3 or later (https://www.gnu.org/licenses/gpl-3.0.txt)
 require_relative 'helper'
 require 'dtas/fadefx'
+require 'dtas/format'
 
 class TestFadeFX < Testcase
   def test_fadefx
@@ -14,6 +15,22 @@ class TestFadeFX < Testcase
     assert_equal 4, ffx.out_cur.flen
     assert_equal 't', ffx.in_next.type
     assert_equal 1, ffx.in_next.flen
+
+    fmt = DTAS::Format.new
+    fmt.rate = 48000
+    tbeg = 0
+    tlen = 48000 * 9
+
+    # XXX: this isn't testing much...
+    cur = ffx.fade_cur_fx(fmt, tbeg, tlen, %w(vol +3dB))
+    assert_equal(%w(trim 0s 432000s vol +3dB
+                    fade t 3.1 0 0 fade l 0 432000s 4), cur)
+    out = ffx.fade_out_prev_fx(fmt, tbeg, tlen)
+    assert_equal(%w(trim 0s
+                    fade t 0 48000s 48000s pad 384000s@48000s), out)
+    inn = ffx.fade_in_next_fx(fmt, tbeg, tlen)
+    assert_equal(%w(trim 384000s 48000s
+                    fade t 48000s 0 0 pad 384000s@0s), inn)
   end
 
   def test_fadefx_no_cur