Module: MIDIWinMM::Map
- Extended by:
- FFI::Library
- Includes:
- WinTypeAliases
- Defined in:
- lib/midi-winmm/map.rb
Overview
Module containing C function and struct binding for the WinMM driver interface library
All references from MSDN
Defined Under Namespace
Modules: WinTypeAliases Classes: MIDIEvent, MIDIHdr, MIDIInputInfo, MIDIOutputInfo
Constant Summary
- WinmmCallbackFlag =
we plan to use a callback to collect events
0x30000- HeaderFlags =
{ 0x00000001 => :done, 0x00000002 => :prepared, 0x00000004 => :inqueue, 0x00000008 => :isstream }
- CallbackMessageTypes =
{ 0x3C1 => :input_open, 0x3C2 => :input_close, 0x3C3 => :input_data, 0x3C4 => :input_long_data, 0x3C5 => :input_error, 0x3C6 => :input_long_error, 0x3C7 => :output_open, 0x3C8 => :output_close, 0x3C9 => :output_data, 0x3CC => :output_more_data }
- Errors =
{ 1 => "Unspecified", 2 => "Bad Device ID", 3 => "Not Enabled", 4 => "Allocation", 5 => "Invalid Handle", 6 => "No Driver", 7 => "No Memory", 8 => "Not Supported", 9 => "Bad Error Number", 10 => "Invalid Flag", 11 => "Invalid Parameter", 12 => "Handle Busy", 13 => "Invalid Alias" }
- DeviceInfo =
{ :input => MIDIInputInfo, :output => MIDIOutputInfo }
Constants included from WinTypeAliases
WinTypeAliases::BYTE, WinTypeAliases::DWORD, WinTypeAliases::DWORD_PTR, WinTypeAliases::HANDLE, WinTypeAliases::HMIDIIN, WinTypeAliases::HMIDIOUT, WinTypeAliases::LPDWORD, WinTypeAliases::LPHMIDIIN, WinTypeAliases::LPHMIDIOUT, WinTypeAliases::LPHMIDISTRM, WinTypeAliases::LPMIDIHDR, WinTypeAliases::LPMIDIINCAPS, WinTypeAliases::LPMIDIOUTCAPS, WinTypeAliases::LPUINT, WinTypeAliases::MMRESULT, WinTypeAliases::MMVERSION, WinTypeAliases::TCHAR, WinTypeAliases::UINT, WinTypeAliases::UINT_PTR, WinTypeAliases::WORD
Class Method Summary (collapse)
-
+ (Object) cfunc(type, funcname, *args)
shortcut for calling winmm midi functions.
- + (Object) error(num)
- + (Boolean) error?(num)
- + (Object) winmm_func(name, *args)
Class Method Details
+ (Object) cfunc(type, funcname, *args)
shortcut for calling winmm midi functions
278 279 280 281 282 283 284 |
# File 'lib/midi-winmm/map.rb', line 278 def self.cfunc(type, funcname, *args) t = type.to_s.gsub(/put/,'') # convert output to out, input to in name = funcname.to_s name[0] = name[0,1].upcase # capitalize t[0] = t[0,1].upcase # capitalize self.send("midi#{t}#{name}", *args) end |
+ (Object) error(num)
295 296 297 |
# File 'lib/midi-winmm/map.rb', line 295 def self.error(num) Map::Errors[num] end |
+ (Boolean) error?(num)
291 292 293 |
# File 'lib/midi-winmm/map.rb', line 291 def self.error?(num) !Map::Errors[num].nil? end |
+ (Object) winmm_func(name, *args)
286 287 288 289 |
# File 'lib/midi-winmm/map.rb', line 286 def self.winmm_func(name, *args) status = self.send(name, *args) raise "#{name.to_s}: #{error(status)}" if error?(status) end |