Class: MIDI::SongSelect

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(song = 0, delta_time = 0) ⇒ SongSelect

Returns a new instance of SongSelect.



314
315
316
317
# File 'lib/midilib/event.rb', line 314

def initialize(song = 0, delta_time = 0)
  super(SONG_SELECT, delta_time)
  @song = song
end

Instance Attribute Details

#songObject

Returns the value of attribute song.



312
313
314
# File 'lib/midilib/event.rb', line 312

def song
  @song
end

Instance Method Details

#data_as_bytesObject



319
320
321
322
323
# File 'lib/midilib/event.rb', line 319

def data_as_bytes
  data = []
  data << @status
  data << @song
end

#to_sObject



325
326
327
# File 'lib/midilib/event.rb', line 325

def to_s
  super << "song sel #{number_to_s(@song)}"
end