beeps 0.1.12 → 0.1.18

Sign up to get free protection for your applications and to get access to all the features.
Files changed (59) hide show
  1. checksums.yaml +5 -5
  2. data/.doc/ext/beeps/beeps.cpp +2 -5
  3. data/.doc/ext/beeps/file_in.cpp +0 -5
  4. data/.doc/ext/beeps/native.cpp +0 -4
  5. data/.doc/ext/beeps/processor.cpp +1 -5
  6. data/.doc/ext/beeps/sawtooth_wave.cpp +0 -5
  7. data/.doc/ext/beeps/sine_wave.cpp +0 -5
  8. data/.doc/ext/beeps/sound.cpp +0 -5
  9. data/.doc/ext/beeps/square_wave.cpp +0 -5
  10. data/README.md +1 -1
  11. data/Rakefile +15 -12
  12. data/VERSION +1 -1
  13. data/beeps.gemspec +5 -7
  14. data/ext/beeps/beeps.cpp +2 -5
  15. data/ext/beeps/defs.h +3 -2
  16. data/ext/beeps/extconf.rb +2 -3
  17. data/ext/beeps/file_in.cpp +0 -5
  18. data/ext/beeps/native.cpp +0 -4
  19. data/ext/beeps/processor.cpp +1 -5
  20. data/ext/beeps/sawtooth_wave.cpp +0 -5
  21. data/ext/beeps/sine_wave.cpp +0 -5
  22. data/ext/beeps/sound.cpp +0 -5
  23. data/ext/beeps/square_wave.cpp +0 -5
  24. data/include/beeps.h +5 -0
  25. data/include/beeps/debug.h +23 -0
  26. data/include/beeps/exception.h +6 -2
  27. data/include/beeps/processor.h +9 -6
  28. data/include/beeps/ruby/beeps.h +1 -0
  29. data/include/beeps/signals.h +2 -9
  30. data/include/beeps/sound.h +2 -1
  31. data/lib/beeps/module.rb +4 -19
  32. data/lib/beeps/processor.rb +16 -20
  33. data/src/beeps.cpp +3 -64
  34. data/src/exception.cpp +0 -3
  35. data/src/openal.cpp +63 -174
  36. data/src/openal.h +15 -4
  37. data/src/processor.cpp +5 -5
  38. data/src/signals.cpp +21 -19
  39. data/src/signals.h +23 -0
  40. data/src/sound.cpp +173 -14
  41. data/src/sound.h +17 -0
  42. metadata +30 -73
  43. data/include/beeps/openal.h +0 -34
  44. data/src/stk/include/Blit.h +0 -151
  45. data/src/stk/include/BlitSaw.h +0 -148
  46. data/src/stk/include/BlitSquare.h +0 -170
  47. data/src/stk/include/FileRead.h +0 -141
  48. data/src/stk/include/FileWvIn.h +0 -195
  49. data/src/stk/include/Generator.h +0 -50
  50. data/src/stk/include/SineWave.h +0 -159
  51. data/src/stk/include/Stk.h +0 -589
  52. data/src/stk/include/WvIn.h +0 -46
  53. data/src/stk/src/Blit.cpp +0 -78
  54. data/src/stk/src/BlitSaw.cpp +0 -91
  55. data/src/stk/src/BlitSquare.cpp +0 -95
  56. data/src/stk/src/FileRead.cpp +0 -903
  57. data/src/stk/src/FileWvIn.cpp +0 -260
  58. data/src/stk/src/SineWave.cpp +0 -78
  59. data/src/stk/src/Stk.cpp +0 -395
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: eae5a0a025e1e476f42b1fd5274272eb17b09b67
4
- data.tar.gz: ca4ab6a05145864a2bfa436096191d7dc38dcfc0
2
+ SHA256:
3
+ metadata.gz: 19017f433b990f47171fe86ed1d77a0ce3658d046413abb6c0350490fb0cfa74
4
+ data.tar.gz: bff50a4f1d264d8767f214de1bb9729397fd883952d4d1f9e68bbdff79045a83
5
5
  SHA512:
6
- metadata.gz: 70b8dbf83d279c5caad425ef9f0cb2a0f3e597af65d6449ad57b35e652d113159a863ccf3f5befec97eceb65ede7f8e33b55a1029e8b134497b1455503df1663
7
- data.tar.gz: 3737d9bfd0fe48c4a790fb023c7e440c3f5b587449736e1d7d8f21b1e05386cb4d03dccf4b5117a5a39786becc36675d9189bb67d36288b822933b78872a6357
6
+ metadata.gz: '0861dd5678e75866a90ff6a0a96710edc06ad32ba0fd018ec462ae91bf7ddb27fd85bbe21d3baecaeebfd26ba0a3eb1e5187efb08de99ed7b57be36a1d19a2f2'
7
+ data.tar.gz: ce9a07582efcf27e04267dc7fa5cc418a44c10dfb830126488bfb93965583cd05886b60de910150126032634e9e02a1cac76ba1b530557937b8abca6b9a98144
@@ -1,10 +1,7 @@
1
- #include <rucy.h>
2
- #include <ruby/intern.h>
3
- #include "beeps/beeps.h"
4
- #include "defs.h"
1
+ #include "beeps/ruby/beeps.h"
5
2
 
6
3
 
7
- using namespace Rucy;
4
+ #include "defs.h"
8
5
 
9
6
 
10
7
  static
@@ -1,14 +1,9 @@
1
1
  #include "beeps/ruby/processor.h"
2
2
 
3
3
 
4
- #include <rucy.h>
5
- #include "beeps/exception.h"
6
4
  #include "defs.h"
7
5
 
8
6
 
9
- using namespace Rucy;
10
-
11
-
12
7
  RUCY_DEFINE_VALUE_FROM_TO(Beeps::FileIn)
13
8
 
14
9
  #define THIS to<Beeps::FileIn*>(self)
@@ -1,10 +1,6 @@
1
- #include <rucy.h>
2
1
  #include "defs.h"
3
2
 
4
3
 
5
- using namespace Rucy;
6
-
7
-
8
4
  void Init_beeps ();
9
5
 
10
6
  void Init_processor ();
@@ -1,14 +1,10 @@
1
1
  #include "beeps/ruby/processor.h"
2
2
 
3
3
 
4
- #include <rucy.h>
5
4
  #include "beeps/exception.h"
6
5
  #include "defs.h"
7
6
 
8
7
 
9
- using namespace Rucy;
10
-
11
-
12
8
  RUCY_DEFINE_VALUE_FROM_TO(Beeps::Processor)
13
9
 
14
10
  #define THIS to<Beeps::Processor*>(self)
@@ -19,7 +15,7 @@ RUCY_DEFINE_VALUE_FROM_TO(Beeps::Processor)
19
15
  static
20
16
  VALUE alloc(VALUE klass)
21
17
  {
22
- beeps_error(__FILE__, __LINE__);
18
+ Beeps::beeps_error(__FILE__, __LINE__);
23
19
  }
24
20
 
25
21
 
@@ -1,14 +1,9 @@
1
1
  #include "beeps/ruby/processor.h"
2
2
 
3
3
 
4
- #include <rucy.h>
5
- #include "beeps/exception.h"
6
4
  #include "defs.h"
7
5
 
8
6
 
9
- using namespace Rucy;
10
-
11
-
12
7
  RUCY_DEFINE_VALUE_FROM_TO(Beeps::SawtoothWave)
13
8
 
14
9
  #define THIS to<Beeps::SawtoothWave*>(self)
@@ -1,14 +1,9 @@
1
1
  #include "beeps/ruby/processor.h"
2
2
 
3
3
 
4
- #include <rucy.h>
5
- #include "beeps/exception.h"
6
4
  #include "defs.h"
7
5
 
8
6
 
9
- using namespace Rucy;
10
-
11
-
12
7
  RUCY_DEFINE_VALUE_FROM_TO(Beeps::SineWave)
13
8
 
14
9
  #define THIS to<Beeps::SineWave*>(self)
@@ -1,14 +1,9 @@
1
1
  #include "beeps/ruby/sound.h"
2
2
 
3
3
 
4
- #include <rucy.h>
5
- #include "beeps/exception.h"
6
4
  #include "defs.h"
7
5
 
8
6
 
9
- using namespace Rucy;
10
-
11
-
12
7
  RUCY_DEFINE_VALUE_FROM_TO(Beeps::Sound)
13
8
 
14
9
  #define THIS to<Beeps::Sound*>(self)
@@ -1,14 +1,9 @@
1
1
  #include "beeps/ruby/processor.h"
2
2
 
3
3
 
4
- #include <rucy.h>
5
- #include "beeps/exception.h"
6
4
  #include "defs.h"
7
5
 
8
6
 
9
- using namespace Rucy;
10
-
11
-
12
7
  RUCY_DEFINE_VALUE_FROM_TO(Beeps::SquareWave)
13
8
 
14
9
  #define THIS to<Beeps::SquareWave*>(self)
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
1
 
2
2
  # Beeps - Plays beep sound.
3
3
 
4
- by snori@xord.org
4
+ by xordog@gmail.com
data/Rakefile CHANGED
@@ -2,26 +2,29 @@
2
2
 
3
3
 
4
4
  %w[../xot ../rucy .]
5
- .map {|s| File.expand_path "../#{s}/lib", __FILE__}
5
+ .map {|s| File.expand_path "#{s}/lib", __dir__}
6
6
  .each {|s| $:.unshift s if !$:.include?(s) && File.directory?(s)}
7
7
 
8
- require 'xot/rake'
8
+ require 'rucy/rake'
9
+
9
10
  require 'xot/module'
10
11
  require 'rucy/module'
11
12
  require 'beeps/module'
12
13
 
13
- include Xot::Rake
14
-
15
14
 
16
- MODULES = [Xot, Rucy, Beeps].map {|m| m.const_get :Module}
17
- MODULE = MODULES.last
18
- INCDIRS = ['src/stk/include']
15
+ MODULES = [Xot, Rucy, Beeps]
19
16
  TESTS_ALONE = ['test/test_beeps.rb']
20
17
 
18
+ use_external_library 'https://github.com/thestk/stk',
19
+ tag: 'v4.6.0',
20
+ incdir: 'include',
21
+ srcdir: 'src',
22
+ excludes: %w[stk/src/include Tcp Udp Socket Thread Mutex InetWv /Rt]
21
23
 
22
- task :default => :build
23
-
24
- task :build => :ext
25
-
24
+ build_native_library
25
+ build_ruby_extension
26
+ test_ruby_extension
27
+ generate_documents
28
+ build_ruby_gem
26
29
 
27
- MODULES.each {|m| m.load_tasks :lib, :ext, :test, :doc, :gem}
30
+ task :default => :test
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.12
1
+ 0.1.18
@@ -21,17 +21,15 @@ Gem::Specification.new do |s|
21
21
  s.description = 'Synthesize and play beep sounds.'
22
22
  s.version = mod.version
23
23
 
24
- s.authors = %w[snori]
25
- s.email = 'snori@xord.org'
24
+ s.authors = %w[xordog]
25
+ s.email = 'xordog@gmail.com'
26
26
  s.homepage = "https://github.com/xord/beeps"
27
27
 
28
28
  s.platform = Gem::Platform::RUBY
29
- s.required_ruby_version = '>=1.9.0'
29
+ s.required_ruby_version = '~> 2'
30
30
 
31
- s.add_runtime_dependency 'rake'
32
- s.add_runtime_dependency 'xot'
33
- s.add_runtime_dependency 'rucy'
34
- s.add_development_dependency 'gemcutter'
31
+ s.add_runtime_dependency 'xot', '~> 0.1.16'
32
+ s.add_runtime_dependency 'rucy', '~> 0.1.18'
35
33
 
36
34
  s.files = `git ls-files`.split $/
37
35
  s.executables = s.files.grep(%r{^bin/}) {|f| File.basename f}
@@ -1,10 +1,7 @@
1
- #include <rucy.h>
2
- #include <ruby/intern.h>
3
- #include "beeps/beeps.h"
4
- #include "defs.h"
1
+ #include "beeps/ruby/beeps.h"
5
2
 
6
3
 
7
- using namespace Rucy;
4
+ #include "defs.h"
8
5
 
9
6
 
10
7
  static
@@ -4,10 +4,11 @@
4
4
  #define __BEEPS_EXT_DEFS_H__
5
5
 
6
6
 
7
- #include <beeps/exception.h>
7
+ #include <rucy.h>
8
+ #include <beeps/defs.h>
8
9
 
9
10
 
10
- using Beeps::beeps_error;
11
+ using namespace Rucy;
11
12
 
12
13
 
13
14
  #endif//EOH
@@ -2,7 +2,7 @@
2
2
 
3
3
 
4
4
  %w[../xot ../rucy .]
5
- .map {|s| File.expand_path "../../../#{s}/lib", __FILE__}
5
+ .map {|s| File.expand_path "../../#{s}/lib", __dir__}
6
6
  .each {|s| $:.unshift s if !$:.include?(s) && File.directory?(s)}
7
7
 
8
8
  require 'mkmf'
@@ -14,12 +14,11 @@ require 'beeps/module'
14
14
 
15
15
  Xot::ExtConf.new Xot, Rucy, Beeps do
16
16
  setup do
17
- headers << 'OpenAL/al.h' << 'OpenAL/alc.h'
17
+ headers << 'ruby.h' << 'OpenAL/al.h' << 'OpenAL/alc.h'
18
18
  local_libs << 'rucy'
19
19
  frameworks << 'OpenAL' if osx?
20
20
  $LDFLAGS << ' -Wl,--out-implib=native.dll.a' if cygwin?
21
21
  end
22
22
 
23
- dir_config 'boost'
24
23
  create_makefile 'beeps/native'
25
24
  end
@@ -1,14 +1,9 @@
1
1
  #include "beeps/ruby/processor.h"
2
2
 
3
3
 
4
- #include <rucy.h>
5
- #include "beeps/exception.h"
6
4
  #include "defs.h"
7
5
 
8
6
 
9
- using namespace Rucy;
10
-
11
-
12
7
  RUCY_DEFINE_VALUE_FROM_TO(Beeps::FileIn)
13
8
 
14
9
  #define THIS to<Beeps::FileIn*>(self)
@@ -1,10 +1,6 @@
1
- #include <rucy.h>
2
1
  #include "defs.h"
3
2
 
4
3
 
5
- using namespace Rucy;
6
-
7
-
8
4
  void Init_beeps ();
9
5
 
10
6
  void Init_processor ();
@@ -1,14 +1,10 @@
1
1
  #include "beeps/ruby/processor.h"
2
2
 
3
3
 
4
- #include <rucy.h>
5
4
  #include "beeps/exception.h"
6
5
  #include "defs.h"
7
6
 
8
7
 
9
- using namespace Rucy;
10
-
11
-
12
8
  RUCY_DEFINE_VALUE_FROM_TO(Beeps::Processor)
13
9
 
14
10
  #define THIS to<Beeps::Processor*>(self)
@@ -19,7 +15,7 @@ RUCY_DEFINE_VALUE_FROM_TO(Beeps::Processor)
19
15
  static
20
16
  RUCY_DEF_ALLOC(alloc, klass)
21
17
  {
22
- beeps_error(__FILE__, __LINE__);
18
+ Beeps::beeps_error(__FILE__, __LINE__);
23
19
  }
24
20
  RUCY_END
25
21
 
@@ -1,14 +1,9 @@
1
1
  #include "beeps/ruby/processor.h"
2
2
 
3
3
 
4
- #include <rucy.h>
5
- #include "beeps/exception.h"
6
4
  #include "defs.h"
7
5
 
8
6
 
9
- using namespace Rucy;
10
-
11
-
12
7
  RUCY_DEFINE_VALUE_FROM_TO(Beeps::SawtoothWave)
13
8
 
14
9
  #define THIS to<Beeps::SawtoothWave*>(self)
@@ -1,14 +1,9 @@
1
1
  #include "beeps/ruby/processor.h"
2
2
 
3
3
 
4
- #include <rucy.h>
5
- #include "beeps/exception.h"
6
4
  #include "defs.h"
7
5
 
8
6
 
9
- using namespace Rucy;
10
-
11
-
12
7
  RUCY_DEFINE_VALUE_FROM_TO(Beeps::SineWave)
13
8
 
14
9
  #define THIS to<Beeps::SineWave*>(self)
@@ -1,14 +1,9 @@
1
1
  #include "beeps/ruby/sound.h"
2
2
 
3
3
 
4
- #include <rucy.h>
5
- #include "beeps/exception.h"
6
4
  #include "defs.h"
7
5
 
8
6
 
9
- using namespace Rucy;
10
-
11
-
12
7
  RUCY_DEFINE_VALUE_FROM_TO(Beeps::Sound)
13
8
 
14
9
  #define THIS to<Beeps::Sound*>(self)
@@ -1,14 +1,9 @@
1
1
  #include "beeps/ruby/processor.h"
2
2
 
3
3
 
4
- #include <rucy.h>
5
- #include "beeps/exception.h"
6
4
  #include "defs.h"
7
5
 
8
6
 
9
- using namespace Rucy;
10
-
11
-
12
7
  RUCY_DEFINE_VALUE_FROM_TO(Beeps::SquareWave)
13
8
 
14
9
  #define THIS to<Beeps::SquareWave*>(self)
@@ -7,6 +7,11 @@
7
7
  #include <beeps/defs.h>
8
8
  #include <beeps/beeps.h>
9
9
  #include <beeps/exception.h>
10
+ #include <beeps/debug.h>
11
+
12
+ #include <beeps/signals.h>
13
+ #include <beeps/processor.h>
14
+ #include <beeps/sound.h>
10
15
 
11
16
 
12
17
  #endif//EOH
@@ -0,0 +1,23 @@
1
+ // -*- c++ -*-
2
+ #pragma once
3
+ #ifndef __BEEPS_DEBUG_H__
4
+ #define __BEEPS_DEBUG_H__
5
+
6
+
7
+ #include <xot/debug.h>
8
+ #include <beeps/defs.h>
9
+
10
+
11
+ namespace Beeps
12
+ {
13
+
14
+
15
+ using Xot::dout;
16
+
17
+ using Xot::doutln;
18
+
19
+
20
+ }// Beeps
21
+
22
+
23
+ #endif//EOH
@@ -31,9 +31,13 @@ namespace Beeps
31
31
 
32
32
  using namespace Xot::ErrorFunctions;
33
33
 
34
- void beeps_error (const char* file, int line, const char* format = NULL, ...);
34
+ [[noreturn]]
35
+ void beeps_error (
36
+ const char* file, int line, const char* format = NULL, ...);
35
37
 
36
- void openal_error (const char* file, int line, const char* format = NULL, ...);
38
+ [[noreturn]]
39
+ void openal_error (
40
+ const char* file, int line, const char* format = NULL, ...);
37
41
 
38
42
  }// ErrorFunctions
39
43
 
@@ -5,6 +5,7 @@
5
5
 
6
6
 
7
7
  #include <xot/pimpl.h>
8
+ #include <beeps/defs.h>
8
9
 
9
10
 
10
11
  namespace Beeps
@@ -19,8 +20,6 @@ namespace Beeps
19
20
 
20
21
  public:
21
22
 
22
- Processor ();
23
-
24
23
  virtual ~Processor ();
25
24
 
26
25
  virtual void process (Signals* signals);
@@ -29,6 +28,10 @@ namespace Beeps
29
28
 
30
29
  virtual bool operator ! () const;
31
30
 
31
+ protected:
32
+
33
+ Processor ();
34
+
32
35
  };// Processor
33
36
 
34
37
 
@@ -51,7 +54,7 @@ namespace Beeps
51
54
 
52
55
  struct Data;
53
56
 
54
- Xot::PImpl<Data, true> self;
57
+ Xot::PSharedImpl<Data> self;
55
58
 
56
59
  };// SineWave
57
60
 
@@ -75,7 +78,7 @@ namespace Beeps
75
78
 
76
79
  struct Data;
77
80
 
78
- Xot::PImpl<Data, true> self;
81
+ Xot::PSharedImpl<Data> self;
79
82
 
80
83
  };// SquareWave
81
84
 
@@ -99,7 +102,7 @@ namespace Beeps
99
102
 
100
103
  struct Data;
101
104
 
102
- Xot::PImpl<Data, true> self;
105
+ Xot::PSharedImpl<Data> self;
103
106
 
104
107
  };// SawtoothWave
105
108
 
@@ -121,7 +124,7 @@ namespace Beeps
121
124
 
122
125
  struct Data;
123
126
 
124
- Xot::PImpl<Data, true> self;
127
+ Xot::PSharedImpl<Data> self;
125
128
 
126
129
  };// FileIn
127
130