Merge r11462:11485 from jcorgan/omni into trunk.
[debian/gnuradio] / gr-audio-portaudio / src / audio_portaudio_sink.cc
index 90daa630eecbdbe780ed2c4ce207c9c6eed383b7..2e48feb4af63410d1b376d33dfb9823b98f18f9f 100644 (file)
@@ -6,7 +6,7 @@
  * 
  * GNU Radio is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
+ * the Free Software Foundation; either version 3, or (at your option)
  * any later version.
  * 
  * GNU Radio is distributed in he hope that it will be useful,
 #include <unistd.h>
 #include <stdexcept>
 #include <gri_portaudio.h>
-#include <omnithread.h>
+#include <gnuradio/omnithread.h>
+#include <string.h>
 
-#define        LOGGING   0             // define to 0 or 1
+//#define      LOGGING   0             // define to 0 or 1
 
 #define SAMPLE_FORMAT          paFloat32
 typedef float sample_t;
@@ -84,8 +85,8 @@ portaudio_sink_callback (const void *inputBuffer,
   int navail_samples = self->d_reader->items_available();
   
   if (nreqd_samples <= navail_samples){  // We've got enough data...
-    if (LOGGING)
-      self->d_log->printf("PAsink cb: f/b = %4ld\n", framesPerBuffer);
+    //if (LOGGING)
+    //  self->d_log->printf("PAsink cb: f/b = %4ld\n", framesPerBuffer);
     // copy from ringbuffer into output buffer
     memcpy(outputBuffer,
           self->d_reader->read_pointer(),
@@ -98,8 +99,8 @@ portaudio_sink_callback (const void *inputBuffer,
   }
 
   else {                       // underrun
-    if (LOGGING)
-      self->d_log->printf("PAsink cb: f/b = %4ld UNDERRUN\n", framesPerBuffer);
+    //if (LOGGING)
+    //  self->d_log->printf("PAsink cb: f/b = %4ld UNDERRUN\n", framesPerBuffer);
 
     self->d_nunderuns++;
     ::write(2, "aU", 2);       // FIXME change to non-blocking call
@@ -138,8 +139,8 @@ audio_portaudio_sink::audio_portaudio_sink(int sampling_rate,
     d_nunderuns(0)
 {
   memset(&d_output_parameters, 0, sizeof(d_output_parameters));
-  if (LOGGING)
-    d_log = gri_logger::singleton();
+  //if (LOGGING)
+  //  d_log = gri_logger::singleton();
 
   PaError            err;
   int                i, numDevices;