The sawtooth and square patterns had a fixed 1000 sample pulse width. Both
now take a period, and the square pattern a duty cycle, from the GUI, a
preset or the web API, with the period shown in seconds beside the sample
count.
A period of zero divides by zero in the sawtooth and wraps the unsigned
sample counter in the square pattern, giving a cycle of four billion
samples, so it is refused at every entrance: a minimum of one on the spin
box, a clamp when an older or hand edited preset is read, a clamp on the
web API, and a clamp in the worker for anything that reaches it another
way. The duty cycle is held to 0 to 100 the same way.
Also fixes the worker's timer. It is now parented to the worker so that it
moves to the worker thread with it, and it runs between startWork and
stopWork rather than from construction. TestSourceInput::stop() runs in
another thread, and Qt will not stop a timer from one, so the stop is
asked of the worker and waited for. The m_running flag it replaces is
gone, along with the test of it in every tick.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>