I realized I had flagged that message but forgot to reply...
I have a patch that I want to do some things based on a stopwatch
(several, actually) with the stopwatch controls exposed all the way
up so I can grab them from the QCView.
The first problem that I had was when I would disable the sub-patch
that was pulling on the stop watch, the stop watch would
effectively stop running and ignore my inputs.
That's normal behavior: patches in QC only run when another patch
pull data from them
The second problem that I have is that I can only seem to make the
stop watch obey its stop and reset function from the Quartz
Composer GUI. In fact, if I tie _anything_ to the stop watch start/
stop/reset controls, the stop watch ceases to respond to those
inputs. I have only been able to successfully stop and reset the
stop watch directly by accessing the information panel for the
stopwatch in composer itself.
In particular, the following code does as the comments suggest:
[m_display setValue:[NSNumber numberWithBool: YES]
forInputKey:@"start_sphere_timer"];
// starts the timer
[m_display setValue:[NSNumber numberWithBool: YES]
forInputKey:@"start_sphere_timer"];
// stops the timer
[ m_display setValue:[NSNumber numberWithBool: YES]
forInputKey:@"reset_sphere_timer"];
// if the time is running, this seems to stop it from
advancing; if the timer is not runing this seems to be a no-op
[ m_display setValue:[NSNumber numberWithBool: NO]
forInputKey:@"reset_sphere_timer"];
// if the time is running, putting this back lets it
advance from its current point; if the timer is not runing this
seems to be a no-op
In fact, from the UI in the Quartz Composer app just lowering and
rasing the Start flag will cause the stopwatch to reset from 00:00.
This is not the case when I try to use the patch programatically,
or if I have anything wired to the Start input on the Stopwatch patch.
That's because the Stop Watch inputs are "signal" inputs that watch
for values to go from False to True. So to trigger one of those
inputs, you need to:
- set them to False
- render at least one frame
- set them to True
- render at least one frame
- ...