Module: Patch::IO::OSC

Extended by:
OSC
Included in:
OSC
Defined in:
lib/patch/io/osc.rb,
lib/patch/io/osc/action.rb,
lib/patch/io/osc/client.rb,
lib/patch/io/osc/server.rb,
lib/patch/io/osc/message.rb

Overview

Receive OSC messages and do something with them

Defined Under Namespace

Modules: Action, Message Classes: Client, Server

Constant Summary collapse

KEY =

Key that will be used by Patch to identify the module

:osc

Instance Method Summary collapse

Instance Method Details

#new_from_config(config, options = {}) ⇒ ::Patch::IO::OSC::Server

Instantiate an OSC server and/or client using the given config

Parameters:

  • config (Hash)
  • options (Hash) (defaults to: {})

Options Hash (options):

  • :actions (Action::Container)
  • :log (Log)

Returns:



26
27
28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/patch/io/osc.rb', line 26

def new_from_config(config, options = {})
  instance_options = {
    :log => options[:log]
  }
  if config[:server].nil?
    unless config[:client].nil?
      instance_options[:id] = config[:id]
      Client.new(config[:client][:host], config[:client][:port], instance_options)
    end
  else
    instance_options[:echo] = config[:client]
    Server.new(config[:id], config[:server][:port], instance_options)
  end
end