Class: MIDIator::Driver::WinMM

Inherits:
MIDIator::Driver show all
Defined in:
lib/midiator/drivers/winmm.rb

Overview

:nodoc:

Defined Under Namespace

Modules: C

Constant Summary

Constants inherited from MIDIator::Driver

CA, CC, OFF, ON, PA, PB, PC

Instance Method Summary collapse

Methods inherited from MIDIator::Driver

#aftertouch, #channel_aftertouch, #control_change, inherited, #initialize, #note_off, #note_on, #pitch_bend, #program_change

Constructor Details

This class inherits a constructor from MIDIator::Driver

Instance Method Details

#closeObject



41
42
43
# File 'lib/midiator/drivers/winmm.rb', line 41

def close
  C.midiOutClose(@device.ptr.to_i)
end

#message(one, two = 0, three = 0) ⇒ Object



45
46
47
48
# File 'lib/midiator/drivers/winmm.rb', line 45

def message(one, two=0, three=0)
  message = one + (two << 8) + (three << 16)
  C.midiOutShortMsg(@device.ptr.to_i, message)
end

#openObject



36
37
38
39
# File 'lib/midiator/drivers/winmm.rb', line 36

def open
  @device = DL.malloc(DL.sizeof('I'))
  C.midiOutOpen(@device, -1, 0, 0, 0)
end