Generate a general_block. Copy the content of head_impl.cc 's work() method to the general_work method. don't forget the private variables from head.h and the initialization of those in the constructor. Replace the "return -1;" by "return 0" to make the block stop producing samples after it's done it's job; before the final "return n; " add a "consume_each(n);".
Best regards, Marcus On 11.05.2016 22:23, Richard Bell wrote: > I don't want the flowgraph to stop. I just want to store a set number > but leave the flowgraph running. > > On Wed, May 11, 2016 at 1:13 PM, Dan CaJacob <dan.caja...@gmail.com > <mailto:dan.caja...@gmail.com>> wrote: > > You can use a head block inline (already in core). > > On Wed, May 11, 2016 at 4:09 PM Richard Bell > <richard.be...@gmail.com <mailto:richard.be...@gmail.com>> wrote: > > Hello, > > I want to add an additional parameter to the existing file > sink block that lets the user tell it how many items to save > to file. This amounts to adding a few lines to the existing > file sink work function. > > What's the smartest way to do this? What I would do currently > is create a new block, copy and paste the existing file sink > code to my new block and add the few lines of code to change > it. Is there a smarter way? > > Rich > _______________________________________________ > Discuss-gnuradio mailing list > Discuss-gnuradio@gnu.org <mailto:Discuss-gnuradio@gnu.org> > https://lists.gnu.org/mailman/listinfo/discuss-gnuradio > > -- > Very Respectfully, > > Dan CaJacob > > > > > _______________________________________________ > Discuss-gnuradio mailing list > Discuss-gnuradio@gnu.org > https://lists.gnu.org/mailman/listinfo/discuss-gnuradio
_______________________________________________ Discuss-gnuradio mailing list Discuss-gnuradio@gnu.org https://lists.gnu.org/mailman/listinfo/discuss-gnuradio