hornetseye-alsa 1.2.0 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (4) hide show
  1. data/Rakefile +1 -1
  2. data/ext/alsainput.cc +7 -12
  3. data/ext/alsainput.hh +1 -1
  4. metadata +3 -3
data/Rakefile CHANGED
@@ -7,7 +7,7 @@ require 'rake/loaders/makefile'
7
7
  require 'rbconfig'
8
8
 
9
9
  PKG_NAME = 'hornetseye-alsa'
10
- PKG_VERSION = '1.2.0'
10
+ PKG_VERSION = '1.3.0'
11
11
  CFG = RbConfig::CONFIG
12
12
  CXX = ENV[ 'CXX' ] || 'g++'
13
13
  RB_FILES = FileList[ 'lib/**/*.rb' ]
data/ext/alsainput.cc CHANGED
@@ -130,6 +130,10 @@ void AlsaInput::drop(void) throw (Error)
130
130
  m_count = 0;
131
131
  snd_pcm_drop(m_pcmHandle);
132
132
  unlock();
133
+ if (m_threadInitialised) {
134
+ pthread_join(m_thread, NULL);
135
+ m_threadInitialised = false;
136
+ }
133
137
  }
134
138
 
135
139
  unsigned int AlsaInput::rate(void)
@@ -185,15 +189,6 @@ void AlsaInput::unlock(void)
185
189
  pthread_mutex_unlock( &m_mutex );
186
190
  }
187
191
 
188
- void AlsaInput::prepare(void) throw (Error)
189
- {
190
- ERRORMACRO( m_pcmHandle != NULL, Error, , "PCM device \"" << m_pcmName
191
- << "\" is not open. Did you call \"close\" before?" );
192
- int err = snd_pcm_prepare( m_pcmHandle );
193
- ERRORMACRO( err >= 0, Error, , "Error preparing PCM device \"" << m_pcmName
194
- << "\": " << snd_strerror( err ) );
195
- }
196
-
197
192
  void AlsaInput::threadFunc(void)
198
193
  {
199
194
  bool quit = false;
@@ -247,7 +242,7 @@ VALUE AlsaInput::registerRubyClass( VALUE rbModule )
247
242
  rb_define_method( cRubyClass, "rate", RUBY_METHOD_FUNC( wrapRate ), 0 );
248
243
  rb_define_method( cRubyClass, "channels", RUBY_METHOD_FUNC( wrapChannels ), 0 );
249
244
  rb_define_method( cRubyClass, "avail", RUBY_METHOD_FUNC( wrapAvail ), 0 );
250
- rb_define_method( cRubyClass, "prepare", RUBY_METHOD_FUNC( wrapPrepare ), 0 );
245
+ rb_define_method( cRubyClass, "drop", RUBY_METHOD_FUNC( wrapDrop ), 0 );
251
246
  }
252
247
 
253
248
  void AlsaInput::deleteRubyObject( void *ptr )
@@ -315,11 +310,11 @@ VALUE AlsaInput::wrapAvail( VALUE rbSelf )
315
310
  return rbRetVal;
316
311
  }
317
312
 
318
- VALUE AlsaInput::wrapPrepare( VALUE rbSelf )
313
+ VALUE AlsaInput::wrapDrop( VALUE rbSelf )
319
314
  {
320
315
  try {
321
316
  AlsaInputPtr *self; Data_Get_Struct( rbSelf, AlsaInputPtr, self );
322
- (*self)->prepare();
317
+ (*self)->drop();
323
318
  } catch ( exception &e ) {
324
319
  rb_raise( rb_eRuntimeError, "%s", e.what() );
325
320
  };
data/ext/alsainput.hh CHANGED
@@ -47,7 +47,7 @@ public:
47
47
  static VALUE wrapRate( VALUE rbSelf );
48
48
  static VALUE wrapChannels( VALUE rbSelf );
49
49
  static VALUE wrapAvail( VALUE rbSelf );
50
- static VALUE wrapPrepare( VALUE rbSelf );
50
+ static VALUE wrapDrop( VALUE rbSelf );
51
51
  protected:
52
52
  void readi(short int *data, int count);
53
53
  void threadFunc(void);
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hornetseye-alsa
3
3
  version: !ruby/object:Gem::Version
4
- hash: 31
4
+ hash: 27
5
5
  prerelease:
6
6
  segments:
7
7
  - 1
8
- - 2
8
+ - 3
9
9
  - 0
10
- version: 1.2.0
10
+ version: 1.3.0
11
11
  platform: ruby
12
12
  authors:
13
13
  - Jan Wedekind