Updating audio_jack to new interface for creating a client. Fixes depricated warning.
[debian/gnuradio] / gr-audio-jack / src / audio_jack_source.cc
index 392d246b427db229b45b75bf52fb5f65b9c45d69..a92e970f5825efb3febb2c5b2cf4f297fefdeb28 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2005,2006 Free Software Foundation, Inc.
+ * Copyright 2005,2006,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -88,7 +88,7 @@ jack_source_process (jack_nframes_t nframes, void *arg)
 audio_jack_source_sptr
 audio_jack_make_source (int sampling_rate, const std::string dev, bool ok_to_block)
 {
-  return audio_jack_source_sptr (new audio_jack_source (sampling_rate, dev, ok_to_block));
+  return gnuradio::get_initial_sptr(new audio_jack_source (sampling_rate, dev, ok_to_block));
 }
 
 audio_jack_source::audio_jack_source (int sampling_rate,
@@ -110,7 +110,12 @@ audio_jack_source::audio_jack_source (int sampling_rate,
 #endif
 
   // try to become a client of the JACK server
-  if ((d_jack_client = jack_client_new (d_device_name.c_str ())) == 0) {
+  jack_options_t options = JackNullOption;
+  jack_status_t status;
+  const char *server_name = NULL;
+  if ((d_jack_client = jack_client_open (d_device_name.c_str (),
+                                        options, &status,
+                                        server_name)) == NULL) {
     fprintf (stderr, "audio_jack_source[%s]: jack server not running?\n",
             d_device_name.c_str());
     throw std::runtime_error ("audio_jack_source");