diff options
author | Eric Wong <e@80x24.org> | 2015-05-24 08:08:29 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2015-05-24 08:08:29 +0000 |
commit | 741bb52962c874ddc5ad72bdac8a183e49c8abe9 (patch) | |
tree | 7e5d0b9ef2f3b41bc0e605106558e1b361ac9d28 /bin/dtas-splitfx | |
parent | 211912cca4fa5c9ada89326fe1ca3fe8e301b73b (diff) | |
download | dtas-741bb52962c874ddc5ad72bdac8a183e49c8abe9.tar.gz |
This allows splitfx YAML files to operate more seamlessly with external commands such as play(1) especially when combined with the -t/--trim option.
Diffstat (limited to 'bin/dtas-splitfx')
-rwxr-xr-x | bin/dtas-splitfx | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/bin/dtas-splitfx b/bin/dtas-splitfx index d363ab9..fc8cc69 100755 --- a/bin/dtas-splitfx +++ b/bin/dtas-splitfx @@ -6,8 +6,8 @@ require 'optparse' require 'dtas/splitfx' usage = "#$0 [-n|--dry-run][-j [JOBS]][-s|--silent] SPLITFX_FILE.yml [TARGET]" overrides = {} # FIXME: not tested +default_target = "flac" opts = { jobs: 1 } -jobs = 1 OptionParser.new('', 24, ' ') do |op| op.banner = usage op.on('-n', '--dry-run') { opts[:dryrun] = true } @@ -19,6 +19,10 @@ OptionParser.new('', 24, ' ') do |op| op.on('-r', '--rate RATE') { |val| opts[:rate] = val } op.on('-b', '--bits RATE', Integer) { |val| opts[:bits] = val } op.on('-t', '--trim POSITION') { |val| opts[:trim] = val.tr(',', ' ') } + op.on('-p', '--sox-pipe') do + opts[:sox_pipe] = true + default_target = 'sox' + end op.parse!(ARGV) end @@ -39,8 +43,9 @@ ARGV.each do |arg| end end +trap(:INT) { exit 130 } file = args.shift or abort usage -target = args.shift || "flac" +target = args.shift || default_target splitfx = DTAS::SplitFX.new splitfx.import(YAML.load(File.read(file)), overrides) splitfx.run(target, opts) |