diff options
Diffstat (limited to 'gr-analog')
-rw-r--r-- | gr-analog/lib/fastnoise_source_X_impl.cc.t | 18 | ||||
-rw-r--r-- | gr-analog/lib/fastnoise_source_X_impl.h.t | 4 | ||||
-rw-r--r-- | gr-analog/lib/noise_source_X_impl.cc.t | 16 | ||||
-rw-r--r-- | gr-analog/lib/noise_source_X_impl.h.t | 4 | ||||
-rw-r--r-- | gr-analog/python/standard_squelch.py | 2 |
5 files changed, 39 insertions, 5 deletions
diff --git a/gr-analog/lib/fastnoise_source_X_impl.cc.t b/gr-analog/lib/fastnoise_source_X_impl.cc.t index f33e7afa39..25ad8073aa 100644 --- a/gr-analog/lib/fastnoise_source_X_impl.cc.t +++ b/gr-analog/lib/fastnoise_source_X_impl.cc.t @@ -57,6 +57,22 @@ namespace gr { } void + @IMPL_NAME@::set_type(noise_type_t type) + { + gruel::scoped_lock l(d_setlock); + d_type = type; + generate(); + } + + void + @IMPL_NAME@::set_amplitude(float ampl) + { + gruel::scoped_lock l(d_setlock); + d_ampl = ampl; + generate(); + } + + void @IMPL_NAME@::generate() { int noutput_items = d_samples.size(); @@ -107,6 +123,8 @@ namespace gr { gr_vector_const_void_star &input_items, gr_vector_void_star &output_items) { + gruel::scoped_lock l(d_setlock); + @TYPE@ *out = (@TYPE@*)output_items[0]; for(int i=0; i<noutput_items; i++) { diff --git a/gr-analog/lib/fastnoise_source_X_impl.h.t b/gr-analog/lib/fastnoise_source_X_impl.h.t index 7a0f792683..3c5dc106a2 100644 --- a/gr-analog/lib/fastnoise_source_X_impl.h.t +++ b/gr-analog/lib/fastnoise_source_X_impl.h.t @@ -43,8 +43,8 @@ namespace gr { @IMPL_NAME@(noise_type_t type, float ampl, long seed, long samples); ~@IMPL_NAME@(); - void set_type(noise_type_t type) { d_type = type; generate(); } - void set_amplitude(float ampl) { d_ampl = ampl; generate(); } + void set_type(noise_type_t type); + void set_amplitude(float ampl); void generate(); noise_type_t type() const { return d_type; } diff --git a/gr-analog/lib/noise_source_X_impl.cc.t b/gr-analog/lib/noise_source_X_impl.cc.t index 35dda9c5d4..40e2517d2e 100644 --- a/gr-analog/lib/noise_source_X_impl.cc.t +++ b/gr-analog/lib/noise_source_X_impl.cc.t @@ -54,11 +54,27 @@ namespace gr { { } + void + @IMPL_NAME@::set_type(noise_type_t type) + { + gruel::scoped_lock l(d_setlock); + d_type = type; + } + + void + @IMPL_NAME@::set_amplitude(float ampl) + { + gruel::scoped_lock l(d_setlock); + d_ampl = ampl; + } + int @IMPL_NAME@::work(int noutput_items, gr_vector_const_void_star &input_items, gr_vector_void_star &output_items) { + gruel::scoped_lock l(d_setlock); + @TYPE@ *out = (@TYPE@*)output_items[0]; switch(d_type) { diff --git a/gr-analog/lib/noise_source_X_impl.h.t b/gr-analog/lib/noise_source_X_impl.h.t index 8bcc1dfde3..3a0e8d6d7c 100644 --- a/gr-analog/lib/noise_source_X_impl.h.t +++ b/gr-analog/lib/noise_source_X_impl.h.t @@ -41,8 +41,8 @@ namespace gr { @IMPL_NAME@(noise_type_t type, float ampl, long seed = 0); ~@IMPL_NAME@(); - void set_type(noise_type_t type) { d_type = type; } - void set_amplitude(float ampl) { d_ampl = ampl; } + void set_type(noise_type_t type); + void set_amplitude(float ampl); noise_type_t type() const { return d_type; } float amplitude() const { return d_ampl; } diff --git a/gr-analog/python/standard_squelch.py b/gr-analog/python/standard_squelch.py index c1fa406b48..3ed9ebceaa 100644 --- a/gr-analog/python/standard_squelch.py +++ b/gr-analog/python/standard_squelch.py @@ -42,7 +42,7 @@ class standard_squelch(gr.hier_block2): self.sub = blocks.sub_ff(); self.add = blocks.add_ff(); - self.gate = gr.threshold_ff(0.3,0.43,0) + self.gate = blocks.threshold_ff(0.3,0.43,0) self.squelch_lpf = filter.single_pole_iir_filter_ff(1/(0.01*audio_rate)) self.div = blocks.divide_ff() |