unimidi 0.0.2-i386-mingw32

Sign up to get free protection for your applications and to get access to all the features.
data/LICENSE ADDED
@@ -0,0 +1,13 @@
1
+ Copyright 2010-2011 Ari Russo
2
+
3
+ Licensed under the Apache License, Version 2.0 (the "License");
4
+ you may not use this file except in compliance with the License.
5
+ You may obtain a copy of the License at
6
+
7
+ http://www.apache.org/licenses/LICENSE-2.0
8
+
9
+ Unless required by applicable law or agreed to in writing, software
10
+ distributed under the License is distributed on an "AS IS" BASIS,
11
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ See the License for the specific language governing permissions and
13
+ limitations under the License.
data/README.rdoc ADDED
@@ -0,0 +1,40 @@
1
+ = UniMIDI
2
+
3
+ Author:: Ari Russo
4
+ Copyright:: Copyright (c) 2011 Ari Russo
5
+
6
+ == Summary
7
+
8
+ Realtime MIDI input and output for Ruby
9
+
10
+ == Features
11
+
12
+ * Multiple platforms supported (currently Linux, Windows/Cygwin, more to follow)
13
+ * Handle both input and output
14
+ * Supports messaging to and from multiple devices concurrently
15
+
16
+ == Requirements
17
+
18
+ * Linux: {alsa-rawmidi}[http://github.com/arirusso/alsa-rawmidi]
19
+ * Windows/Cygwin: {midi-winmm}[https://github.com/arirusso/midi-winmm]
20
+
21
+ == Install
22
+
23
+ * gem install unimidi
24
+
25
+ == Examples
26
+
27
+ * {input}[http://github.com/arirusso/unimidi/blob/master/examples/input.rb]
28
+ * {output}[http://github.com/arirusso/unimidi/blob/master/examples/output.rb]
29
+
30
+ == Tests
31
+
32
+ * please see {test/config.rb}[http://github.com/arirusso/unimidi/blob/master/test/config.rb] before running tests
33
+
34
+ == Documentation
35
+
36
+ * {rdoc}[http://rdoc.info/gems/unimidi]
37
+
38
+ == License
39
+
40
+ Apache 2.0, See the file LICENSE
data/lib/unimidi.rb ADDED
@@ -0,0 +1,17 @@
1
+ #!/usr/bin/env ruby
2
+ #
3
+ # A realtime MIDI interface for Ruby
4
+ #
5
+ module UniMIDI
6
+
7
+ VERSION = "0.0.2"
8
+
9
+ end
10
+
11
+ require 'unimidi/congruous_api_adapter'
12
+ require 'unimidi/platform'
13
+
14
+ module UniMIDI
15
+ extend(Platform.instance.interface)
16
+ include(Platform.instance.interface)
17
+ end
@@ -0,0 +1,19 @@
1
+ module UniMIDI
2
+
3
+ module AlsaRawMIDIAdapter
4
+
5
+ class Input
6
+ include CongruousApiAdapter::Device
7
+ extend CongruousApiAdapter::Device::ClassMethods
8
+ DeviceClass = ::AlsaRawMIDI::Input
9
+ end
10
+
11
+ class Output
12
+ include CongruousApiAdapter::Device
13
+ extend CongruousApiAdapter::Device::ClassMethods
14
+ DeviceClass = ::AlsaRawMIDI::Output
15
+ end
16
+
17
+ end
18
+
19
+ end
@@ -0,0 +1,19 @@
1
+ module UniMIDI
2
+
3
+ module MIDIWinMMAdapter
4
+
5
+ class Input
6
+ include CongruousApiAdapter::Device
7
+ extend CongruousApiAdapter::Device::ClassMethods
8
+ DeviceClass = ::MIDIWinMM::Input
9
+ end
10
+
11
+ class Output
12
+ include CongruousApiAdapter::Device
13
+ extend CongruousApiAdapter::Device::ClassMethods
14
+ DeviceClass = ::MIDIWinMM::Output
15
+ end
16
+
17
+ end
18
+
19
+ end
@@ -0,0 +1,34 @@
1
+ module UniMIDI
2
+
3
+ module CongruousApiAdapter
4
+
5
+ module Device
6
+
7
+ def initialize(device_obj)
8
+ @device = device_obj
9
+ end
10
+
11
+ def method_missing(method, *args, &block)
12
+ @device.send(method, *args, &block)
13
+ end
14
+
15
+ def self.included(base)
16
+ base.send(:attr_reader, :device)
17
+ end
18
+
19
+ module ClassMethods
20
+ def device_class
21
+ const_get("DeviceClass")
22
+ end
23
+
24
+ def method_missing(method, *args, &block)
25
+ device_class.send(method, *args, &block)
26
+ end
27
+
28
+ end
29
+
30
+ end
31
+
32
+ end
33
+
34
+ end
@@ -0,0 +1,29 @@
1
+ require 'singleton'
2
+
3
+ module UniMIDI
4
+
5
+ class Platform
6
+
7
+ include Singleton
8
+
9
+ attr_reader :interface
10
+
11
+ def initialize
12
+ lib = case RUBY_PLATFORM
13
+ when /linux/ then 'alsa-rawmidi'
14
+ when /win/ then 'midi-winmm'
15
+ when /mingw/ then 'midi-winmm' #cygwin
16
+ end
17
+ require(lib)
18
+ require("unimidi/adapter/#{lib}")
19
+ @interface = case RUBY_PLATFORM
20
+ when /linux/ then AlsaRawMIDIAdapter
21
+ when /win/ then MIDIWinMMAdapter
22
+ when /mingw/ then MIDIWinMMAdapter #cygwin
23
+ end
24
+ end
25
+
26
+ end
27
+
28
+ end
29
+
metadata ADDED
@@ -0,0 +1,65 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: unimidi
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.2
5
+ prerelease:
6
+ platform: i386-mingw32
7
+ authors:
8
+ - Ari Russo
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2011-04-19 00:00:00.000000000 -04:00
13
+ default_executable:
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: midi-winmm
17
+ requirement: &19130940 !ruby/object:Gem::Requirement
18
+ none: false
19
+ requirements:
20
+ - - ! '>='
21
+ - !ruby/object:Gem::Version
22
+ version: '0'
23
+ type: :runtime
24
+ prerelease: false
25
+ version_requirements: *19130940
26
+ description: Platform Independent, realtime MIDI input and output for Ruby.
27
+ email:
28
+ - ari.russo@gmail.com
29
+ executables: []
30
+ extensions: []
31
+ extra_rdoc_files: []
32
+ files:
33
+ - lib/unimidi/adapter/alsa-rawmidi.rb
34
+ - lib/unimidi/adapter/midi-winmm.rb
35
+ - lib/unimidi/congruous_api_adapter.rb
36
+ - lib/unimidi/platform.rb
37
+ - lib/unimidi.rb
38
+ - LICENSE
39
+ - README.rdoc
40
+ has_rdoc: true
41
+ homepage: http://github.com/arirusso/unimidi
42
+ licenses: []
43
+ post_install_message:
44
+ rdoc_options: []
45
+ require_paths:
46
+ - lib
47
+ required_ruby_version: !ruby/object:Gem::Requirement
48
+ none: false
49
+ requirements:
50
+ - - ! '>='
51
+ - !ruby/object:Gem::Version
52
+ version: '0'
53
+ required_rubygems_version: !ruby/object:Gem::Requirement
54
+ none: false
55
+ requirements:
56
+ - - ! '>='
57
+ - !ruby/object:Gem::Version
58
+ version: 1.3.6
59
+ requirements: []
60
+ rubyforge_project: unimidi
61
+ rubygems_version: 1.5.2
62
+ signing_key:
63
+ specification_version: 3
64
+ summary: Realtime MIDI input and output for Ruby
65
+ test_files: []