Class: MusaLCEServer::Encoder

Inherits:
Control
  • Object
show all
Defined in:
lib/surface.rb

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

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

#rangeRange

Returns:

  • (Range)


336
337
338
# File 'lib/surface.rb', line 336

def range
  @range
end

#valueInteger

Returns:

  • (Integer)


334
335
336
# File 'lib/surface.rb', line 334

def value
  @value
end

Class Method Details

.type_nameObject



331
# File 'lib/surface.rb', line 331

def self.type_name = :encoder

Instance Method Details

#emit_all_stateObject



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