Class: MIDI::SongPointer

Inherits:
SystemCommon show all
Defined in:
lib/midilib/event.rb

Instance Attribute Summary collapse

Attributes inherited from Event

#delta_time, #print_channel_numbers_from_one, #print_decimal_numbers, #print_note_names, #status, #time_from_start

Instance Method Summary collapse

Methods inherited from Event

#<=>, #channel_to_s, #number_to_s, #quantize_to

Constructor Details

#initialize(pointer = 0, delta_time = 0) ⇒ SongPointer

Returns a new instance of SongPointer.


291
292
293
294
# File 'lib/midilib/event.rb', line 291

def initialize(pointer = 0, delta_time = 0)
  super(SONG_POINTER, delta_time)
  @pointer = pointer
end

Instance Attribute Details

#pointerObject

Returns the value of attribute pointer


289
290
291
# File 'lib/midilib/event.rb', line 289

def pointer
  @pointer
end

Instance Method Details

#data_as_bytesObject


296
297
298
299
300
301
# File 'lib/midilib/event.rb', line 296

def data_as_bytes
  data = []
  data << @status
  data << ((@pointer >> 8) & 0xff)
  data << (@pointer & 0xff)
end

#to_sObject


303
304
305
# File 'lib/midilib/event.rb', line 303

def to_s
  return super << "song ptr #{number_to_s(@pointer)}"
end