Sha256: 88efbfc70822a24d0796481fd1084c7759c9cb45392384b04be02e01b93c677e

Contents?: true

Size: 586 Bytes

Versions: 1

Compression:

Stored size: 586 Bytes

Contents

module SurfaceMaster
  module TouchOSC
    # Low-level interface to TouchOSC Bridge
    class Device < SurfaceMaster::Device
      def initialize(opts = nil, &mapper)
        @name = "TouchOSC Bridge"
        super(opts)
        @mapper = mapper || proc { |input| input }
      end

      def reset!
      end

      def read
        super
          .map { |input| @mapper.call(input) }
          .compact
      end

      def write(messages)
        @output.write(Array(messages))
      end

    protected

      # def sysex_prefix; @sysex_prefix ||= super + []; end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
surface_master-0.4.1 lib/surface_master/touch_osc/device.rb