beeps 0.1.34 → 0.1.35

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: b0fc11628b3b4c24a65fa7f2b9371c4576465b918a7c5bab3fc675550c53b9d6
4
- data.tar.gz: d5d797d456eade8d777b1d891a814b2b024f5bd75548cb71f6eef2e2ad455f54
3
+ metadata.gz: 4abd66d942c96bad56f00299a5243e3a0329fab261899a3b8d03446a81a8851e
4
+ data.tar.gz: 65b195ccb50cd33d18442f09d02efa9c9f07e4c51664ac397327b17a76c0c954
5
5
  SHA512:
6
- metadata.gz: 778baae40051bbc884424a90d58bd9f8633510bf69b1eb37e12dcedee09e4e7119f286a0f26daf05d8b686e7801a3a71342ef2818a7e8bcc5abe0dffb51d67fd
7
- data.tar.gz: c92a6756777162065c0f6568a7dd4755113b93db8ffd4d18a3e61b2e6e6e3dbd0635c3548d2d928a91c0e5785ba1841b743920f5d7bb79dcde6d36e7d9af562c
6
+ metadata.gz: 684012ab4651e9bf0653e004c0911b98e54cd917dfcfb644df7891e9a9ee9c53f904f7c98fc30cdecdc709813e21165c34d88c5f8a874549128b3b990a60d5a7
7
+ data.tar.gz: '08b3f641dbc010ae70a23a47f35b84957ecda237ea5bd8629bee8b6dcdd0198cbc1d0de752cb7ec3a2a39e0975635cc80492e635f35c0566e9d3a6999a2688a7'
@@ -36,15 +36,6 @@ VALUE play(VALUE self)
36
36
  return value(THIS->play());
37
37
  }
38
38
 
39
- static
40
- VALUE save(VALUE self, VALUE path)
41
- {
42
- CHECK;
43
-
44
- THIS->save(path.c_str());
45
- return self;
46
- }
47
-
48
39
  static
49
40
  VALUE get_sample_rate(VALUE self)
50
41
  {
@@ -103,6 +94,15 @@ VALUE get_loop(VALUE self)
103
94
  return value(THIS->loop());
104
95
  }
105
96
 
97
+ static
98
+ VALUE save(VALUE self, VALUE path)
99
+ {
100
+ CHECK;
101
+
102
+ THIS->save(path.c_str());
103
+ return self;
104
+ }
105
+
106
106
  static
107
107
  VALUE load(VALUE self, VALUE path)
108
108
  {
@@ -121,7 +121,6 @@ Init_beeps_sound ()
121
121
  rb_define_alloc_func(cSound, alloc);
122
122
  rb_define_private_method(cSound, "setup", RUBY_METHOD_FUNC(setup), 4);
123
123
  cSound.define_private_method("play!", play);
124
- rb_define_method(cSound, "save", RUBY_METHOD_FUNC(save), 1);
125
124
  rb_define_method(cSound, "sample_rate", RUBY_METHOD_FUNC(get_sample_rate), 0);
126
125
  rb_define_method(cSound, "nchannels", RUBY_METHOD_FUNC(get_nchannels), 0);
127
126
  rb_define_method(cSound, "seconds", RUBY_METHOD_FUNC(get_seconds), 0);
@@ -129,6 +128,7 @@ Init_beeps_sound ()
129
128
  rb_define_method(cSound, "gain", RUBY_METHOD_FUNC(get_gain), 0);
130
129
  rb_define_method(cSound, "loop=", RUBY_METHOD_FUNC(set_loop), 1);
131
130
  rb_define_method(cSound, "loop", RUBY_METHOD_FUNC(get_loop), 0);
131
+ rb_define_method(cSound, "save", RUBY_METHOD_FUNC(save), 1);
132
132
  rb_define_singleton_method(cSound, "load", RUBY_METHOD_FUNC(load), 1);
133
133
  }
134
134
 
@@ -20,8 +20,9 @@ def setup_dependencies(build: true, only: nil)
20
20
 
21
21
  exts.each do |ext|
22
22
  gem = RENAMES[ext.to_sym].then {|s| s || ext}
23
- clone = "git clone --depth 1 https://github.com/xord/#{ext}.git ../#{ext}"
24
23
  ver = gemspec[/add_runtime_dependency.*['"]#{gem}['"].*['"]\s*~>\s*([\d\.]+)\s*['"]/, 1]
24
+ opts = '-c advice.detachedHead=false --depth 1'
25
+ clone = "git clone #{opts} https://github.com/xord/#{ext}.git ../#{ext}"
25
26
 
26
27
  # 'rake subtree:push' pushes all subrepos, so cloning by new tag
27
28
  # often fails before tagging each new tag
data/ChangeLog.md CHANGED
@@ -1,6 +1,11 @@
1
1
  # beeps ChangeLog
2
2
 
3
3
 
4
+ ## [v0.1.35] - 2023-04-30
5
+
6
+ - Place the save() method next to load()
7
+
8
+
4
9
  ## [v0.1.34] - 2023-04-25
5
10
 
6
11
  - Clear mic streams on exit
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.34
1
+ 0.1.35
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.7.0'
30
30
 
31
- s.add_runtime_dependency 'xot', '~> 0.1.33'
32
- s.add_runtime_dependency 'rucy', '~> 0.1.33'
31
+ s.add_runtime_dependency 'xot', '~> 0.1.34'
32
+ s.add_runtime_dependency 'rucy', '~> 0.1.34'
33
33
 
34
34
  s.add_development_dependency 'rake'
35
35
  s.add_development_dependency 'test-unit'
data/ext/beeps/sound.cpp CHANGED
@@ -39,16 +39,6 @@ RUCY_DEF0(play)
39
39
  }
40
40
  RUCY_END
41
41
 
42
- static
43
- RUCY_DEF1(save, path)
44
- {
45
- CHECK;
46
-
47
- THIS->save(path.c_str());
48
- return self;
49
- }
50
- RUCY_END
51
-
52
42
  static
53
43
  RUCY_DEF0(get_sample_rate)
54
44
  {
@@ -114,6 +104,16 @@ RUCY_DEF0(get_loop)
114
104
  }
115
105
  RUCY_END
116
106
 
107
+ static
108
+ RUCY_DEF1(save, path)
109
+ {
110
+ CHECK;
111
+
112
+ THIS->save(path.c_str());
113
+ return self;
114
+ }
115
+ RUCY_END
116
+
117
117
  static
118
118
  RUCY_DEF1(load, path)
119
119
  {
@@ -133,7 +133,6 @@ Init_beeps_sound ()
133
133
  cSound.define_alloc_func(alloc);
134
134
  cSound.define_private_method("setup", setup);
135
135
  cSound.define_private_method("play!", play);
136
- cSound.define_method("save", save);
137
136
  cSound.define_method("sample_rate", get_sample_rate);
138
137
  cSound.define_method("nchannels", get_nchannels);
139
138
  cSound.define_method("seconds", get_seconds);
@@ -141,6 +140,7 @@ Init_beeps_sound ()
141
140
  cSound.define_method("gain", get_gain);
142
141
  cSound.define_method("loop=", set_loop);
143
142
  cSound.define_method("loop", get_loop);
143
+ cSound.define_method("save", save);
144
144
  cSound.define_singleton_method("load", load);
145
145
  }
146
146
 
@@ -72,8 +72,6 @@ namespace Beeps
72
72
 
73
73
  SoundPlayer play ();
74
74
 
75
- void save (const char* path) const;
76
-
77
75
  double sample_rate () const;
78
76
 
79
77
  uint nchannels () const;
@@ -88,6 +86,8 @@ namespace Beeps
88
86
 
89
87
  bool loop () const;
90
88
 
89
+ void save (const char* path) const;
90
+
91
91
  operator bool () const;
92
92
 
93
93
  bool operator ! () const;
data/src/sound.cpp CHANGED
@@ -649,11 +649,6 @@ namespace Beeps
649
649
  not_implemented_error(__FILE__, __LINE__);
650
650
  }
651
651
 
652
- virtual void save (const char* path) const
653
- {
654
- not_implemented_error(__FILE__, __LINE__);
655
- }
656
-
657
652
  virtual double sample_rate () const
658
653
  {
659
654
  return 0;
@@ -669,6 +664,11 @@ namespace Beeps
669
664
  return 0;
670
665
  }
671
666
 
667
+ virtual void save (const char* path) const
668
+ {
669
+ not_implemented_error(__FILE__, __LINE__);
670
+ }
671
+
672
672
  virtual bool is_valid () const
673
673
  {
674
674
  return false;
@@ -706,14 +706,6 @@ namespace Beeps
706
706
  player->self->attach_signals(signals);
707
707
  }
708
708
 
709
- void save (const char* path) const override
710
- {
711
- if (!signals)
712
- invalid_state_error(__FILE__, __LINE__);
713
-
714
- Signals_save(signals, path);
715
- }
716
-
717
709
  double sample_rate () const override
718
710
  {
719
711
  return signals ? signals.sample_rate() : Super::sample_rate();
@@ -729,6 +721,14 @@ namespace Beeps
729
721
  return signals ? Signals_get_seconds(signals) : Super::seconds();
730
722
  }
731
723
 
724
+ void save (const char* path) const override
725
+ {
726
+ if (!signals)
727
+ invalid_state_error(__FILE__, __LINE__);
728
+
729
+ Signals_save(signals, path);
730
+ }
731
+
732
732
  bool is_valid () const override
733
733
  {
734
734
  return signals;
@@ -840,12 +840,6 @@ namespace Beeps
840
840
  return player;
841
841
  }
842
842
 
843
- void
844
- Sound::save (const char* path) const
845
- {
846
- self->save(path);
847
- }
848
-
849
843
  double
850
844
  Sound::sample_rate () const
851
845
  {
@@ -891,6 +885,12 @@ namespace Beeps
891
885
  return self->loop;
892
886
  }
893
887
 
888
+ void
889
+ Sound::save (const char* path) const
890
+ {
891
+ self->save(path);
892
+ }
893
+
894
894
  Sound::operator bool () const
895
895
  {
896
896
  return self->is_valid();
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.34
4
+ version: 0.1.35
5
5
  platform: ruby
6
6
  authors:
7
7
  - xordog
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-04-24 00:00:00.000000000 Z
11
+ date: 2023-04-30 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.33
19
+ version: 0.1.34
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.33
26
+ version: 0.1.34
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.33
33
+ version: 0.1.34
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.33
40
+ version: 0.1.34
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rake
43
43
  requirement: !ruby/object:Gem::Requirement