summaryrefslogtreecommitdiff
path: root/gr-blocks/lib/repeat_impl.cc
diff options
context:
space:
mode:
Diffstat (limited to 'gr-blocks/lib/repeat_impl.cc')
-rw-r--r--gr-blocks/lib/repeat_impl.cc20
1 files changed, 20 insertions, 0 deletions
diff --git a/gr-blocks/lib/repeat_impl.cc b/gr-blocks/lib/repeat_impl.cc
index 9c2ccc63c8..fb62265134 100644
--- a/gr-blocks/lib/repeat_impl.cc
+++ b/gr-blocks/lib/repeat_impl.cc
@@ -43,6 +43,26 @@ namespace gr {
d_itemsize(itemsize),
d_interp(interp)
{
+ message_port_register_in(pmt::mp("interpolation"));
+ set_msg_handler(pmt::mp("interpolation"),
+ boost::bind(&repeat_impl::msg_set_interpolation, this, _1));
+ }
+
+ void
+ repeat_impl::msg_set_interpolation(pmt::pmt_t msg)
+ {
+ // Dynamization by Kevin McQuiggin:
+ d_interp = pmt::to_long(pmt::cdr(msg));
+ sync_interpolator::set_interpolation(d_interp);
+ }
+ void
+ repeat_impl::set_interpolation(int interp)
+ {
+ // This ensures that interpolation is only changed between calls to work
+ // (and not in the middle of an ongoing work)
+ _post( pmt::mp("interpolation"), /* port */
+ pmt::cons(pmt::mp("interpolation"), pmt::from_long(interp)) /* pair */
+ );
}
int