unimidi 0.0.5-i686-linux → 0.0.6-i686-linux

Sign up to get free protection for your applications and to get access to all the features.
@@ -12,8 +12,13 @@ Platform independent realtime MIDI input and output for Ruby.
12
12
 
13
13
  == Requirements
14
14
 
15
+ Platform
16
+
17
+ * JRuby: {midi-jruby}[http://github.com/arirusso/midi-jruby]
15
18
  * Linux: {alsa-rawmidi}[http://github.com/arirusso/alsa-rawmidi]
16
- * Windows/Cygwin: {midi-winmm}[https://github.com/arirusso/midi-winmm]
19
+ * Windows/Cygwin: {midi-winmm}[http://github.com/arirusso/midi-winmm]
20
+
21
+ Note that if you are using JRuby you must be in 1.9 mode. This is normally accomplished by passing --1.9 to JRuby at the command line.
17
22
 
18
23
  == Install
19
24
 
@@ -34,8 +39,7 @@ Platform independent realtime MIDI input and output for Ruby.
34
39
 
35
40
  == To-do
36
41
 
37
- * JRuby implementation
38
- * OSX
42
+ * OSX (coremidirb?) implementation
39
43
 
40
44
  == Author
41
45
 
@@ -4,7 +4,7 @@
4
4
  #
5
5
  module UniMIDI
6
6
 
7
- VERSION = "0.0.5"
7
+ VERSION = "0.0.6"
8
8
 
9
9
  end
10
10
 
@@ -1,3 +1,5 @@
1
+ require 'alsa-rawmidi'
2
+
1
3
  module UniMIDI
2
4
 
3
5
  module AlsaRawMIDIAdapter
@@ -0,0 +1,26 @@
1
+ require 'midi-jruby'
2
+
3
+ module UniMIDI
4
+
5
+ module AlsaRawMIDIAdapter
6
+
7
+ class Device
8
+ extend CongruousApiAdapter::Device::ClassMethods
9
+ defer_to MIDIJRuby::Device
10
+ end
11
+
12
+ class Input
13
+ include CongruousApiAdapter::Device
14
+ include CongruousApiAdapter::Input
15
+ defer_to MIDIJRuby::Input
16
+ end
17
+
18
+ class Output
19
+ include CongruousApiAdapter::Device
20
+ include CongruousApiAdapter::Output
21
+ defer_to MIDIJRuby::Output
22
+ end
23
+
24
+ end
25
+
26
+ end
@@ -1,3 +1,5 @@
1
+ require 'midi-winmm'
2
+
1
3
  module UniMIDI
2
4
 
3
5
  module MIDIWinMMAdapter
@@ -40,7 +40,10 @@ module UniMIDI
40
40
  end
41
41
 
42
42
  def all_by_type
43
-
43
+ {
44
+ :input => device_class.all_by_type[:input].map { |d| new(d) },
45
+ :output => device_class.all_by_type[:output].map { |d| new(d) }
46
+ }
44
47
  end
45
48
 
46
49
  def defer_to(klass)
@@ -59,6 +62,7 @@ module UniMIDI
59
62
 
60
63
  def self.included(base)
61
64
  base.extend(Device::ClassMethods)
65
+ base.extend(ClassMethods)
62
66
  end
63
67
 
64
68
  def gets(*a)
@@ -68,6 +72,14 @@ module UniMIDI
68
72
  def gets_bytestr(*a)
69
73
  @device.gets_bytestr(*a)
70
74
  end
75
+
76
+ module ClassMethods
77
+
78
+ def self.all
79
+ device_class.all_by_type[:input].map { |d| new(d) }
80
+ end
81
+
82
+ end
71
83
 
72
84
  end
73
85
 
@@ -75,6 +87,7 @@ module UniMIDI
75
87
 
76
88
  def self.included(base)
77
89
  base.extend(Device::ClassMethods)
90
+ base.extend(ClassMethods)
78
91
  end
79
92
 
80
93
  def puts(*a)
@@ -84,6 +97,14 @@ module UniMIDI
84
97
  def puts_bytestr(*a)
85
98
  @device.puts_bytestr(*a)
86
99
  end
100
+
101
+ module ClassMethods
102
+
103
+ def self.all
104
+ device_class.all_by_type[:output].map { |d| new(d) }
105
+ end
106
+
107
+ end
87
108
 
88
109
  end
89
110
 
@@ -10,16 +10,17 @@ module UniMIDI
10
10
 
11
11
  def initialize
12
12
  lib = case RUBY_PLATFORM
13
+ when /java/ then 'midi-jruby'
13
14
  when /linux/ then 'alsa-rawmidi'
14
- when /win/ then 'midi-winmm'
15
15
  when /mingw/ then 'midi-winmm' #cygwin
16
+ when /win/ then 'midi-winmm'
16
17
  end
17
- require(lib)
18
18
  require("unimidi/adapter/#{lib}")
19
19
  @interface = case RUBY_PLATFORM
20
+ when /java/ then MIDIJRuby
20
21
  when /linux/ then AlsaRawMIDIAdapter
21
- when /win/ then MIDIWinMMAdapter
22
22
  when /mingw/ then MIDIWinMMAdapter #cygwin
23
+ when /win/ then MIDIWinMMAdapter
23
24
  end
24
25
  end
25
26
 
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: unimidi
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.0.5
5
+ version: 0.0.6
6
6
  platform: i686-linux
7
7
  authors:
8
8
  - Ari Russo
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2011-04-21 00:00:00 -04:00
13
+ date: 2011-04-24 00:00:00 -04:00
14
14
  default_executable:
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
@@ -37,6 +37,7 @@ files:
37
37
  - lib/unimidi.rb
38
38
  - lib/unimidi/adapter/midi-winmm.rb
39
39
  - lib/unimidi/adapter/alsa-rawmidi.rb
40
+ - lib/unimidi/adapter/midi-jruby.rb
40
41
  - lib/unimidi/congruous_api_adapter.rb
41
42
  - lib/unimidi/platform.rb
42
43
  - LICENSE