hallon-openal 0.0.2 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.gitignore +2 -0
- data/CHANGELOG.md +4 -0
- data/LICENSE.txt +1 -1
- data/README.md +1 -1
- data/ext/hallon/extconf.rb +19 -3
- data/ext/hallon/openal_ext.c +8 -2
- data/lib/hallon/openal/version.rb +1 -1
- data/spec/hallon_openal_spec.rb +4 -12
- metadata +7 -7
data/.gitignore
CHANGED
data/CHANGELOG.md
CHANGED
data/LICENSE.txt
CHANGED
@@ -19,4 +19,4 @@ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
19
19
|
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
20
|
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
21
|
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
-
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
CHANGED
data/ext/hallon/extconf.rb
CHANGED
@@ -1,15 +1,31 @@
|
|
1
1
|
require 'mkmf'
|
2
2
|
|
3
|
+
# Miscellaneous
|
3
4
|
def error(message)
|
4
5
|
abort "[ERROR] #{message}"
|
5
6
|
end
|
6
7
|
|
7
8
|
$CFLAGS << ' -ggdb -O0 -Wextra'
|
8
9
|
|
10
|
+
# Check for headers
|
11
|
+
|
9
12
|
error 'Missing ruby header' unless have_header 'ruby.h'
|
10
|
-
error 'Missing OpenAL/alc.h' unless have_header 'OpenAL/alc.h'
|
11
|
-
error 'Missing OpenAL/al.h' unless have_header 'OpenAL/al.h'
|
12
13
|
|
13
|
-
|
14
|
+
if have_header('OpenAL/alc.h')
|
15
|
+
# yay, probably mac os!
|
16
|
+
elsif have_header('AL/alc.h')
|
17
|
+
# woot, probably everybody else!
|
18
|
+
else
|
19
|
+
error 'Missing openal headers'
|
20
|
+
end
|
21
|
+
|
22
|
+
# Add library
|
23
|
+
if RUBY_PLATFORM =~ /darwin/
|
24
|
+
$LDFLAGS << ' -framework OpenAL '
|
25
|
+
elsif have_library('openal', 'alSourceQueueBuffers')
|
26
|
+
$LDFLAGS << ' -lopenal '
|
27
|
+
else
|
28
|
+
error 'Missing openal library'
|
29
|
+
end
|
14
30
|
|
15
31
|
create_makefile('openal_ext')
|
data/ext/hallon/openal_ext.c
CHANGED
@@ -1,8 +1,14 @@
|
|
1
1
|
#include <ruby.h>
|
2
|
-
#include <OpenAL/alc.h>
|
3
|
-
#include <OpenAL/al.h>
|
4
2
|
#include <unistd.h>
|
5
3
|
|
4
|
+
#ifdef HAVE_AL_ALC_H
|
5
|
+
# include <AL/alc.h>
|
6
|
+
# include <AL/al.h>
|
7
|
+
#elif HAVE_OPENAL_ALC_H
|
8
|
+
# include <OpenAL/alc.h>
|
9
|
+
# include <OpenAL/al.h>
|
10
|
+
#endif
|
11
|
+
|
6
12
|
#if DEBUG_H
|
7
13
|
# define DEBUG printf
|
8
14
|
#else
|
data/spec/hallon_openal_spec.rb
CHANGED
@@ -4,17 +4,11 @@ require 'hallon/openal'
|
|
4
4
|
describe Hallon::OpenAL do
|
5
5
|
let(:klass) { described_class }
|
6
6
|
let(:format) { Hash.new }
|
7
|
-
subject { klass.new
|
7
|
+
subject { klass.new }
|
8
8
|
|
9
|
-
describe "#
|
10
|
-
it "should raise an error if not given a format" do
|
11
|
-
expect { klass.new {} }.to raise_error(ArgumentError)
|
12
|
-
end
|
13
|
-
end
|
14
|
-
|
15
|
-
describe "#start" do
|
9
|
+
describe "#play" do
|
16
10
|
it "should not raise an error" do
|
17
|
-
expect { subject.
|
11
|
+
expect { subject.play }.to_not raise_error
|
18
12
|
end
|
19
13
|
end
|
20
14
|
|
@@ -38,9 +32,7 @@ describe Hallon::OpenAL do
|
|
38
32
|
|
39
33
|
describe "#format" do
|
40
34
|
it "should be settable and gettable" do
|
41
|
-
format
|
42
|
-
|
43
|
-
subject.format.should == {}
|
35
|
+
subject.format.should be_nil
|
44
36
|
subject.format = format
|
45
37
|
subject.format.should eq format
|
46
38
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hallon-openal
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-02-
|
12
|
+
date: 2012-02-05 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: hallon
|
16
|
-
requirement: &
|
16
|
+
requirement: &70277904130900 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ~>
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: '0.13'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70277904130900
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: rspec
|
27
|
-
requirement: &
|
27
|
+
requirement: &70277904130280 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ~>
|
@@ -32,7 +32,7 @@ dependencies:
|
|
32
32
|
version: '2.7'
|
33
33
|
type: :development
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *70277904130280
|
36
36
|
description:
|
37
37
|
email:
|
38
38
|
- kim@burgestrand.se
|
@@ -76,7 +76,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
76
76
|
version: '0'
|
77
77
|
requirements: []
|
78
78
|
rubyforge_project:
|
79
|
-
rubygems_version: 1.8.
|
79
|
+
rubygems_version: 1.8.15
|
80
80
|
signing_key:
|
81
81
|
specification_version: 3
|
82
82
|
summary: ! 'OpenAL audio drivers for Hallon: http://rubygems.org/gems/hallon'
|