Class: SurfaceMaster::TouchOSC::Device
- Defined in:
- lib/surface_master/touch_osc/device.rb
Overview
Low-level interface to TouchOSC Bridge
Instance Method Summary collapse
-
#initialize(opts = nil, &mapper) ⇒ Device
constructor
A new instance of Device.
- #read ⇒ Object
- #reset! ⇒ Object
- #write(messages) ⇒ Object
Methods inherited from Device
#close, #closed?, #input_enabled?, #output_enabled?
Methods included from Logging
Constructor Details
#initialize(opts = nil, &mapper) ⇒ Device
Returns a new instance of Device.
5 6 7 8 9 |
# File 'lib/surface_master/touch_osc/device.rb', line 5 def initialize(opts = nil, &mapper) @name = "TouchOSC Bridge" super(opts) @mapper = mapper || proc { |input| input } end |
Instance Method Details
#read ⇒ Object
13 14 15 16 17 |
# File 'lib/surface_master/touch_osc/device.rb', line 13 def read super .map { |input| @mapper.call(input) } .compact end |
#reset! ⇒ Object
11 |
# File 'lib/surface_master/touch_osc/device.rb', line 11 def reset!; end |
#write(messages) ⇒ Object
19 20 21 |
# File 'lib/surface_master/touch_osc/device.rb', line 19 def write() @output.write(Array()) end |