From 68ffa097e187da663fa3f537b430428ea5e8de2e Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sun, 25 Aug 2013 09:25:07 +0000 Subject: split out source handling to prepare for avconv/ffmpeg support We should've done this at the start, but we didn't. --- lib/dtas/player.rb | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'lib/dtas/player.rb') diff --git a/lib/dtas/player.rb b/lib/dtas/player.rb index c6d6027..57976c2 100644 --- a/lib/dtas/player.rb +++ b/lib/dtas/player.rb @@ -5,7 +5,8 @@ require 'yaml' require 'shellwords' require_relative '../dtas' require_relative 'source' -require_relative 'source/command' +require_relative 'source/sox' +require_relative 'source/cmd' require_relative 'sink' require_relative 'unix_server' require_relative 'buffer' @@ -304,17 +305,17 @@ class DTAS::Player # :nodoc: case source_spec when String - @current = DTAS::Source.new(source_spec) + @current = DTAS::Source::Sox.new(source_spec) echo(%W(file #{@current.infile})) when Array - @current = DTAS::Source.new(*source_spec) + @current = DTAS::Source::Sox.new(*source_spec) echo(%W(file #{@current.infile} #{@current.offset_samples}s)) else - @current = DTAS::Source::Command.new(source_spec["command"]) + @current = DTAS::Source::Cmd.new(source_spec["command"]) echo(%W(command #{@current.command_string})) end - if DTAS::Source === @current + if DTAS::Source::Sox === @current @current.command = @srccmd if @srccmd @current.env = @srcenv.dup unless @srcenv.empty? end -- cgit v1.2.3-24-ge0c7