commit 9bf21db1e0ad815187b8c93ef985ef591a606645 (patch)
parent 65bb4ba doc: describe most classes a bit
tree f6e9148fbd57340545cfc61ad24f717a6e327f4f
author Eric Wong <e@80x24.org> 2015-01-20 02:19:08 +0000
committer Eric Wong <e@80x24.org> 2015-01-20 02:19:08 +0000
rename the TrimFX class to TFX
TrimFX was too ambiguous with the common environment variable we
use throughout dtas. Since TFX is more limited in scope but
should be more frequently-typed by users (of -splitfx) we'll use
the shorter name here.
---
examples/{trimfx.sample.yml => tfx.sample.yml} | 0
lib/dtas/{trimfx.rb => tfx.rb} | 6 ++---
test/{test_trimfx.rb => test_tfx.rb} | 36 +++++++++++++-------------
3 files changed, 21 insertions(+), 21 deletions(-)
diff --git a/examples/trimfx.sample.yml b/examples/tfx.sample.yml
similarity index 100%
rename from examples/trimfx.sample.yml
rename to examples/tfx.sample.yml
diff --git a/lib/dtas/trimfx.rb b/lib/dtas/tfx.rb
similarity index 97%
rename from lib/dtas/trimfx.rb
rename to lib/dtas/tfx.rb
index 33b21ca..479ff5c 100644
--- a/lib/dtas/trimfx.rb
+++ b/lib/dtas/tfx.rb
@@ -7,7 +7,7 @@
# this will represent a trim section inside -splitfx for applying
# effects to only a part of the output
-class DTAS::TrimFX
+class DTAS::TFX
include DTAS::ParseTime
attr_reader :tbeg
@@ -92,7 +92,7 @@ def <=>(other)
end
end
- # sorts and converts an array of TrimFX objects into non-overlapping arrays
+ # sorts and converts an array of TFX objects into non-overlapping arrays
# of epochs
#
# input:
@@ -139,7 +139,7 @@ def self.schedule(ary)
rv
end
- # like schedule, but fills in the gaps with pass-through (no-op) TrimFX objs
+ # like schedule, but fills in the gaps with pass-through (no-op) TFX objs
# This does not change the number of epochs.
def self.expand(ary, total_samples)
rv = []
diff --git a/test/test_trimfx.rb b/test/test_tfx.rb
similarity index 67%
rename from test/test_trimfx.rb
rename to test/test_tfx.rb
index 17cb737..59aa697 100644
--- a/test/test_trimfx.rb
+++ b/test/test_tfx.rb
@@ -1,23 +1,23 @@
# Copyright (C) 2013-2015 all contributors <dtas-all@nongnu.org>
# License: GPLv3 or later (https://www.gnu.org/licenses/gpl-3.0.txt)
require './test/helper'
-require 'dtas/trimfx'
+require 'dtas/tfx'
require 'dtas/format'
require 'yaml'
-class TestTrimFX < Testcase
+class TestTFX < Testcase
def rate
44100
end
def test_example
- ex = YAML.load(File.read("examples/trimfx.sample.yml"))
+ ex = YAML.load(File.read("examples/tfx.sample.yml"))
effects = []
ex["effects"].each do |line|
words = Shellwords.split(line)
case words[0]
when "trim"
- tfx = DTAS::TrimFX.new(words)
+ tfx = DTAS::TFX.new(words)
assert_equal 52 * rate, tfx.tbeg
assert_equal rate, tfx.tlen
effects << tfx
@@ -27,38 +27,38 @@ def test_example
end
def test_all
- tfx = DTAS::TrimFX.new(%w(all))
+ tfx = DTAS::TFX.new(%w(all))
assert_equal 0, tfx.tbeg
assert_nil tfx.tlen
assert_equal [], tfx.to_sox_arg
end
def test_time
- tfx = DTAS::TrimFX.new(%w(trim 2:30 3.1))
+ tfx = DTAS::TFX.new(%w(trim 2:30 3.1))
assert_equal 150 * rate, tfx.tbeg
assert_equal((3.1 * rate).round, tfx.tlen)
end
def test_to_sox_arg
- tfx = DTAS::TrimFX.new(%w(trim 1 0.5))
+ tfx = DTAS::TFX.new(%w(trim 1 0.5))
assert_equal %w(trim 44100s 22050s), tfx.to_sox_arg
- tfx = DTAS::TrimFX.new(%w(trim 1 sox vol -1dB))
+ tfx = DTAS::TFX.new(%w(trim 1 sox vol -1dB))
assert_equal %w(trim 44100s), tfx.to_sox_arg
end
def test_tfx_effects
- tfx = DTAS::TrimFX.new(%w(trim 1 sox vol -1dB))
+ tfx = DTAS::TFX.new(%w(trim 1 sox vol -1dB))
assert_equal %w(sox $SOXIN $SOXOUT $TRIMFX vol -1dB), tfx.cmd
end
def test_schedule_simple
fx = [
- DTAS::TrimFX.new(%w(trim 1 0.3)),
- DTAS::TrimFX.new(%w(trim 2 0.2)),
- DTAS::TrimFX.new(%w(trim 0.5 0.5)),
+ DTAS::TFX.new(%w(trim 1 0.3)),
+ DTAS::TFX.new(%w(trim 2 0.2)),
+ DTAS::TFX.new(%w(trim 0.5 0.5)),
].shuffle
- ary = DTAS::TrimFX.schedule(fx)
+ ary = DTAS::TFX.schedule(fx)
assert_operator 1, :==, ary.size
assert_equal [ 22050, 44100, 88200 ], ary[0].map(&:tbeg)
assert_equal [ 22050, 13230, 8820 ], ary[0].map(&:tlen)
@@ -66,16 +66,16 @@ def test_schedule_simple
def test_schedule_overlaps
fx = [
- DTAS::TrimFX.new(%w(trim 1 0.3 sox)),
- DTAS::TrimFX.new(%w(trim 1.1 0.2 sox)),
- DTAS::TrimFX.new(%w(trim 0.5 0.5 sox)),
+ DTAS::TFX.new(%w(trim 1 0.3 sox)),
+ DTAS::TFX.new(%w(trim 1.1 0.2 sox)),
+ DTAS::TFX.new(%w(trim 0.5 0.5 sox)),
]
- ary = DTAS::TrimFX.schedule(fx)
+ ary = DTAS::TFX.schedule(fx)
assert_equal 2, ary.size
assert_equal [ 22050, 44100 ], ary[0].map(&:tbeg)
assert_equal [ 48510 ], ary[1].map(&:tbeg)
- ex = DTAS::TrimFX.expand(fx, 10 * rate)
+ ex = DTAS::TFX.expand(fx, 10 * rate)
assert_equal 2, ex.size
assert_equal 0, ex[0][0].tbeg
assert_equal 3, ex[0].size
glossary
--------
Commit objects reference one tree, and zero or more parents.
Single parent commits can typically generate a patch in
unified diff format via `git format-patch'.
Multiple parents means the commit is a merge.
Root commits have no ancestor. Note that it is
possible to have multiple root commits when merging independent histories.
Every commit references one top-level tree object.
git clone git://80x24.org/dtas.git
git clone https://80x24.org/dtas.git