Module: SparkleMotion

Defined in:
lib/sparkle_motion.rb,
lib/sparkle_motion/node.rb,
lib/sparkle_motion/utility.rb,
lib/sparkle_motion/version.rb,
lib/sparkle_motion/hue/ssdp.rb,
lib/sparkle_motion/nodes/generator.rb,
lib/sparkle_motion/nodes/transform.rb,
lib/sparkle_motion/launch_pad/color.rb,
lib/sparkle_motion/launch_pad/widget.rb,
lib/sparkle_motion/lazy_request_config.rb,
lib/sparkle_motion/nodes/generators/const.rb,
lib/sparkle_motion/nodes/generators/wave2.rb,
lib/sparkle_motion/nodes/transforms/range.rb,
lib/sparkle_motion/nodes/generators/perlin.rb,
lib/sparkle_motion/launch_pad/widgets/button.rb,
lib/sparkle_motion/launch_pad/widgets/toggle.rb,
lib/sparkle_motion/nodes/transforms/contrast.rb,
lib/sparkle_motion/nodes/transforms/spotlight.rb,
lib/sparkle_motion/launch_pad/widgets/radio_group.rb,
lib/sparkle_motion/launch_pad/widgets/vertical_slider.rb,
lib/sparkle_motion/launch_pad/widgets/horizontal_slider.rb

Overview

rubocop:enable Lint/RescueException

Defined Under Namespace

Modules: Hue, LaunchPad, Nodes Classes: LazyRequestConfig, LightConfig, Node

Constant Summary collapse

VERSION =
"0.1.0"

Class Method Summary collapse

Class Method Details

.init!(name) ⇒ Object



18
19
20
21
22
# File 'lib/sparkle_motion.rb', line 18

def self.init!(name)
  @logger         = Logger::Better.new(STDOUT)
  @logger.level   = (ENV["SPARKLEMOTION_LOGLEVEL"] || "info").downcase.to_sym
  @logger.progname = name
end

.loggerObject



16
# File 'lib/sparkle_motion.rb', line 16

def self.logger; @logger; end

.use_graph!Object

Load code for graph-structured effect generation.



37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# File 'lib/sparkle_motion.rb', line 37

def self.use_graph!
  # Base classes:
  require "sparkle_motion/node"
  require "sparkle_motion/nodes/generator"
  require "sparkle_motion/nodes/transform"

  # Simulation root nodes:
  require "sparkle_motion/nodes/generators/const"
  require "sparkle_motion/nodes/generators/perlin"
  require "sparkle_motion/nodes/generators/wave2"

  # Simulation transform nodes:
  require "sparkle_motion/nodes/transforms/contrast"
  require "sparkle_motion/nodes/transforms/range"
  require "sparkle_motion/nodes/transforms/spotlight"
end

.use_hue!(discovery: false, api: false) ⇒ Object

Load code for talking to Philips Hue lighting system.



25
26
27
28
29
30
31
32
33
34
# File 'lib/sparkle_motion.rb', line 25

def self.use_hue!(discovery: false, api: false)
  if api
    require "sparkle_motion/results"
    require "sparkle_motion/lazy_request_config"
  end

  if discovery
    require "sparkle_motion/hue/ssdp"
  end
end

.use_launchpad!Object

Load code/widgets for Novation LaunchPad.



63
64
65
# File 'lib/sparkle_motion.rb', line 63

def self.use_launchpad!
  require "launchpad"
end

.use_widgets!Object



54
55
56
57
58
59
60
# File 'lib/sparkle_motion.rb', line 54

def self.use_widgets!
  require "sparkle_motion/launch_pad/widget"
  require "sparkle_motion/launch_pad/widgets/horizontal_slider"
  require "sparkle_motion/launch_pad/widgets/vertical_slider"
  require "sparkle_motion/launch_pad/widgets/radio_group"
  require "sparkle_motion/launch_pad/widgets/button"
end