Class: MusaLCEServer::Encoder
Overview
An absolute-value rotary or fader control with an integer +value+ inside an inclusive +range+. Range defaults to +0..127+ (standard MIDI 7-bit).
Instance Attribute Summary collapse
Class Method Summary collapse
Instance Method Summary collapse
- #emit_all_state ⇒ Object
-
#initialize(**kwargs) ⇒ Encoder
constructor
A new instance of Encoder.
Constructor Details
#initialize(**kwargs) ⇒ Encoder
Returns a new instance of Encoder.
338 339 340 341 342 |
# File 'lib/surface.rb', line 338 def initialize(**kwargs) super @range = 0..127 @value = 0 end |
Instance Attribute Details
#range ⇒ Range
336 337 338 |
# File 'lib/surface.rb', line 336 def range @range end |
#value ⇒ Integer
334 335 336 |
# File 'lib/surface.rb', line 334 def value @value end |
Class Method Details
.type_name ⇒ Object
331 |
# File 'lib/surface.rb', line 331 def self.type_name = :encoder |
Instance Method Details
#emit_all_state ⇒ Object
359 360 361 362 363 |
# File 'lib/surface.rb', line 359 def emit_all_state super emit(:range, @range.min, @range.max) emit(:value, @value) end |