Class: UniMIDI::Platform
- Inherits:
-
Object
- Object
- UniMIDI::Platform
- Includes:
- Singleton
- Defined in:
- lib/unimidi/platform.rb
Instance Attribute Summary collapse
-
#interface ⇒ Object
readonly
Returns the value of attribute interface.
Instance Method Summary collapse
-
#initialize ⇒ Platform
constructor
A new instance of Platform.
Constructor Details
#initialize ⇒ Platform
Returns a new instance of Platform.
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/unimidi/platform.rb', line 14 def initialize lib = case RUBY_PLATFORM when /darwin/ then "ffi-coremidi" when /java/ then "midi-jruby" when /linux/ then "alsa-rawmidi" when /mingw/ then "midi-winmm" #when /win/ then "midi-winmm" end require("unimidi/adapter/#{lib}") @interface = case RUBY_PLATFORM when /darwin/ then CoreMIDIAdapter when /java/ then MIDIJRubyAdapter when /linux/ then AlsaRawMIDIAdapter when /mingw/ then MIDIWinMMAdapter #when /win/ then MIDIWinMMAdapter end end |
Instance Attribute Details
#interface ⇒ Object (readonly)
Returns the value of attribute interface.
12 13 14 |
# File 'lib/unimidi/platform.rb', line 12 def interface @interface end |