diff options
author | jcorgan | 2007-04-28 02:20:28 +0000 |
---|---|---|
committer | jcorgan | 2007-04-28 02:20:28 +0000 |
commit | b26ea69676c09f5366a9e2f33b11ae5a7521ffe5 (patch) | |
tree | 0641c1c25d6e827f70941e07f4611d0a2b6b83cd /gnuradio-examples/python/hier/networking/audio_source.py | |
parent | 00696b9f754338de9362932c1ecfb1e144a38786 (diff) | |
download | gnuradio-b26ea69676c09f5366a9e2f33b11ae5a7521ffe5.tar.gz gnuradio-b26ea69676c09f5366a9e2f33b11ae5a7521ffe5.tar.bz2 gnuradio-b26ea69676c09f5366a9e2f33b11ae5a7521ffe5.zip |
Merged -r 5137:5174 from developer branch jcorgan/hb. Trunk passes distcheck. Converts gr.hier_block2 API to not use 'define_component' methodology anymore.
git-svn-id: http://gnuradio.org/svn/gnuradio/trunk@5177 221aa14e-8319-0410-a670-987f0aec2ac5
Diffstat (limited to 'gnuradio-examples/python/hier/networking/audio_source.py')
-rwxr-xr-x | gnuradio-examples/python/hier/networking/audio_source.py | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/gnuradio-examples/python/hier/networking/audio_source.py b/gnuradio-examples/python/hier/networking/audio_source.py index 24186895a..168e1cba9 100755 --- a/gnuradio-examples/python/hier/networking/audio_source.py +++ b/gnuradio-examples/python/hier/networking/audio_source.py @@ -1,6 +1,6 @@ #!/usr/bin/env python # -# Copyright 2006 Free Software Foundation, Inc. +# Copyright 2006,2007 Free Software Foundation, Inc. # # This file is part of GNU Radio # @@ -24,16 +24,12 @@ from gnuradio import gr, audio from gnuradio.eng_option import eng_option from optparse import OptionParser -class audio_source(gr.hier_block2): +class audio_source(gr.top_block): def __init__(self, src, dst, port, pkt_size, sample_rate): - gr.hier_block2.__init__(self, - "audio_source", # Block type - gr.io_signature(0,0,0), # Input signature - gr.io_signature(0,0,0)) # Output signature - - self.define_component("src", audio.source(sample_rate)) - self.define_component("dst", gr.udp_sink(gr.sizeof_float, src, 0, dst, port, pkt_size)) - self.connect("src", 0, "dst", 0) + gr.top_block.__init__(self, "audio_source") + self.audio = audio.source(sample_rate) + self.sink = gr.udp_sink(gr.sizeof_float, src, 0, dst, port, pkt_size) + self.connect(self.audio, self.sink) if __name__ == '__main__': parser = OptionParser(option_class=eng_option) |