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.
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/unimidi/platform.rb', line 9 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" 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 end end |
Instance Attribute Details
#interface ⇒ Object (readonly)
Returns the value of attribute interface.
7 8 9 |
# File 'lib/unimidi/platform.rb', line 7 def interface @interface end |