Class: Patch::IO::OSC::Client

Inherits:
Object
  • Object
show all
Defined in:
lib/patch/io/osc/client.rb

Overview

OSC Client

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(host, port, options = {}) ⇒ Client

Returns a new instance of Client.

Parameters:

  • host (String)
  • port (Fixnum)
  • options (Hash) (defaults to: {})

Options Hash (options):

  • :id (Fixnum)
  • :log (Log)


17
18
19
20
21
# File 'lib/patch/io/osc/client.rb', line 17

def initialize(host, port, options = {})
  @id = options[:id]
  @log = options[:log]
  @client = ::OSC::Client.new(host, port)
end

Instance Attribute Details

#idObject (readonly)

Returns the value of attribute id.



10
11
12
# File 'lib/patch/io/osc/client.rb', line 10

def id
  @id
end

Instance Method Details

#puts(patch, messages) ⇒ Array<::OSC::Message>

Convert message objects to OSC and send

Parameters:

Returns:

  • (Array<::OSC::Message>)

    ]



27
28
29
30
31
# File 'lib/patch/io/osc/client.rb', line 27

def puts(patch, messages)
  osc_messages = get_osc_messages(patch, messages)
  osc_messages.each { |osc_message| @client.send(osc_message) }
  osc_messages
end