beeps 0.1.27 → 0.1.29

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8c66aaeacdde149620a9f217bdbdc3dd6d47a2297b1716df42474932a78b2f78
4
- data.tar.gz: 88d394dd8b06d4f3af313c5321927dcc086099df4dbbd4265ebb9231996d0e7c
3
+ metadata.gz: 3e35966a4e3a60517e55adea4f74ae97c82ac1ae64339ab444bbd8d446df6f30
4
+ data.tar.gz: 4b60d83d564f349e05d975cc7adb4c42fc15edd6cd34adf1fe4681e847208c3d
5
5
  SHA512:
6
- metadata.gz: 66cba3dd8ebc2177d7eaaa32d23264f136146abbc54249b4cde52e62bca0dd9116af38831433337bb32f35668b43823d9353f5b9b0d75bc480d17bc7f4335bfa
7
- data.tar.gz: f864170ed2da87d94515dba2d207fa2cb6c687b45a389a96fee8a3e5fd5dd6faffb807285c097ec69b0a0181c00b49850963c90a73d495faf15df2b22b06c6a6
6
+ metadata.gz: a178f8c91f640a308ed2350e1da9fa16e70693eba1a18ee2e46bd731d2520ac7230b3e97c9cce102c1d5e4d561dd07bcc3a7816f94784cf3eb2b9fb965df8a98
7
+ data.tar.gz: 7f7d73abc3f27f017de7926a8c507b5cf1d5f93e9af7a8ae1132da708a18543aa4a4c69f622c36792ee5434796cbd1438a8778c44beac3e2c965c71bae056e23
@@ -0,0 +1,37 @@
1
+ #include "beeps/ruby/exception.h"
2
+
3
+
4
+ #include "defs.h"
5
+
6
+
7
+ static Class cBeepsError;
8
+ static Class cOpenALError;
9
+
10
+ void
11
+ Init_exception ()
12
+ {
13
+ Module mBeeps = rb_define_module("Beeps");
14
+
15
+ cBeepsError = rb_define_class_under(mBeeps, "BeepsError", rb_eRuntimeError);
16
+ cOpenALError = rb_define_class_under(mBeeps, "OpenALError", cBeepsError);
17
+ }
18
+
19
+
20
+ namespace Beeps
21
+ {
22
+
23
+
24
+ Class
25
+ beeps_error_class ()
26
+ {
27
+ return cBeepsError;
28
+ }
29
+
30
+ Class
31
+ openal_error_class ()
32
+ {
33
+ return cOpenALError;
34
+ }
35
+
36
+
37
+ }// Beeps
@@ -2,6 +2,7 @@
2
2
 
3
3
 
4
4
  void Init_beeps ();
5
+ void Init_exception ();
5
6
 
6
7
  void Init_processor ();
7
8
  void Init_sine_wave ();
@@ -24,6 +25,7 @@ extern "C" void
24
25
  Rucy::init();
25
26
 
26
27
  Init_beeps();
28
+ Init_exception();
27
29
 
28
30
  Init_processor();
29
31
  Init_sine_wave();
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.27
1
+ 0.1.29
data/beeps.gemspec CHANGED
@@ -28,8 +28,8 @@ Gem::Specification.new do |s|
28
28
  s.platform = Gem::Platform::RUBY
29
29
  s.required_ruby_version = '>= 2.6.0'
30
30
 
31
- s.add_runtime_dependency 'xot', '~> 0.1.27'
32
- s.add_runtime_dependency 'rucy', '~> 0.1.27'
31
+ s.add_runtime_dependency 'xot', '~> 0.1.29'
32
+ s.add_runtime_dependency 'rucy', '~> 0.1.29'
33
33
 
34
34
  s.files = `git ls-files`.split $/
35
35
  s.executables = s.files.grep(%r{^bin/}) {|f| File.basename f}
data/ext/beeps/defs.h CHANGED
@@ -6,6 +6,7 @@
6
6
 
7
7
  #include <rucy.h>
8
8
  #include <beeps/defs.h>
9
+ #include <beeps/ruby/defs.h>
9
10
 
10
11
 
11
12
  using namespace Rucy;
@@ -0,0 +1,37 @@
1
+ #include "beeps/ruby/exception.h"
2
+
3
+
4
+ #include "defs.h"
5
+
6
+
7
+ static Class cBeepsError;
8
+ static Class cOpenALError;
9
+
10
+ void
11
+ Init_exception ()
12
+ {
13
+ Module mBeeps = define_module("Beeps");
14
+
15
+ cBeepsError = mBeeps.define_class("BeepsError", rb_eRuntimeError);
16
+ cOpenALError = mBeeps.define_class("OpenALError", cBeepsError);
17
+ }
18
+
19
+
20
+ namespace Beeps
21
+ {
22
+
23
+
24
+ Class
25
+ beeps_error_class ()
26
+ {
27
+ return cBeepsError;
28
+ }
29
+
30
+ Class
31
+ openal_error_class ()
32
+ {
33
+ return cOpenALError;
34
+ }
35
+
36
+
37
+ }// Beeps
data/ext/beeps/native.cpp CHANGED
@@ -2,6 +2,7 @@
2
2
 
3
3
 
4
4
  void Init_beeps ();
5
+ void Init_exception ();
5
6
 
6
7
  void Init_processor ();
7
8
  void Init_sine_wave ();
@@ -24,6 +25,7 @@ extern "C" void
24
25
  Rucy::init();
25
26
 
26
27
  Init_beeps();
28
+ Init_exception();
27
29
 
28
30
  Init_processor();
29
31
  Init_sine_wave();
@@ -0,0 +1,26 @@
1
+ // -*- c++ -*-
2
+ #pragma once
3
+ #ifndef __BEEPS_RUBY_DEFS_H__
4
+ #define __BEEPS_RUBY_DEFS_H__
5
+
6
+
7
+ #include <rucy/extension.h>
8
+ #include <beeps/ruby/exception.h>
9
+
10
+
11
+ #define BEEPS_CATCH \
12
+ } \
13
+ catch (const Beeps::OpenALError& e) \
14
+ { \
15
+ RUCY_RAISE(Beeps::openal_error_class(), e.what()); \
16
+ } \
17
+ catch (const Beeps::BeepsError& e) \
18
+ { \
19
+ RUCY_RAISE(Beeps::beeps_error_class(), e.what());
20
+
21
+ #define RUCY_END \
22
+ BEEPS_CATCH \
23
+ RUCY_DEF_END
24
+
25
+
26
+ #endif//EOH
@@ -0,0 +1,25 @@
1
+ // -*- c++ -*-
2
+ #pragma once
3
+ #ifndef __BEEPS_RUBY_EXCEPTION_H__
4
+ #define __BEEPS_RUBY_EXCEPTION_H__
5
+
6
+
7
+ #include <rucy/class.h>
8
+ #include <beeps/exception.h>
9
+
10
+
11
+ namespace Beeps
12
+ {
13
+
14
+
15
+ Rucy::Class beeps_error_class ();
16
+ // class Beeps::BeepsError
17
+
18
+ Rucy::Class openal_error_class ();
19
+ // class Beeps::OpenALError
20
+
21
+
22
+ }// Beeps
23
+
24
+
25
+ #endif//EOH
@@ -4,10 +4,8 @@
4
4
  #define __BEEPS_RUBY_PROCESSOR_H__
5
5
 
6
6
 
7
- #include <rucy/rucy.h>
8
7
  #include <rucy/class.h>
9
8
  #include <rucy/extension.h>
10
- #include <rucy/exception.h>
11
9
  #include <beeps/processor.h>
12
10
 
13
11
 
@@ -4,10 +4,8 @@
4
4
  #define __BEEPS_RUBY_SOUND_H__
5
5
 
6
6
 
7
- #include <rucy/rucy.h>
8
7
  #include <rucy/class.h>
9
8
  #include <rucy/extension.h>
10
- #include <rucy/exception.h>
11
9
  #include <beeps/sound.h>
12
10
 
13
11
 
data/include/beeps/ruby.h CHANGED
@@ -5,6 +5,11 @@
5
5
 
6
6
 
7
7
  #include <beeps/ruby/beeps.h>
8
+ #include <beeps/ruby/defs.h>
9
+ #include <beeps/ruby/exception.h>
10
+
11
+ #include <beeps/ruby/processor.h>
12
+ #include <beeps/ruby/sound.h>
8
13
 
9
14
 
10
15
  #endif//EOH
data/test/test_beeps.rb CHANGED
@@ -9,9 +9,9 @@ require_relative 'helper'
9
9
  class TestBeeps < Test::Unit::TestCase
10
10
 
11
11
  def test_init!()
12
- assert_raise(Rucy::NativeError) {Beeps.fin!}
12
+ assert_raise(Beeps::BeepsError) {Beeps.fin!}
13
13
  assert Beeps.init!
14
- assert_raise(Rucy::NativeError) {Beeps.init!}
14
+ assert_raise(Beeps::BeepsError) {Beeps.init!}
15
15
  assert Beeps.fin!
16
16
  end
17
17
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: beeps
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.27
4
+ version: 0.1.29
5
5
  platform: ruby
6
6
  authors:
7
7
  - xordog
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-07-29 00:00:00.000000000 Z
11
+ date: 2022-11-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: xot
@@ -16,28 +16,28 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 0.1.27
19
+ version: 0.1.29
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 0.1.27
26
+ version: 0.1.29
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rucy
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: 0.1.27
33
+ version: 0.1.29
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: 0.1.27
40
+ version: 0.1.29
41
41
  description: Synthesize and play beep sounds.
42
42
  email: xordog@gmail.com
43
43
  executables: []
@@ -45,6 +45,7 @@ extensions:
45
45
  - Rakefile
46
46
  extra_rdoc_files:
47
47
  - ".doc/ext/beeps/beeps.cpp"
48
+ - ".doc/ext/beeps/exception.cpp"
48
49
  - ".doc/ext/beeps/file_in.cpp"
49
50
  - ".doc/ext/beeps/native.cpp"
50
51
  - ".doc/ext/beeps/processor.cpp"
@@ -54,6 +55,7 @@ extra_rdoc_files:
54
55
  - ".doc/ext/beeps/square_wave.cpp"
55
56
  files:
56
57
  - ".doc/ext/beeps/beeps.cpp"
58
+ - ".doc/ext/beeps/exception.cpp"
57
59
  - ".doc/ext/beeps/file_in.cpp"
58
60
  - ".doc/ext/beeps/native.cpp"
59
61
  - ".doc/ext/beeps/processor.cpp"
@@ -67,6 +69,7 @@ files:
67
69
  - beeps.gemspec
68
70
  - ext/beeps/beeps.cpp
69
71
  - ext/beeps/defs.h
72
+ - ext/beeps/exception.cpp
70
73
  - ext/beeps/extconf.rb
71
74
  - ext/beeps/file_in.cpp
72
75
  - ext/beeps/native.cpp
@@ -83,6 +86,8 @@ files:
83
86
  - include/beeps/processor.h
84
87
  - include/beeps/ruby.h
85
88
  - include/beeps/ruby/beeps.h
89
+ - include/beeps/ruby/defs.h
90
+ - include/beeps/ruby/exception.h
86
91
  - include/beeps/ruby/processor.h
87
92
  - include/beeps/ruby/sound.h
88
93
  - include/beeps/signals.h