Class: OSC::Bundle

Inherits:
Packet show all
Extended by:
Forwardable
Includes:
Enumerable
Defined in:
lib/osc.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Packet

decode

Constructor Details

#initialize(timetag = nil, *args) ⇒ Bundle

Returns a new instance of Bundle.



245
246
247
248
# File 'lib/osc.rb', line 245

def initialize(timetag=nil, *args)
  @timetag = timetag
  @args = args
end

Instance Attribute Details

#timetagObject

Returns the value of attribute timetag.



250
251
252
# File 'lib/osc.rb', line 250

def timetag
  @timetag
end

Instance Method Details

#encodeObject



252
253
254
255
256
257
# File 'lib/osc.rb', line 252

def encode()
  s = OSCString.new('#bundle').encode
  s << encode_timetag(@timetag)
  s << @args.collect{|x|
	x2 = x.encode; [x2.size].pack('N') + x2}.join
end

#to_aObject



262
# File 'lib/osc.rb', line 262

def to_a() @args.collect{|x| x.to_a} end