commit-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Commit-gnuradio] r4014 - in gnuradio/branches/developers/jcorgan/hier:


From: jcorgan
Subject: [Commit-gnuradio] r4014 - in gnuradio/branches/developers/jcorgan/hier: config gnuradio-core/src/lib/runtime gnuradio-examples/c++ gnuradio-examples/c++/hier
Date: Wed, 22 Nov 2006 00:13:47 -0700 (MST)

Author: jcorgan
Date: 2006-11-22 00:13:47 -0700 (Wed, 22 Nov 2006)
New Revision: 4014

Added:
   gnuradio/branches/developers/jcorgan/hier/gnuradio-examples/c++/hier/
   
gnuradio/branches/developers/jcorgan/hier/gnuradio-examples/c++/hier/Makefile.am
   
gnuradio/branches/developers/jcorgan/hier/gnuradio-examples/c++/hier/dialtone.cc
   
gnuradio/branches/developers/jcorgan/hier/gnuradio-examples/c++/hier/dialtone.h
   gnuradio/branches/developers/jcorgan/hier/gnuradio-examples/c++/hier/main.cc
   gnuradio/branches/developers/jcorgan/hier/gnuradio-examples/c++/hier/sink.cc
   gnuradio/branches/developers/jcorgan/hier/gnuradio-examples/c++/hier/sink.h
   
gnuradio/branches/developers/jcorgan/hier/gnuradio-examples/c++/hier/source.cc
   gnuradio/branches/developers/jcorgan/hier/gnuradio-examples/c++/hier/source.h
Modified:
   gnuradio/branches/developers/jcorgan/hier/config/grc_gnuradio_examples.m4
   
gnuradio/branches/developers/jcorgan/hier/gnuradio-core/src/lib/runtime/gr_hier_block2.cc
   
gnuradio/branches/developers/jcorgan/hier/gnuradio-core/src/lib/runtime/gr_hier_block2.h
   
gnuradio/branches/developers/jcorgan/hier/gnuradio-core/src/lib/runtime/gr_hier_block2_detail.cc
   
gnuradio/branches/developers/jcorgan/hier/gnuradio-core/src/lib/runtime/gr_hier_block2_detail.h
   
gnuradio/branches/developers/jcorgan/hier/gnuradio-core/src/lib/runtime/gr_runtime.cc
   
gnuradio/branches/developers/jcorgan/hier/gnuradio-core/src/lib/runtime/gr_runtime_impl.cc
   
gnuradio/branches/developers/jcorgan/hier/gnuradio-core/src/lib/runtime/gr_runtime_impl.h
   
gnuradio/branches/developers/jcorgan/hier/gnuradio-core/src/lib/runtime/gr_runtime_types.h
   
gnuradio/branches/developers/jcorgan/hier/gnuradio-core/src/lib/runtime/gr_simple_flowgraph.h
   gnuradio/branches/developers/jcorgan/hier/gnuradio-examples/c++/Makefile.am
Log:
Work in progress.

Modified: 
gnuradio/branches/developers/jcorgan/hier/config/grc_gnuradio_examples.m4
===================================================================
--- gnuradio/branches/developers/jcorgan/hier/config/grc_gnuradio_examples.m4   
2006-11-21 23:12:42 UTC (rev 4013)
+++ gnuradio/branches/developers/jcorgan/hier/config/grc_gnuradio_examples.m4   
2006-11-22 07:13:47 UTC (rev 4014)
@@ -24,6 +24,7 @@
         gnuradio-examples/Makefile \
        gnuradio-examples/c++/Makefile \
        gnuradio-examples/c++/dialtone/Makefile \
+       gnuradio-examples/c++/hier/Makefile \
        gnuradio-examples/c++/usrp_wfm_rcv/Makefile \
         gnuradio-examples/python/Makefile \
         gnuradio-examples/python/apps/hf_explorer/Makefile \

Modified: 
gnuradio/branches/developers/jcorgan/hier/gnuradio-core/src/lib/runtime/gr_hier_block2.cc
===================================================================
--- 
gnuradio/branches/developers/jcorgan/hier/gnuradio-core/src/lib/runtime/gr_hier_block2.cc
   2006-11-21 23:12:42 UTC (rev 4013)
+++ 
gnuradio/branches/developers/jcorgan/hier/gnuradio-core/src/lib/runtime/gr_hier_block2.cc
   2006-11-22 07:13:47 UTC (rev 4014)
@@ -63,3 +63,9 @@
 {
     d_detail->connect(src_name, src_port, dst_name, dst_port);
 }
+
+gr_simple_flowgraph_sptr
+gr_hier_block2::flatten(const std::string &prefix)
+{
+    return d_detail->flatten(prefix);
+}

Modified: 
gnuradio/branches/developers/jcorgan/hier/gnuradio-core/src/lib/runtime/gr_hier_block2.h
===================================================================
--- 
gnuradio/branches/developers/jcorgan/hier/gnuradio-core/src/lib/runtime/gr_hier_block2.h
    2006-11-21 23:12:42 UTC (rev 4013)
+++ 
gnuradio/branches/developers/jcorgan/hier/gnuradio-core/src/lib/runtime/gr_hier_block2.h
    2006-11-22 07:13:47 UTC (rev 4014)
@@ -59,6 +59,7 @@
     void define_component(const std::string &name, gr_basic_block_sptr 
basic_block);
     void connect(const std::string &src_name, int src_port, 
                  const std::string &dst_name, int dst_port);
+    gr_simple_flowgraph_sptr flatten(const std::string &prefix = "");
 };
 
 #endif /* INCLUDED_GR_HIER_BLOCK2_H */

Modified: 
gnuradio/branches/developers/jcorgan/hier/gnuradio-core/src/lib/runtime/gr_hier_block2_detail.cc
===================================================================
--- 
gnuradio/branches/developers/jcorgan/hier/gnuradio-core/src/lib/runtime/gr_hier_block2_detail.cc
    2006-11-21 23:12:42 UTC (rev 4013)
+++ 
gnuradio/branches/developers/jcorgan/hier/gnuradio-core/src/lib/runtime/gr_hier_block2_detail.cc
    2006-11-22 07:13:47 UTC (rev 4014)
@@ -26,6 +26,7 @@
 #define GR_HIER_BLOCK2_DETAIL_DEBUG 1
 
 #include <gr_hier_block2_detail.h>
+#include <gr_simple_flowgraph.h>
 #include <gr_io_signature.h>
 #include <stdexcept>
 #include <iostream>
@@ -115,11 +116,9 @@
 
     // Check endpoint types match
     check_type_match(src_io_signature, src_port,
-                            dst_io_signature, dst_port);
+                    dst_io_signature, dst_port);
 
-    gr_connection connection(gr_endpoint(src_name, src_port), 
-                             gr_endpoint(dst_name, dst_port));
-    d_connections.push_back(connection);
+    d_edges.push_back(gr_make_edge(src_name, src_port, dst_name, dst_port));
 }
 
 void 
@@ -135,12 +134,9 @@
 void 
 gr_hier_block2_detail::check_dst_not_used(const std::string name, int port)
 {
-    for (gr_connection_viter_t p = d_connections.begin();
-        p != d_connections.end(); p++) {
-
-       if (p->dst().name() == name && p->dst().port() == port)
+    for (gr_edge_viter_t p = d_edges.begin(); p != d_edges.end(); p++)
+       if ((*p)->dst_name() == name && (*p)->dst_port() == port)
            throw std::invalid_argument("destination port in use");
-    }
 }
 
 void 
@@ -151,3 +147,10 @@
         dst_sig->sizeof_stream_item(dst_port))
        throw std::invalid_argument("type mismatch");
 }
+
+gr_simple_flowgraph_sptr
+gr_hier_block2_detail::flatten(const std::string &prefix)
+{
+    gr_simple_flowgraph_sptr result = gr_make_simple_flowgraph();
+    return result;
+}

Modified: 
gnuradio/branches/developers/jcorgan/hier/gnuradio-core/src/lib/runtime/gr_hier_block2_detail.h
===================================================================
--- 
gnuradio/branches/developers/jcorgan/hier/gnuradio-core/src/lib/runtime/gr_hier_block2_detail.h
     2006-11-21 23:12:42 UTC (rev 4013)
+++ 
gnuradio/branches/developers/jcorgan/hier/gnuradio-core/src/lib/runtime/gr_hier_block2_detail.h
     2006-11-22 07:13:47 UTC (rev 4014)
@@ -22,6 +22,7 @@
 #define INCLUDED_GR_HIER_BLOCK2_DETAIL_H
 
 #include <gr_hier_block2.h>
+#include <gr_simple_flowgraph_detail.h>
 #include <boost/utility.hpp>
 
 class gr_hier_component
@@ -41,37 +42,6 @@
 typedef std::vector<gr_hier_component> gr_hier_component_vector_t;
 typedef std::vector<gr_hier_component>::iterator gr_hier_component_viter_t;
 
-class gr_endpoint
-{
-private:
-    std::string d_name;
-    int         d_port;
-
-public:
-    gr_endpoint(const std::string &name, int port)
-      : d_name(name), d_port(port) {}
-
-    std::string name() const { return d_name; }
-    int port() const { return d_port; }
-};
-
-class gr_connection
-{
-private:
-    gr_endpoint d_src;
-    gr_endpoint d_dst;
-    
-public:
-    gr_connection(gr_endpoint src, gr_endpoint dst)
-      : d_src(src), d_dst(dst) {}
-
-    gr_endpoint src() const { return d_src; }
-    gr_endpoint dst() const { return d_dst; }
-};
-
-typedef std::vector<gr_connection> gr_connection_vector_t;
-typedef std::vector<gr_connection>::iterator gr_connection_viter_t;
-
 class gr_hier_block2_detail : boost::noncopyable
 {
 private:
@@ -83,7 +53,7 @@
     // Private implementation data
     gr_hier_block2 *d_owner;
     gr_hier_component_vector_t d_components;
-    gr_connection_vector_t d_connections;
+    gr_edge_vector_t d_edges;
         
     // Private implementation methods
     void define_component(const std::string &name, gr_basic_block_sptr block);
@@ -96,7 +66,9 @@
     void check_dst_not_used(const std::string name, int port);
     void check_type_match(gr_io_signature_sptr src_sig, int src_port,
                          gr_io_signature_sptr dst_sig, int dst_port);
-                                                
+
+    gr_simple_flowgraph_sptr flatten(const std::string &prefix = "");
+                                                    
 public:
     ~gr_hier_block2_detail();
 };

Modified: 
gnuradio/branches/developers/jcorgan/hier/gnuradio-core/src/lib/runtime/gr_runtime.cc
===================================================================
--- 
gnuradio/branches/developers/jcorgan/hier/gnuradio-core/src/lib/runtime/gr_runtime.cc
       2006-11-21 23:12:42 UTC (rev 4013)
+++ 
gnuradio/branches/developers/jcorgan/hier/gnuradio-core/src/lib/runtime/gr_runtime.cc
       2006-11-22 07:13:47 UTC (rev 4014)
@@ -26,7 +26,7 @@
 
 #include <gr_runtime.h>
 #include <gr_runtime_impl.h>
-#include <iostream.h>
+#include <iostream>
 
 gr_runtime_sptr 
 gr_make_runtime(gr_hier_block2_sptr top_block)

Modified: 
gnuradio/branches/developers/jcorgan/hier/gnuradio-core/src/lib/runtime/gr_runtime_impl.cc
===================================================================
--- 
gnuradio/branches/developers/jcorgan/hier/gnuradio-core/src/lib/runtime/gr_runtime_impl.cc
  2006-11-21 23:12:42 UTC (rev 4013)
+++ 
gnuradio/branches/developers/jcorgan/hier/gnuradio-core/src/lib/runtime/gr_runtime_impl.cc
  2006-11-22 07:13:47 UTC (rev 4014)
@@ -51,6 +51,8 @@
        throw std::runtime_error("already running");
     else
        d_running = true;
+
+    d_sfg = d_top_block->flatten();
 }
 
 void 

Modified: 
gnuradio/branches/developers/jcorgan/hier/gnuradio-core/src/lib/runtime/gr_runtime_impl.h
===================================================================
--- 
gnuradio/branches/developers/jcorgan/hier/gnuradio-core/src/lib/runtime/gr_runtime_impl.h
   2006-11-21 23:12:42 UTC (rev 4013)
+++ 
gnuradio/branches/developers/jcorgan/hier/gnuradio-core/src/lib/runtime/gr_runtime_impl.h
   2006-11-22 07:13:47 UTC (rev 4014)
@@ -33,7 +33,8 @@
     
     bool d_running;
     gr_hier_block2_sptr d_top_block;
-
+    gr_simple_flowgraph_sptr d_sfg;
+    
     void start();
     void stop();
     void wait();

Modified: 
gnuradio/branches/developers/jcorgan/hier/gnuradio-core/src/lib/runtime/gr_runtime_types.h
===================================================================
--- 
gnuradio/branches/developers/jcorgan/hier/gnuradio-core/src/lib/runtime/gr_runtime_types.h
  2006-11-21 23:12:42 UTC (rev 4013)
+++ 
gnuradio/branches/developers/jcorgan/hier/gnuradio-core/src/lib/runtime/gr_runtime_types.h
  2006-11-22 07:13:47 UTC (rev 4014)
@@ -36,6 +36,7 @@
 class gr_io_signature;
 class gr_buffer;
 class gr_buffer_reader;
+class gr_simple_flowgraph;
 class gr_runtime;
 
 typedef boost::shared_ptr<gr_basic_block>      gr_basic_block_sptr;
@@ -46,5 +47,6 @@
 typedef boost::shared_ptr<gr_buffer>           gr_buffer_sptr;
 typedef boost::shared_ptr<gr_buffer_reader>    gr_buffer_reader_sptr;
 typedef boost::shared_ptr<gr_runtime>          gr_runtime_sptr;
+typedef boost::shared_ptr<gr_simple_flowgraph>  gr_simple_flowgraph_sptr;
 
 #endif /* INCLUDED_GR_RUNTIME_TYPES_H */

Modified: 
gnuradio/branches/developers/jcorgan/hier/gnuradio-core/src/lib/runtime/gr_simple_flowgraph.h
===================================================================
--- 
gnuradio/branches/developers/jcorgan/hier/gnuradio-core/src/lib/runtime/gr_simple_flowgraph.h
       2006-11-21 23:12:42 UTC (rev 4013)
+++ 
gnuradio/branches/developers/jcorgan/hier/gnuradio-core/src/lib/runtime/gr_simple_flowgraph.h
       2006-11-22 07:13:47 UTC (rev 4014)
@@ -27,8 +27,6 @@
 #include <boost/shared_ptr.hpp>
 #include <string>
 
-class gr_simple_flowgraph;
-typedef boost::shared_ptr<gr_simple_flowgraph> gr_simple_flowgraph_sptr;
 gr_simple_flowgraph_sptr gr_make_simple_flowgraph();
 
 class gr_simple_flowgraph_detail;

Modified: 
gnuradio/branches/developers/jcorgan/hier/gnuradio-examples/c++/Makefile.am
===================================================================
--- gnuradio/branches/developers/jcorgan/hier/gnuradio-examples/c++/Makefile.am 
2006-11-21 23:12:42 UTC (rev 4013)
+++ gnuradio/branches/developers/jcorgan/hier/gnuradio-examples/c++/Makefile.am 
2006-11-22 07:13:47 UTC (rev 4014)
@@ -23,5 +23,6 @@
 
 SUBDIRS = \
     dialtone \
+    hier \
     usrp_wfm_rcv
 


Property changes on: 
gnuradio/branches/developers/jcorgan/hier/gnuradio-examples/c++/hier
___________________________________________________________________
Name: svn:ignore
   + Makefile
Makefile.in
dialtone
.libs
.deps
valg*



Added: 
gnuradio/branches/developers/jcorgan/hier/gnuradio-examples/c++/hier/Makefile.am
===================================================================
--- 
gnuradio/branches/developers/jcorgan/hier/gnuradio-examples/c++/hier/Makefile.am
                            (rev 0)
+++ 
gnuradio/branches/developers/jcorgan/hier/gnuradio-examples/c++/hier/Makefile.am
    2006-11-22 07:13:47 UTC (rev 4014)
@@ -0,0 +1,51 @@
+#
+# 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 2, 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
+
+# For compiling within the GNU Radio build tree
+INCLUDES=$(STD_DEFINES_AND_INCLUDES) \
+         -I$(top_srcdir)/gr-audio-alsa/src 
+
+GR_AUDIO_ALSA_LIBS=$(top_builddir)/gr-audio-alsa/src/libgr_audio_alsa.la
+
+# For compiling outside the tree, these are the usual
+# INCLUDES = -I/usr/local/include -I/usr/local/include/gnuradio
+# GNURADIO_CORE_LIBS = -lgnuradio-core
+# GR_AUDIO_ALSA_LIBS = -lgr_audio_alsa
+
+noinst_PROGRAMS = dialtone
+    
+noinst_HEADERS = \
+    dialtone.h \
+    sink.h
+        
+dialtone_SOURCES = \
+    dialtone.cc           \
+    source.cc \
+    sink.cc \
+    main.cc
+
+dialtone_LDADD = \
+    $(GNURADIO_CORE_LIBS) \
+    $(GR_AUDIO_ALSA_LIBS)
+
+MOSTLYCLEANFILES = *~

Added: 
gnuradio/branches/developers/jcorgan/hier/gnuradio-examples/c++/hier/dialtone.cc
===================================================================
--- 
gnuradio/branches/developers/jcorgan/hier/gnuradio-examples/c++/hier/dialtone.cc
                            (rev 0)
+++ 
gnuradio/branches/developers/jcorgan/hier/gnuradio-examples/c++/hier/dialtone.cc
    2006-11-22 07:13:47 UTC (rev 4014)
@@ -0,0 +1,48 @@
+/*
+ * 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 2, 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 <dialtone.h>
+#include <gr_io_signature.h>
+#include <source.h>
+#include <gr_nop.h>
+#include <sink.h>
+
+// Shared pointer constructor
+dialtone_sptr make_dialtone()
+{
+    return dialtone_sptr(new dialtone());
+}
+
+// Hierarchical block constructor, with no inputs or outputs
+dialtone::dialtone() : 
+gr_hier_block2("dialtone",
+              gr_make_io_signature(0,0,0),
+              gr_make_io_signature(0,0,0))
+{
+    define_component("source", make_source());
+    define_component("filter", gr_make_nop(sizeof(float)));
+    define_component("sink", make_sink());
+
+    connect("source", 0, "filter", 0);
+    connect("source", 1, "filter", 1);
+    connect("filter", 0, "sink",   0);
+    connect("filter", 1, "sink",   1);
+}


Property changes on: 
gnuradio/branches/developers/jcorgan/hier/gnuradio-examples/c++/hier/dialtone.cc
___________________________________________________________________
Name: svn:eol-style
   + native

Added: 
gnuradio/branches/developers/jcorgan/hier/gnuradio-examples/c++/hier/dialtone.h
===================================================================
--- 
gnuradio/branches/developers/jcorgan/hier/gnuradio-examples/c++/hier/dialtone.h 
                            (rev 0)
+++ 
gnuradio/branches/developers/jcorgan/hier/gnuradio-examples/c++/hier/dialtone.h 
    2006-11-22 07:13:47 UTC (rev 4014)
@@ -0,0 +1,33 @@
+/*
+ * 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 2, 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 <gr_hier_block2.h>
+
+class dialtone;
+typedef boost::shared_ptr<dialtone> dialtone_sptr;
+dialtone_sptr make_dialtone();
+
+class dialtone : public gr_hier_block2
+{
+private:
+    dialtone();
+    friend dialtone_sptr make_dialtone();
+};


Property changes on: 
gnuradio/branches/developers/jcorgan/hier/gnuradio-examples/c++/hier/dialtone.h
___________________________________________________________________
Name: svn:eol-style
   + native

Added: 
gnuradio/branches/developers/jcorgan/hier/gnuradio-examples/c++/hier/main.cc
===================================================================
--- 
gnuradio/branches/developers/jcorgan/hier/gnuradio-examples/c++/hier/main.cc    
                            (rev 0)
+++ 
gnuradio/branches/developers/jcorgan/hier/gnuradio-examples/c++/hier/main.cc    
    2006-11-22 07:13:47 UTC (rev 4014)
@@ -0,0 +1,38 @@
+/*
+ * 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 2, 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.
+ */
+
+// GNU Radio C++ application
+//
+// Instantiate a top block
+// Instantiate a runtime, passing it the top block
+// Tell the runtime to go...
+
+#include <dialtone.h>
+#include <gr_runtime.h>
+
+int main()
+{
+    dialtone_sptr top_block = make_dialtone();
+    gr_runtime_sptr runtime = gr_make_runtime(top_block);
+
+    runtime->run();   
+    return 0;
+}


Property changes on: 
gnuradio/branches/developers/jcorgan/hier/gnuradio-examples/c++/hier/main.cc
___________________________________________________________________
Name: svn:eol-style
   + native

Added: 
gnuradio/branches/developers/jcorgan/hier/gnuradio-examples/c++/hier/sink.cc
===================================================================
--- 
gnuradio/branches/developers/jcorgan/hier/gnuradio-examples/c++/hier/sink.cc    
                            (rev 0)
+++ 
gnuradio/branches/developers/jcorgan/hier/gnuradio-examples/c++/hier/sink.cc    
    2006-11-22 07:13:47 UTC (rev 4014)
@@ -0,0 +1,45 @@
+/*
+ * 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 2, 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 <sink.h>
+#include <gr_io_signature.h>
+#include <gr_nop.h>
+#include <audio_alsa_sink.h>
+
+// Shared pointer constructor
+sink_sptr make_sink()
+{
+    return sink_sptr(new sink());
+}
+
+sink::sink() : 
+gr_hier_block2("sink",
+              gr_make_io_signature(2,2,sizeof(float)),
+              gr_make_io_signature(0,0,0))
+{
+    define_component("nop", gr_make_nop(sizeof(float)));
+    define_component("audio", audio_alsa_make_sink(48000));
+
+    connect("self", 0, "nop",   0);
+    connect("self", 1, "nop",   1);
+    connect("nop",  0, "audio", 0);
+    connect("nop",  1, "audio", 1);    
+}


Property changes on: 
gnuradio/branches/developers/jcorgan/hier/gnuradio-examples/c++/hier/sink.cc
___________________________________________________________________
Name: svn:eol-style
   + native

Added: 
gnuradio/branches/developers/jcorgan/hier/gnuradio-examples/c++/hier/sink.h
===================================================================
--- gnuradio/branches/developers/jcorgan/hier/gnuradio-examples/c++/hier/sink.h 
                        (rev 0)
+++ gnuradio/branches/developers/jcorgan/hier/gnuradio-examples/c++/hier/sink.h 
2006-11-22 07:13:47 UTC (rev 4014)
@@ -0,0 +1,33 @@
+/*
+ * 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 2, 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 <gr_hier_block2.h>
+
+class sink;
+typedef boost::shared_ptr<sink> sink_sptr;
+sink_sptr make_sink();
+
+class sink : public gr_hier_block2
+{
+private:
+    sink();
+    friend sink_sptr make_sink();
+};


Property changes on: 
gnuradio/branches/developers/jcorgan/hier/gnuradio-examples/c++/hier/sink.h
___________________________________________________________________
Name: svn:eol-style
   + native

Added: 
gnuradio/branches/developers/jcorgan/hier/gnuradio-examples/c++/hier/source.cc
===================================================================
--- 
gnuradio/branches/developers/jcorgan/hier/gnuradio-examples/c++/hier/source.cc  
                            (rev 0)
+++ 
gnuradio/branches/developers/jcorgan/hier/gnuradio-examples/c++/hier/source.cc  
    2006-11-22 07:13:47 UTC (rev 4014)
@@ -0,0 +1,46 @@
+/*
+ * 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 2, 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 <source.h>
+#include <gr_io_signature.h>
+#include <gr_sig_source_f.h>
+#include <gr_nop.h>
+
+// Shared pointer constructor
+source_sptr make_source()
+{
+    return source_sptr(new source());
+}
+
+source::source() : 
+gr_hier_block2("source",
+              gr_make_io_signature(0,0,0),
+              gr_make_io_signature(2,2,sizeof(float)))
+{
+    define_component("src0", gr_make_sig_source_f(48000, GR_SIN_WAVE, 350, 
0.5));
+    define_component("src1", gr_make_sig_source_f(48000, GR_SIN_WAVE, 440, 
0.5));
+    define_component("nop", gr_make_nop(sizeof(float)));
+
+    connect("src0", 0, "nop", 0);
+    connect("src1", 0, "nop", 1);
+    connect("nop", 0, "self", 0);
+    connect("nop", 1, "self", 1);
+}


Property changes on: 
gnuradio/branches/developers/jcorgan/hier/gnuradio-examples/c++/hier/source.cc
___________________________________________________________________
Name: svn:eol-style
   + native

Added: 
gnuradio/branches/developers/jcorgan/hier/gnuradio-examples/c++/hier/source.h
===================================================================
--- 
gnuradio/branches/developers/jcorgan/hier/gnuradio-examples/c++/hier/source.h   
                            (rev 0)
+++ 
gnuradio/branches/developers/jcorgan/hier/gnuradio-examples/c++/hier/source.h   
    2006-11-22 07:13:47 UTC (rev 4014)
@@ -0,0 +1,33 @@
+/*
+ * 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 2, 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 <gr_hier_block2.h>
+
+class source;
+typedef boost::shared_ptr<source> source_sptr;
+source_sptr make_source();
+
+class source : public gr_hier_block2
+{
+private:
+    source();
+    friend source_sptr make_source();
+};


Property changes on: 
gnuradio/branches/developers/jcorgan/hier/gnuradio-examples/c++/hier/source.h
___________________________________________________________________
Name: svn:eol-style
   + native





reply via email to

[Prev in Thread] Current Thread [Next in Thread]