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 +4 -4
- data/audite.gemspec +1 -1
- data/ext/portaudio/portaudio.c +17 -0
- data/lib/audite.rb +3 -7
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b358e6f9a8ec0f305bb8a10e9ebb283883ba4db0
|
4
|
+
data.tar.gz: f9d8c736c521c6bb07ce8a103e7e78815106bc30
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 73841c684b9928f4889511daacb6a153a5f61a7686c2feba60a66fe1544c3cba02680700cba32ad07ff48fd851f91d89b7a6ec8adab216df82d0f4b2b71ca9a0
|
7
|
+
data.tar.gz: 0ea4c23c61f988119a9a15141b9636e7e557204d50e19772dd0a57c72fa67e0541c98ef7193e56903aaeb4de62c0d7df58d6955a9bbf82763efa3c61acbd2d6f
|
data/audite.gemspec
CHANGED
data/ext/portaudio/portaudio.c
CHANGED
@@ -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
|
}
|
data/lib/audite.rb
CHANGED
@@ -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.
|
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
|