Class: Bernstein::OSCConnection

Inherits:
Object
  • Object
show all
Includes:
OSC
Defined in:
lib/bernstein/osc_connection.rb

Class Method Summary collapse

Class Method Details

.configure!(options = {}) ⇒ Object



9
10
11
12
# File 'lib/bernstein/osc_connection.rb', line 9

def self.configure!(options = {})
  @options.merge!(options || {})
  @connection = OSC::Client.new @options[:port], @options[:host]
end

.send_message(message, with_message_id = true) ⇒ Object



14
15
16
17
18
# File 'lib/bernstein/osc_connection.rb', line 14

def self.send_message(message, with_message_id = true)
  osc_message = message.osc_message
  osc_message = OSC::Bundle.new(nil, osc_message, OSC::Message.new('/message_id', message.id)) if with_message_id
  @connection.send osc_message
end