|
From: | Marcus Müller |
Subject: | Re: [Discuss-gnuradio] Input Selector |
Date: | Mon, 25 Jul 2016 21:01:01 +0200 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.1.1 |
Hi Rich, sounds like a job for gr-eventstream[1] to only put in info when some event occured (i.e. when a message was sent to the eventstream block), and maybe gr-msgtools to convert the change in variable value from a "QT GUI Pushbutton" to a message, and a self-written (might be simple enough to do in Python) block that has a message input and a message output and, upon change, sends a event-stream-event-compatible message to the event stream source, containing the contents of the file. Then you'd write a mux and be done. To be completely honest, though it's a bit like re-inventing gr-eventstream, I'd probably just use the aforementioned pushbutton, convert its pushbutton variable change to a message using gr-msgtools' Variable To Message block to convert that to a variable, and write a quick C++ or python block that has a "passthrough" stream input, a "interject" message input, and a stream output. Whenever there's a "pressed" message, it would disrupt its normal activity of passing through the input, and change into a state of inserting samples from a file, till the complete file is read completely. Sounds like not-so-much code. Note that message handling happens asynchronous, ie. only *in
between* calls to work. So, always consider that handling a
message of this sorts has a worst-case latency of f_sample *
size_of_output buffer + Python/Qt overhead. Luckily, you can
restrict the output buffer size, or you could even intentionally
never produce too many samples at once. Best regards, Marcus On 25.07.2016 20:28, Richard Bell
wrote:
|
[Prev in Thread] | Current Thread | [Next in Thread] |