Commit Graph
7 Commits
Author SHA1 Message Date
Jon BenistonandClaude Opus 5 d7bc4a94e4 TestSource: period and duty cycle for the P1 and P2 patterns
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>
2026-09-11 19:42:07 +01:00
f4exb b6c4d10b62 Rewriting of copyright notices for plugins/samplesource. Part of #1893 2023-11-18 10:07:41 +01:00
Jon Beniston 32a2d202fd Set timer to be precise before calling start, otherwise it is ignored on Windows 2023-03-08 16:35:30 +00:00
Jiří Pinkava 0df2d75e6d Replace deprecated QMutex(Recursive) with QRecursiveMutex 2022-09-17 23:00:07 +02:00
Kacper Michajłow 1e5ae8ea0f Define _USE_MATH_DEFINES and clean M_PI redefinitions 2020-11-04 23:05:41 +01:00
f4exb edb9defdf6 TestSource: moved timer start/stop to constructor/destructor. Fixes issue #661 2020-11-01 10:48:47 +01:00
f4exb b8681d59a9 TestSource: refactored Thread to Worker object moved to thread. Equivalent to FileInput changes 2020-07-12 02:39:29 +02:00