Class: Shmidi::LedButton

Inherits:
Control show all
Defined in:
lib/shmidi/led_button.rb

Direct Known Subclasses

Switch

Constant Summary collapse

CTYPE =
:LEDBUT

Instance Attribute Summary collapse

Attributes inherited from Control

#channel, #note

Attributes included from Base

#_attachments, #_deleted, #_id, #_rev, #version

Instance Method Summary collapse

Methods inherited from Control

#id, #socket

Methods included from Base

#[], #[]=, #clone, #dump, #etag, included, #init, #inspect, #reset, #to_hash, #to_s

Constructor Details

#initialize(id, socket, channel, note, led_note = nil) ⇒ LedButton



7
8
9
10
11
12
13
# File 'lib/shmidi/led_button.rb', line 7

def initialize(id, socket, channel, note, led_note = nil)
  super(id, socket, channel, note)
  @button = Button.new(id, socket, channel, note)
  @led = Led.new(id, socket, channel, led_note || note)
  @button.on_press(&lambda { |button| on_button_press(button) })
  @button.on_release(&lambda { |button| on_button_release(button) })
end

Instance Attribute Details

#buttonObject (readonly)

Returns the value of attribute button.



5
6
7
# File 'lib/shmidi/led_button.rb', line 5

def button
  @button
end

#ledObject (readonly)

Returns the value of attribute led.



5
6
7
# File 'lib/shmidi/led_button.rb', line 5

def led
  @led
end