Sha256: eb3fb934c2ac6e193bf3423f5d2da239b5b00f649ba56d5ea3e49269c2157a3b

Contents?: true

Size: 1.06 KB

Versions: 14

Compression:

Stored size: 1.06 KB

Contents

require_relative "printer"

module FLV
  module Edit  
    module Processor

      # Debug is a Processor class (see Base and desc)
      class Debug < Base
        include Filter
        desc ["Prints out the details of all tags. Information that stays the same",
              "from one tag type to the next will not be repeated.",
              "A RANGE argument will limit the output to tags within that range;",
              "similarily, a given TIMESTAMP will limit the output to tags",
              "within 0.1s of this timestamp."],
            :param => {:class => TimestampOrTimestampRange, :name => "[RANGE/TS]"}

        def before_filter
          @range = self.options[:debug] || TimestampRange.new(0, INFINITY)
          @range = @range.widen(0.1) unless @range.is_a? Range
          @last = {}
          @printer = Printer.new(options[:out])
        end
        
        def filter(tag)
          return unless @range.include? tag.timestamp
          tag.debug(@printer, @last[tag.body.class])
          @last[tag.body.class] = tag
        end
      end
    end
  end
end

Version data entries

14 entries across 14 versions & 2 rubygems

Version Path
marcandre-flvedit-0.6.2 lib/flv/edit/processor/debug.rb
marcandre-flvedit-0.6.3 lib/flvedit/processor/debug.rb
marcandre-flvedit-0.6.4 lib/flvedit/processor/debug.rb
marcandre-flvedit-0.7.0 lib/flvedit/processor/debug.rb
marcandre-flvedit-0.7.1 lib/flvedit/processor/debug.rb
marcandre-flvedit-0.7.2 lib/flvedit/processor/debug.rb
marcandre-flvedit-0.7.3 lib/flvedit/processor/debug.rb
flvedit-0.7.4 lib/flvedit/processor/debug.rb
flvedit-0.7.2 lib/flvedit/processor/debug.rb
flvedit-0.7.1 lib/flvedit/processor/debug.rb
flvedit-0.6.4 lib/flvedit/processor/debug.rb
flvedit-0.7.0 lib/flvedit/processor/debug.rb
flvedit-0.6.3 lib/flvedit/processor/debug.rb
flvedit-0.6.2 lib/flv/edit/processor/debug.rb