lib/import/equalizer3.rb in tracksperanto-2.1.1 vs lib/import/equalizer3.rb in tracksperanto-2.2.0
- old
+ new
@@ -7,14 +7,14 @@
def self.autodetects_size?
true
end
- def stream_parse(passed_io)
- io = Tracksperanto::ExtIO.new(passed_io)
+ def each
+ io = Tracksperanto::ExtIO.new(@io)
detect_format!(io)
- extract_trackers(io)
+ extract_trackers(io) {|t| yield(t) }
end
private
def detect_format!(io)
@@ -23,18 +23,18 @@
end
def extract_trackers(io)
while line = io.gets do
if line =~ /^(\w+)/ # Tracker name
- send_tracker(@last_tracker) if @last_tracker && @last_tracker.any?
+ yield(@last_tracker) if @last_tracker && @last_tracker.any?
@last_tracker = Tracksperanto::Tracker.new(:name => line.strip)
report_progress("Capturing tracker #{line.strip}")
elsif line =~ /^\t/
@last_tracker.keyframe!(make_keyframe(line))
end
end
- send_tracker(@last_tracker) if @last_tracker && @last_tracker.any?
+ yield(@last_tracker) if @last_tracker && @last_tracker.any?
end
def make_keyframe(from_line)
frame, x, y = from_line.split
report_progress("Capturing keyframe #{frame}")
\ No newline at end of file