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.



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

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.



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

def song
  @song
end

Instance Method Details

#data_as_bytesObject



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

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

#to_sObject



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

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