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.



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

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.



309
310
311
# File 'lib/midilib/event.rb', line 309

def song
  @song
end

Instance Method Details

#data_as_bytesObject



316
317
318
319
320
# File 'lib/midilib/event.rb', line 316

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

#to_sObject



322
323
324
# File 'lib/midilib/event.rb', line 322

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