Sha256: 65bb036a351646bc8c91ef45a31129ee3a6fda2781de2203ac7784b0461bcf1d

Contents?: true

Size: 1.11 KB

Versions: 21

Compression:

Stored size: 1.11 KB

Contents

# The base middleware class works just like a Tracksperanto::Export::Base, but it only wraps another exporting object and does not get registered on it's own
# as an export format. Middleware can be used to massage the tracks being exported in various interesting ways - like moving the coordinates, clipping the keyframes,
# scaling the whole export or even reversing the trackers to go backwards
class Tracksperanto::Middleware::Base
  include Tracksperanto::Casts
  include Tracksperanto::BlockInit
  include Tracksperanto::ConstName
  include Tracksperanto::SimpleExport
  
  # Used to automatically register your middleware in Tracksperanto.middlewares
  # Normally you wouldn't need to override this
  def self.inherited(by)
    Tracksperanto.middlewares.push(by)
    super
  end
  
  # Constructor accepts the exporter that will be wrapped
  def initialize(*exporter_and_args_for_block_init)
    @exporter = exporter_and_args_for_block_init.shift
    super
  end
  
  %w( start_export start_tracker_segment end_tracker_segment
    export_point end_export).each do | m |
    define_method(m){|*a| @exporter.send(m, *a)}
  end

end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
tracksperanto-2.8.6 lib/middleware/base.rb
tracksperanto-2.8.5 lib/middleware/base.rb
tracksperanto-2.8.4 lib/middleware/base.rb
tracksperanto-2.8.2 lib/middleware/base.rb
tracksperanto-2.8.1 lib/middleware/base.rb
tracksperanto-2.8.0 lib/middleware/base.rb
tracksperanto-2.7.0 lib/middleware/base.rb
tracksperanto-2.6.3 lib/middleware/base.rb
tracksperanto-2.6.2 lib/middleware/base.rb
tracksperanto-2.6.1 lib/middleware/base.rb
tracksperanto-2.6.0 lib/middleware/base.rb
tracksperanto-2.5.0 lib/middleware/base.rb
tracksperanto-2.4.1 lib/middleware/base.rb
tracksperanto-2.3.3 lib/middleware/base.rb
tracksperanto-2.3.2 lib/middleware/base.rb
tracksperanto-2.3.1 lib/middleware/base.rb
tracksperanto-2.3.0 lib/middleware/base.rb
tracksperanto-2.2.4 lib/middleware/base.rb
tracksperanto-2.2.2 lib/middleware/base.rb
tracksperanto-2.2.0 lib/middleware/base.rb