diff options
Diffstat (limited to 'gr-audio/lib/portaudio')
-rw-r--r-- | gr-audio/lib/portaudio/audio_portaudio_sink.cc | 22 | ||||
-rw-r--r-- | gr-audio/lib/portaudio/audio_portaudio_sink.h | 10 | ||||
-rw-r--r-- | gr-audio/lib/portaudio/audio_portaudio_source.cc | 24 | ||||
-rw-r--r-- | gr-audio/lib/portaudio/audio_portaudio_source.h | 10 | ||||
-rw-r--r-- | gr-audio/lib/portaudio/gri_portaudio.cc | 12 | ||||
-rw-r--r-- | gr-audio/lib/portaudio/gri_portaudio.h | 8 |
6 files changed, 43 insertions, 43 deletions
diff --git a/gr-audio/lib/portaudio/audio_portaudio_sink.cc b/gr-audio/lib/portaudio/audio_portaudio_sink.cc index 7fdb99577..af7f1e48c 100644 --- a/gr-audio/lib/portaudio/audio_portaudio_sink.cc +++ b/gr-audio/lib/portaudio/audio_portaudio_sink.cc @@ -1,19 +1,19 @@ /* -*- c++ -*- */ /* * Copyright 2006-2011 Free Software Foundation, Inc. - * + * * This file is part of GNU Radio - * + * * 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 3, or (at your option) * any later version. - * + * * GNU Radio is distributed in he hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * 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., 51 Franklin Street, @@ -49,7 +49,7 @@ typedef float sample_t; // Number of portaudio buffers in the ringbuffer static const unsigned int N_BUFFERS = 4; -static std::string +static std::string default_device_name () { return gr_prefs::singleton()->get_string("audio_portaudio", "default_output_device", ""); @@ -59,7 +59,7 @@ void audio_portaudio_sink::create_ringbuffer(void) { int bufsize_samples = d_portaudio_buffer_size_frames * d_output_parameters.channelCount; - + if (d_verbose) fprintf(stderr,"ring buffer size = %d frames\n", N_BUFFERS*bufsize_samples/d_output_parameters.channelCount); @@ -89,7 +89,7 @@ portaudio_sink_callback (const void *inputBuffer, framesPerBuffer * self->d_output_parameters.channelCount; int navail_samples = self->d_reader->items_available(); - + if (nreqd_samples <= navail_samples) { // We've got enough data... { gruel::scoped_lock guard(self->d_ringbuffer_mutex); @@ -167,7 +167,7 @@ audio_portaudio_sink::audio_portaudio_sink(int sampling_rate, if (numDevices == 0) bail("no devices available", 0); - if (d_device_name.empty()) + if (d_device_name.empty()) { // FIXME Get smarter about picking something fprintf(stderr,"\nUsing Default Device\n"); @@ -259,7 +259,7 @@ audio_portaudio_sink::check_topology (int ninputs, int noutputs) return false; } -#if 0 +#if 0 const PaStreamInfo *psi = Pa_GetStreamInfo(d_stream); d_portaudio_buffer_size_frames = (int)(d_output_parameters.suggestedLatency * psi->sampleRate); @@ -332,11 +332,11 @@ audio_portaudio_sink::work (int noutput_items, int nf = std::min(noutput_items - k, nframes); float *p = (float *) d_writer->write_pointer(); - + for (int i = 0; i < nf; i++) for (unsigned int c = 0; c < nchan; c++) *p++ = in[c][k + i]; - + d_writer->update_write_pointer(nf * nchan); k += nf; diff --git a/gr-audio/lib/portaudio/audio_portaudio_sink.h b/gr-audio/lib/portaudio/audio_portaudio_sink.h index 04a881f7e..cf64d3da0 100644 --- a/gr-audio/lib/portaudio/audio_portaudio_sink.h +++ b/gr-audio/lib/portaudio/audio_portaudio_sink.h @@ -1,19 +1,19 @@ /* -*- c++ -*- */ /* * Copyright 2006-2011 Free Software Foundation, Inc. - * + * * This file is part of GNU Radio - * + * * 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 3, or (at your option) * any later version. - * + * * GNU Radio is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * 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., 51 Franklin Street, @@ -75,7 +75,7 @@ public: bool ok_to_block); ~audio_portaudio_sink (); - + bool check_topology (int ninputs, int noutputs); int work (int noutput_items, diff --git a/gr-audio/lib/portaudio/audio_portaudio_source.cc b/gr-audio/lib/portaudio/audio_portaudio_source.cc index 55828ad21..ddb1a6fb6 100644 --- a/gr-audio/lib/portaudio/audio_portaudio_source.cc +++ b/gr-audio/lib/portaudio/audio_portaudio_source.cc @@ -1,19 +1,19 @@ /* -*- c++ -*- */ /* * Copyright 2006-2011 Free Software Foundation, Inc. - * + * * This file is part of GNU Radio - * + * * 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 3, or (at your option) * any later version. - * + * * GNU Radio is distributed in he hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * 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., 51 Franklin Street, @@ -49,7 +49,7 @@ typedef float sample_t; // Number of portaudio buffers in the ringbuffer static const unsigned int N_BUFFERS = 4; -static std::string +static std::string default_device_name () { return gr_prefs::singleton()->get_string("audio_portaudio", "default_input_device", ""); @@ -59,7 +59,7 @@ void audio_portaudio_source::create_ringbuffer(void) { int bufsize_samples = d_portaudio_buffer_size_frames * d_input_parameters.channelCount; - + if (d_verbose) fprintf(stderr, "ring buffer size = %d frames\n", N_BUFFERS*bufsize_samples/d_input_parameters.channelCount); @@ -101,7 +101,7 @@ portaudio_source_callback (const void *inputBuffer, inputBuffer, nframes_to_copy * nchan * sizeof(sample_t)); self->d_writer->update_write_pointer(nframes_to_copy * nchan); - + // Tell the source thread there is new data in the ringbuffer. self->d_ringbuffer_ready = true; } @@ -167,7 +167,7 @@ audio_portaudio_source::audio_portaudio_source(int sampling_rate, if (numDevices == 0) bail("no devices available", 0); - if (d_device_name.empty()) + if (d_device_name.empty()) { // FIXME Get smarter about picking something device = Pa_GetDefaultInputDevice(); @@ -178,7 +178,7 @@ audio_portaudio_source::audio_portaudio_source(int sampling_rate, else { bool found = false; - + for (i=0;i<numDevices;i++) { deviceInfo = Pa_GetDeviceInfo( i ); fprintf(stderr,"Testing device name: %s",deviceInfo->name); @@ -257,7 +257,7 @@ audio_portaudio_source::check_topology (int ninputs, int noutputs) return false; } -#if 0 +#if 0 const PaStreamInfo *psi = Pa_GetStreamInfo(d_stream); d_portaudio_buffer_size_frames = (int)(d_input_parameters.suggestedLatency * psi->sampleRate); @@ -309,7 +309,7 @@ audio_portaudio_source::work (int noutput_items, d_ringbuffer_cond.wait(guard); // block here, then try again continue; } - + assert(k == 0); // There's no data and we're not allowed to block. @@ -343,7 +343,7 @@ audio_portaudio_source::work (int noutput_items, gruel::scoped_lock guard(d_ringbuffer_mutex); int nf = std::min(noutput_items - k, nframes); - + const float *p = (const float *) d_reader->read_pointer(); for (int i = 0; i < nf; i++){ for (unsigned int c = 0; c < nchan; c++){ diff --git a/gr-audio/lib/portaudio/audio_portaudio_source.h b/gr-audio/lib/portaudio/audio_portaudio_source.h index b555bc759..e81389a3b 100644 --- a/gr-audio/lib/portaudio/audio_portaudio_source.h +++ b/gr-audio/lib/portaudio/audio_portaudio_source.h @@ -1,19 +1,19 @@ /* -*- c++ -*- */ /* * Copyright 2006-2011 Free Software Foundation, Inc. - * + * * This file is part of GNU Radio - * + * * 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 3, or (at your option) * any later version. - * + * * GNU Radio is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * 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., 51 Franklin Street, @@ -73,7 +73,7 @@ public: bool ok_to_block); ~audio_portaudio_source (); - + bool check_topology (int ninputs, int noutputs); int work (int ninput_items, diff --git a/gr-audio/lib/portaudio/gri_portaudio.cc b/gr-audio/lib/portaudio/gri_portaudio.cc index faa472337..66f3d4647 100644 --- a/gr-audio/lib/portaudio/gri_portaudio.cc +++ b/gr-audio/lib/portaudio/gri_portaudio.cc @@ -1,19 +1,19 @@ /* -*- c++ -*- */ /* * Copyright 2006 Free Software Foundation, Inc. - * + * * This file is part of GNU Radio - * + * * 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 3, or (at your option) * any later version. - * + * * GNU Radio is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * 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., 51 Franklin Street, @@ -80,7 +80,7 @@ gri_print_devices() printf( "[ Default %s Input", hostInfo->name ); defaultDisplayed = 1; } - + if( i == Pa_GetDefaultOutputDevice() ) { printf( (defaultDisplayed ? "," : "[") ); @@ -90,7 +90,7 @@ gri_print_devices() else if( i == Pa_GetHostApiInfo( deviceInfo->hostApi )->defaultOutputDevice ) { const PaHostApiInfo *hostInfo = Pa_GetHostApiInfo( deviceInfo->hostApi ); - printf( (defaultDisplayed ? "," : "[") ); + printf( (defaultDisplayed ? "," : "[") ); printf( " Default %s Output", hostInfo->name ); defaultDisplayed = 1; } diff --git a/gr-audio/lib/portaudio/gri_portaudio.h b/gr-audio/lib/portaudio/gri_portaudio.h index 36191e25a..c3ea7d064 100644 --- a/gr-audio/lib/portaudio/gri_portaudio.h +++ b/gr-audio/lib/portaudio/gri_portaudio.h @@ -1,19 +1,19 @@ /* -*- c++ -*- */ /* * Copyright 2006 Free Software Foundation, Inc. - * + * * This file is part of GNU Radio - * + * * 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 3, or (at your option) * any later version. - * + * * GNU Radio is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * 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., 51 Franklin Street, |