Class: Tracksperanto::Import::FlameStabilizer

Inherits:
Base
  • Object
show all
Defined in:
lib/import/flame_stabilizer.rb

Defined Under Namespace

Classes: StabilizerParser

Instance Attribute Summary

Attributes inherited from Base

#height, #io, #progress_block, #width

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

inherited, known_snags, #report_progress

Methods included from BlockInit

#initialize

Methods included from ZipTuples

#zip_curve_tuples

Methods included from ConstName

#const_name

Methods included from Safety

#safe_reader

Methods included from Casts

#cast_to_bool, #cast_to_float, #cast_to_int, #cast_to_string

Class Method Details

.autodetects_size?Boolean

Flame setups contain clear size indications

Returns:

  • (Boolean)

6
7
8
# File 'lib/import/flame_stabilizer.rb', line 6

def self.autodetects_size?
  true
end

.distinct_file_extObject


10
11
12
# File 'lib/import/flame_stabilizer.rb', line 10

def self.distinct_file_ext
  ".stabilizer"
end

.human_nameObject


14
15
16
# File 'lib/import/flame_stabilizer.rb', line 14

def self.human_name
  "Flame .stabilizer file"
end

Instance Method Details

#eachObject


18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/import/flame_stabilizer.rb', line 18

def each
  report_progress("Extracting setup size")
  self.width, self.height = extract_width_and_height_from_stream(@io)
  report_progress("Extracting all animation channels")
  channels, names = extract_channels_from_stream(@io)
  
  begin
    report_progress("Assembling tracker curves from channels")
    scavenge_trackers_from_channels(channels, names) {|t| yield(t) }
  ensure
    channels.clear
  end
end