Class: Webmidi::SMF::SysExEvent
Instance Attribute Summary collapse
-
#data ⇒ Object
readonly
Returns the value of attribute data.
Attributes inherited from Event
Instance Method Summary collapse
-
#initialize(data:, **kwargs) ⇒ SysExEvent
constructor
A new instance of SysExEvent.
- #to_bytes ⇒ Object
Constructor Details
#initialize(data:, **kwargs) ⇒ SysExEvent
Returns a new instance of SysExEvent.
178 179 180 181 182 |
# File 'lib/webmidi/smf/event.rb', line 178 def initialize(data:, **kwargs) super(**kwargs) bytes = normalize_data(data) @data = bytes.frozen? ? bytes : bytes.dup.freeze end |
Instance Attribute Details
#data ⇒ Object (readonly)
Returns the value of attribute data.
176 177 178 |
# File 'lib/webmidi/smf/event.rb', line 176 def data @data end |
Instance Method Details
#to_bytes ⇒ Object
184 185 186 |
# File 'lib/webmidi/smf/event.rb', line 184 def to_bytes (@data.last == 0xF7) ? [0xF0, *@data] : [0xF0, *@data, 0xF7] end |