Skip to content

ENH: Added "force end Routine" option for Sound Component#6766

Merged
TEParsons merged 9 commits intopsychopy:devfrom
TEParsons:dev-enh-sound-force-end
Aug 13, 2024
Merged

ENH: Added "force end Routine" option for Sound Component#6766
TEParsons merged 9 commits intopsychopy:devfrom
TEParsons:dev-enh-sound-force-end

Conversation

@TEParsons
Copy link
Copy Markdown
Contributor

Required a rewrite of the "stop" logic on the JS end to imitate isPlaying/isFinished until they're implemented in actual PsychoJS, as we need to know when the sound itself has finished if we're to end the Routine on the basis of it, but I've tested a few use cases out and it seems consistent with before.

@TEParsons
Copy link
Copy Markdown
Contributor Author

@mh105 would appreciate if you could give this a go and sanity check, having recently worked on the Sound Component :)

Copy link
Copy Markdown
Contributor

@mh105 mh105 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! I'm glad this Force End Routine option is added for Sound Component.

I have two minor suggested changes. To make it easier to see what I meant and to accept the changes, I've made a PR to your TEParsons:dev-enh-sound-force-end branch. If you think they are acceptable, you can just merge and then merge this current PR.

hint=msg,
label=_translate("Sync start with screen"))
# --- Playback params ---
self.order += [
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

self.order isn't created concisely with all the correct parameters. We should fix it. See my PR to your branch.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally I prefer the approach of doing += for each section, as it just makes it less of a monolith to maintain. e.g. if I add one param to Playback, I only have to think of it in relation to the params on the same page as it, rather than a block of all params at the top. This is just stylistic preference though, works the same either way :)

@codecov
Copy link
Copy Markdown

codecov bot commented Aug 13, 2024

Codecov Report

Attention: Patch coverage is 84.00000% with 4 lines in your changes missing coverage. Please review.

Project coverage is 49.62%. Comparing base (47c14f7) to head (1a3ebe1).
Report is 85 commits behind head on dev.

Additional details and impacted files
@@            Coverage Diff             @@
##              dev    #6766      +/-   ##
==========================================
+ Coverage   49.60%   49.62%   +0.02%     
==========================================
  Files         332      332              
  Lines       61078    61191     +113     
==========================================
+ Hits        30297    30369      +72     
- Misses      30781    30822      +41     
Components Coverage Δ
app ∅ <ø> (∅)
boilerplate ∅ <ø> (∅)
library ∅ <ø> (∅)
vm-safe library ∅ <ø> (∅)

@TEParsons TEParsons merged commit c4d2afb into psychopy:dev Aug 13, 2024
@TEParsons TEParsons deleted the dev-enh-sound-force-end branch August 14, 2024 15:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants