From b9b5318101d596b8f06cf5640ddceb90bdb9235c Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Tue, 8 Mar 2011 23:13:13 -0800 Subject: audio: skeleton for gr-audio component --- gr-audio/include/.gitignore | 2 ++ gr-audio/include/Makefile.am | 22 ++++++++++++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 gr-audio/include/.gitignore create mode 100644 gr-audio/include/Makefile.am (limited to 'gr-audio/include') diff --git a/gr-audio/include/.gitignore b/gr-audio/include/.gitignore new file mode 100644 index 000000000..b336cc7ce --- /dev/null +++ b/gr-audio/include/.gitignore @@ -0,0 +1,2 @@ +/Makefile +/Makefile.in diff --git a/gr-audio/include/Makefile.am b/gr-audio/include/Makefile.am new file mode 100644 index 000000000..d5b319c36 --- /dev/null +++ b/gr-audio/include/Makefile.am @@ -0,0 +1,22 @@ +# +# Copyright 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, +# Boston, MA 02110-1301, USA. +# + +include $(top_srcdir)/Makefile.common -- cgit From 77da72f511647d458b62ffefaa94662b78d7f7d3 Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Wed, 9 Mar 2011 00:52:55 -0800 Subject: audio: added audio factory registry and top level includes --- gr-audio/include/Makefile.am | 5 +++++ gr-audio/include/gr_audio_api.h | 31 ++++++++++++++++++++++++++++ gr-audio/include/gr_audio_sink.h | 41 ++++++++++++++++++++++++++++++++++++++ gr-audio/include/gr_audio_source.h | 41 ++++++++++++++++++++++++++++++++++++++ 4 files changed, 118 insertions(+) create mode 100644 gr-audio/include/gr_audio_api.h create mode 100644 gr-audio/include/gr_audio_sink.h create mode 100644 gr-audio/include/gr_audio_source.h (limited to 'gr-audio/include') diff --git a/gr-audio/include/Makefile.am b/gr-audio/include/Makefile.am index d5b319c36..a4db27d08 100644 --- a/gr-audio/include/Makefile.am +++ b/gr-audio/include/Makefile.am @@ -20,3 +20,8 @@ # include $(top_srcdir)/Makefile.common + +grinclude_HEADERS = \ + gr_audio_api.h \ + gr_audio_source.h \ + gr_audio_sink.h diff --git a/gr-audio/include/gr_audio_api.h b/gr-audio/include/gr_audio_api.h new file mode 100644 index 000000000..b21819bab --- /dev/null +++ b/gr-audio/include/gr_audio_api.h @@ -0,0 +1,31 @@ +/* + * Copyright 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, + * Boston, MA 02110-1301, USA. + */ + +#ifndef INCLUDED_GR_AUDIO_API_H +#define INCLUDED_GR_AUDIO_API_H + +#ifdef gnuradio_audio_EXPORTS +# define GR_AUDIO_API //FIXME needs attributes defines +#else +# define GR_AUDIO_API //FIXME needs attributes defines +#endif + +#endif /* INCLUDED_GR_AUDIO_API_H */ diff --git a/gr-audio/include/gr_audio_sink.h b/gr-audio/include/gr_audio_sink.h new file mode 100644 index 000000000..37ea6e7ba --- /dev/null +++ b/gr-audio/include/gr_audio_sink.h @@ -0,0 +1,41 @@ +/* + * Copyright 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, + * Boston, MA 02110-1301, USA. + */ + +#ifndef INCLUDED_GR_AUDIO_SINK_H +#define INCLUDED_GR_AUDIO_SINK_H + +#include +#include + +class GR_AUDIO_API gr_audio_sink : public gr_sync_block{ +public: + typedef boost::shared_ptr sptr; + + +}; + +GR_AUDIO_API gr_audio_sink::sptr gr_make_audio_sink( + int sampling_rate, + const std::string device_name = "", + bool ok_to_block = true +); + +#endif /* INCLUDED_GR_AUDIO_SINK_H */ diff --git a/gr-audio/include/gr_audio_source.h b/gr-audio/include/gr_audio_source.h new file mode 100644 index 000000000..1b4df9e2f --- /dev/null +++ b/gr-audio/include/gr_audio_source.h @@ -0,0 +1,41 @@ +/* + * Copyright 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, + * Boston, MA 02110-1301, USA. + */ + +#ifndef INCLUDED_GR_AUDIO_SOURCE_H +#define INCLUDED_GR_AUDIO_SOURCE_H + +#include +#include + +class GR_AUDIO_API gr_audio_source : public gr_sync_block{ +public: + typedef boost::shared_ptr sptr; + + +}; + +GR_AUDIO_API gr_audio_source::sptr gr_make_audio_source( + int sampling_rate, + const std::string device_name = "", + bool ok_to_block = true +); + +#endif /* INCLUDED_GR_AUDIO_SOURCE_H */ -- cgit From 24d30ff306a906b21ad724c07a95caed24659887 Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Wed, 9 Mar 2011 10:29:53 -0800 Subject: audio: work to get alsa support in, lets see if this works before adding more --- gr-audio/include/gr_audio_sink.h | 5 +++++ gr-audio/include/gr_audio_source.h | 5 +++++ 2 files changed, 10 insertions(+) (limited to 'gr-audio/include') diff --git a/gr-audio/include/gr_audio_sink.h b/gr-audio/include/gr_audio_sink.h index 37ea6e7ba..1a8585b82 100644 --- a/gr-audio/include/gr_audio_sink.h +++ b/gr-audio/include/gr_audio_sink.h @@ -29,6 +29,11 @@ class GR_AUDIO_API gr_audio_sink : public gr_sync_block{ public: typedef boost::shared_ptr sptr; + gr_audio_sink( + const std::string &name, + gr_io_signature_sptr insig, + gr_io_signature_sptr outsig + ); }; diff --git a/gr-audio/include/gr_audio_source.h b/gr-audio/include/gr_audio_source.h index 1b4df9e2f..446d41cf4 100644 --- a/gr-audio/include/gr_audio_source.h +++ b/gr-audio/include/gr_audio_source.h @@ -29,6 +29,11 @@ class GR_AUDIO_API gr_audio_source : public gr_sync_block{ public: typedef boost::shared_ptr sptr; + gr_audio_source( + const std::string &name, + gr_io_signature_sptr insig, + gr_io_signature_sptr outsig + ); }; -- cgit From 4cba8db90fe1412232a4c1a20d834f6ce606baf0 Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Wed, 9 Mar 2011 11:17:04 -0800 Subject: audio: work on swig support, it imports --- gr-audio/include/gr_audio_sink.h | 8 ++++---- gr-audio/include/gr_audio_source.h | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) (limited to 'gr-audio/include') diff --git a/gr-audio/include/gr_audio_sink.h b/gr-audio/include/gr_audio_sink.h index 1a8585b82..c76ec6550 100644 --- a/gr-audio/include/gr_audio_sink.h +++ b/gr-audio/include/gr_audio_sink.h @@ -25,11 +25,11 @@ #include #include -class GR_AUDIO_API gr_audio_sink : public gr_sync_block{ +class GR_AUDIO_API audio_sink : public gr_sync_block{ public: - typedef boost::shared_ptr sptr; + typedef boost::shared_ptr sptr; - gr_audio_sink( + audio_sink( const std::string &name, gr_io_signature_sptr insig, gr_io_signature_sptr outsig @@ -37,7 +37,7 @@ public: }; -GR_AUDIO_API gr_audio_sink::sptr gr_make_audio_sink( +GR_AUDIO_API audio_sink::sptr audio_make_sink( int sampling_rate, const std::string device_name = "", bool ok_to_block = true diff --git a/gr-audio/include/gr_audio_source.h b/gr-audio/include/gr_audio_source.h index 446d41cf4..ed3c31c10 100644 --- a/gr-audio/include/gr_audio_source.h +++ b/gr-audio/include/gr_audio_source.h @@ -25,11 +25,11 @@ #include #include -class GR_AUDIO_API gr_audio_source : public gr_sync_block{ +class GR_AUDIO_API audio_source : public gr_sync_block{ public: - typedef boost::shared_ptr sptr; + typedef boost::shared_ptr sptr; - gr_audio_source( + audio_source( const std::string &name, gr_io_signature_sptr insig, gr_io_signature_sptr outsig @@ -37,7 +37,7 @@ public: }; -GR_AUDIO_API gr_audio_source::sptr gr_make_audio_source( +GR_AUDIO_API audio_source::sptr audio_make_source( int sampling_rate, const std::string device_name = "", bool ok_to_block = true -- cgit From f8ce10742ab6b9ac170432ae78d2ee2d6c538d72 Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Wed, 16 Mar 2011 15:07:37 -0700 Subject: audio: cleanup audio source/sink with virtual inheritance The audio implementations now inherit from sync block (as they used to). And the redundant constructor in audio source/sink has been removed. --- gr-audio/include/gr_audio_sink.h | 9 +-------- gr-audio/include/gr_audio_source.h | 9 +-------- 2 files changed, 2 insertions(+), 16 deletions(-) (limited to 'gr-audio/include') diff --git a/gr-audio/include/gr_audio_sink.h b/gr-audio/include/gr_audio_sink.h index c76ec6550..ca3b15a37 100644 --- a/gr-audio/include/gr_audio_sink.h +++ b/gr-audio/include/gr_audio_sink.h @@ -25,16 +25,9 @@ #include #include -class GR_AUDIO_API audio_sink : public gr_sync_block{ +class GR_AUDIO_API audio_sink : virtual public gr_sync_block{ public: typedef boost::shared_ptr sptr; - - audio_sink( - const std::string &name, - gr_io_signature_sptr insig, - gr_io_signature_sptr outsig - ); - }; GR_AUDIO_API audio_sink::sptr audio_make_sink( diff --git a/gr-audio/include/gr_audio_source.h b/gr-audio/include/gr_audio_source.h index ed3c31c10..b8ae2ca5f 100644 --- a/gr-audio/include/gr_audio_source.h +++ b/gr-audio/include/gr_audio_source.h @@ -25,16 +25,9 @@ #include #include -class GR_AUDIO_API audio_source : public gr_sync_block{ +class GR_AUDIO_API audio_source : virtual public gr_sync_block{ public: typedef boost::shared_ptr sptr; - - audio_source( - const std::string &name, - gr_io_signature_sptr insig, - gr_io_signature_sptr outsig - ); - }; GR_AUDIO_API audio_source::sptr audio_make_source( -- cgit