Module: Patch::IO::OSC::Message

Extended by:
Message
Included in:
Message
Defined in:
lib/patch/io/osc/message.rb

Overview

Convert between OSC message and Patch::Message objects

Instance Method Summary collapse

Instance Method Details

#to_osc_messages(patch, patch_message) ⇒ Array<::OSC::Message>

Convert a message object to an OSC message given the context of the given patch

Parameters:

Returns:

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


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

def to_osc_messages(patch, patch_message)
  messages = []
  unless (action = get_osc_action(patch.actions, patch_message)).nil?
    messages << get_osc_message(action, patch_message)
  end
  messages
end

#to_patch_messages(patch, raw_osc) ⇒ Array<::Patch::Message>

Convert the given OSC message to Patch::Message objects using the context of the given patch

Parameters:

Returns:



28
29
30
31
32
33
34
# File 'lib/patch/io/osc/message.rb', line 28

def to_patch_messages(patch, raw_osc)
  messages = []
  unless (action = Action.find_by_address(patch.actions, raw_osc.address)).nil?
    messages << get_patch_message(patch, action, raw_osc)
  end
  messages
end