Module: UniMIDI::Platform
Overview
Deal with different dependencies between different user environments
Instance Method Summary collapse
-
#bootstrap ⇒ Object
Loads the proper MIDI library and adapter for the user’s environment.
Instance Method Details
#bootstrap ⇒ Object
Loads the proper MIDI library and adapter for the user’s environment
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/unimidi/platform.rb', line 9 def bootstrap lib = case RUBY_PLATFORM when /darwin/ then "ffi-coremidi" when /java/ then "midi-jruby" when /linux/ then "alsa-rawmidi" when /mingw/ then "midi-winmm" end require("unimidi/adapter/#{lib}") interface = case RUBY_PLATFORM when /darwin/ then Adapter::CoreMIDI when /java/ then Adapter::MIDIJRuby when /linux/ then Adapter::AlsaRawMIDI when /mingw/ then Adapter::MIDIWinMM end Loader.use(interface::Loader) end |