Adding a "change in progress" check to alsa sink.
[debian/gnuradio] / gr-audio-alsa / src / audio_alsa_sink.h
index bb61e49ab2a2770219a268ca732e0f0c0d15086b..811cc6c8cbf86f55b5fb87c83c0db6e1b357e6b9 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 the hope that it will be useful,
@@ -16,8 +16,8 @@
  * 
  * You should have received a copy of the GNU General Public License
  * along with GNU Radio; see the file COPYING.  If not, write to
- * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
+ * the Free Software Foundation, Inc., 51 Franklin Street,
+ * Boston, MA 02110-1301, USA.
  */
 
 #ifndef INCLUDED_AUDIO_ALSA_SINK_H
@@ -40,12 +40,12 @@ typedef boost::shared_ptr<audio_alsa_sink> audio_alsa_sink_sptr;
  * \brief make an alsa audio sink.
  *
  * \param sampling_rate        sampling rate in Hz
- * \param dev ALSA pcm device name, e.g., "hw:0,0"
+ * \param device_name ALSA pcm device name, e.g., "hw:0,0"
  * \param ok_to_block (currently ignored)
  */
 audio_alsa_sink_sptr
 audio_alsa_make_sink (int sampling_rate,
-                     const std::string dev = "",
+                     const std::string device_name = "",
                      bool ok_to_block = true);
 
 /*!
@@ -83,6 +83,8 @@ class audio_alsa_sink : public gr_sync_block {
   // random stats
   int                  d_nunderuns;            // count of underruns
   int                  d_nsuspends;            // count of suspends
+  bool                  d_change_in_progress;   // Topology change in progress--used as spinlock for write_buffer
+  bool                 d_ok_to_block;      // defaults to "true", controls blocking/non-block I/O
 
   void output_error_msg (const char *msg, int err);
   void bail (const char *msg, int err) throw (std::runtime_error);