Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PsyStimulus: differentiate between a scheduled state and a playing state and timed onset when playing and finishing #72

Open
maartenuni opened this issue Jan 24, 2024 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@maartenuni
Copy link
Contributor

Currently, when playing a stimulus the [[email protected]_started] and [[email protected]_finished] are called when the stimulus
is about to start. This actually reflects that the stimulus is scheduled by the the PsyAudioDevice or With the PsyCanvas, in case of PsyAuditoryStimulus and PsyVisualStimulus respectively.

So the psy_stimulus_set_is_started and psy_stimulus_set_is_finished are actually (at least they should), prior to the stimulus is actually playing, or stopping so it looks like:

stim_scheduled | ---------****************-------
stim_playing   | ------------**************------
               __ time -> ______________________

Hence, the terminology isn't perfect, perhaps it should be psy_stimulus_set_is_scheduled(True/False). The current set_is_playing could be complemented with a set_is_scheduled, from there we can add a PsyTimer function where we set a timeout on the time stimulus actually starts playing and we set the StimulusPrivate:playing to true. The timer can add an event to the Main MainContext when the timer expires, similarly when unscheduled a stimulus is unscheduled we can set a timer when we expect it to stop.

@maartenuni maartenuni added the enhancement New feature or request label Jan 24, 2024
@maartenuni maartenuni self-assigned this Jan 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant