audite-lib 0.4.4 → 0.4.5

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
  SHA1:
3
- metadata.gz: 2ca4bfa72e1afc67b4db1571b18974453aaad0e4
4
- data.tar.gz: 9791bb4e95e5a611065bde494569421f0dc821ff
3
+ metadata.gz: b358e6f9a8ec0f305bb8a10e9ebb283883ba4db0
4
+ data.tar.gz: f9d8c736c521c6bb07ce8a103e7e78815106bc30
5
5
  SHA512:
6
- metadata.gz: 64de15760d85f6ac98d4aac0069331d347103514bc7e48a14578aa73e9bee498da9de88bf428f8e8353079d9094a781649d62ab4c5428fe2849ead3f285d8488
7
- data.tar.gz: 3503fc1583fca5badbcb528ec1a9250069330b2cb2a64d86d9b6c1799702a8d882a3570d65faee3139369623bef741048adb776c7a3cdb37d2d3e1dfb04a207a
6
+ metadata.gz: 73841c684b9928f4889511daacb6a153a5f61a7686c2feba60a66fe1544c3cba02680700cba32ad07ff48fd851f91d89b7a6ec8adab216df82d0f4b2b71ca9a0
7
+ data.tar.gz: 0ea4c23c61f988119a9a15141b9636e7e557204d50e19772dd0a57c72fa67e0541c98ef7193e56903aaeb4de62c0d7df58d6955a9bbf82763efa3c61acbd2d6f
@@ -2,7 +2,7 @@ $:.push File.expand_path("../lib", __FILE__)
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = "audite-lib"
5
- s.version = "0.4.4"
5
+ s.version = "0.4.5"
6
6
  s.author = "Matthias Georgi"
7
7
  s.email = "matti.georgi@gmail.com"
8
8
  s.homepage = "http://georgi.github.com/audite"
@@ -232,6 +232,22 @@ VALUE rb_portaudio_stop(VALUE self)
232
232
  return self;
233
233
  }
234
234
 
235
+
236
+ VALUE rb_portaudio_abort(VALUE self)
237
+ {
238
+ Portaudio *portaudio;
239
+ Data_Get_Struct(self, Portaudio, portaudio);
240
+ int err = Pa_AbortStream(portaudio->stream);
241
+
242
+ pthread_cond_broadcast(&portaudio->cond);
243
+
244
+ if (err != paNoError) {
245
+ rb_raise(rb_eStandardError, "%s", Pa_GetErrorText(err));
246
+ }
247
+
248
+ return self;
249
+ }
250
+
235
251
  VALUE rb_portaudio_stream_stopped(VALUE self)
236
252
  {
237
253
  Portaudio *portaudio;
@@ -280,4 +296,5 @@ void Init_portaudio(void) {
280
296
  rb_define_method(rb_cPortaudio, "write_from_mpg", rb_portaudio_write_from_mpg, 1);
281
297
  rb_define_method(rb_cPortaudio, "start", rb_portaudio_start, 0);
282
298
  rb_define_method(rb_cPortaudio, "stop", rb_portaudio_stop, 0);
299
+ rb_define_method(rb_cPortaudio, "abort", rb_portaudio_abort, 0);
283
300
  }
@@ -84,15 +84,11 @@ class Audite
84
84
  def stop_stream
85
85
  if @active
86
86
  @active = false
87
+ @thread = nil unless @thread.alive?
87
88
  unless @stream.stopped?
88
- @stream.stop
89
+ @stream.abort
89
90
  events.trigger(:toggle, @active)
90
91
  end
91
- if @thread.alive?
92
- current_thread = @thread
93
- @thread = nil
94
- current_thread.kill
95
- end
96
92
  end
97
93
  end
98
94
 
@@ -189,4 +185,4 @@ class Audite
189
185
  def forward(seconds = 2)
190
186
  seek(position + seconds)
191
187
  end
192
- end
188
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: audite-lib
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.4
4
+ version: 0.4.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matthias Georgi