Class: MIDIWinMM::Map::MIDIHdr

Inherits:
FFI::Struct
  • Object
show all
Defined in:
lib/midi-winmm/map.rb

Instance Method Summary collapse

Instance Method Details

#write_data(size, string = '') ⇒ Object



87
88
89
90
91
92
93
# File 'lib/midi-winmm/map.rb', line 87

def write_data(size, string = '')
  ptr = FFI::MemoryPointer.new(:char, size)
  blank = " " * (size-string.length-1)
  ptr.put_string(0, string + blank)
  self[:lpData] = ptr
  self[:dwBufferLength] = string.length
end