Class: Crossfade

Inherits:
Base
  • Object
show all
Defined in:
lib/functions/crossfade.rb

Instance Attribute Summary collapse

Attributes inherited from Base

#frame_optimized, #name

Instance Method Summary collapse

Methods inherited from Base

#add_arduino_code, #add_cycle_level_scope, #add_top_level_scope, #append_tsortable, #buildit, #depends_on, #initialize, #resolve_frame_optimized, #top_level_scope_arduino_code

Constructor Details

This class inherits a constructor from Base

Instance Attribute Details

#channel1Object

Returns the value of attribute channel1.



13
14
15
# File 'lib/functions/crossfade.rb', line 13

def channel1
  @channel1
end

#channel2Object

Returns the value of attribute channel2.



14
15
16
# File 'lib/functions/crossfade.rb', line 14

def channel2
  @channel2
end

#faderObject

Returns the value of attribute fader.



12
13
14
# File 'lib/functions/crossfade.rb', line 12

def fader
  @fader
end

Instance Method Details

#arduino_codeObject



20
21
22
23
24
25
26
27
28
# File 'lib/functions/crossfade.rb', line 20

def arduino_code
  unless @frame_optimized 
    [
      "crossfade(#{@fader.name}, #{@channel1.name}, #{@channel2.name}, #{@name});"
    ]
  else
    []
  end
end

#cycle_level_arduino_codeObject



30
31
32
33
34
35
36
37
38
# File 'lib/functions/crossfade.rb', line 30

def cycle_level_arduino_code
  if @frame_optimized
    [
      "crossfade(#{@fader.name}, #{@channel1.name}, #{@channel2.name}, #{@name});"
    ]
  else
    []
  end
end

#param_keysObject



16
17
18
# File 'lib/functions/crossfade.rb', line 16

def param_keys
  [:fader, :channel1, :channel2]
end

#top_level_scope_codeObject



40
41
42
43
44
# File 'lib/functions/crossfade.rb', line 40

def top_level_scope_code
  [
    "long #{@name}[3];",
  ]
end