lib/import/shake_script.rb in tracksperanto-1.9.8 vs lib/import/shake_script.rb in tracksperanto-1.9.9
- old
+ new
@@ -23,12 +23,12 @@
(atom[2][0] == :retval) &&
(atom[2][1][0] == :trk)
node_name = atom[1][-1]
trackers = atom[2][1][1..-1]
trackers.map do | tracker |
- tracker.name = [node_name, tracker.name].join("_")
- sentinel[0].push(tracker)
+ tracker.name = [node_name, tracker.name].join("_")
+ sentinel[0].call(tracker)
end
end
# For Linear() curve calls. If someone selected JSpline or Hermite it's his problem.
# We put the frame number at the beginning since it works witih oru tuple zipper
@@ -237,13 +237,21 @@
curve_set << corr_curve if (corr_curve.respond_to?(:length) && corr_curve.length >= x.length)
curve_set
end
end
- def parse(script_io)
- trackers = []
+ class PushCall
+ def initialize(proc)
+ @proc = proc
+ end
+
+ def push(t)
+ @proc.call(t)
+ end
+ end
+
+ def stream_parse(script_io)
progress_proc = lambda{|msg| report_progress(msg) }
- Traxtractor.new(script_io, [trackers, progress_proc])
- trackers
+ Traxtractor.new(script_io, [method(:send_tracker), progress_proc])
end
end
\ No newline at end of file