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

Classlib: Put 'protect' in PauseStreams (update state on error) #5626

Merged
merged 2 commits into from
Jan 8, 2022

Conversation

jamshark70
Copy link
Contributor

Purpose and Motivation

Fixes #5597.

Pprotect is not sufficient to catch errors thrown while playing an event produced by a pattern. In this case, state variables had not been updated to reflect a PauseStream's new non-playing state.

Julian had the good idea to embed protect into the Routine being managed by a PauseStream (I hadn't thought of this!), but an earlier version didn't apply this consistently.

This version introduces it into PauseStream, Task, and EventStreamPlayer.

Types of changes

  • Bug fix

To-do list

  • Code is tested
  • All tests are passing
  • This PR is ready for review

Under #5623, Julian had proposed some test cases, and volunteered to turn those into formal unit tests. So this PR does not include unit tests directly, but they will follow.

@jamshark70 jamshark70 added bug Issues that relate to unexpected/unwanted behavior. Don't use for PRs. comp: class library SC class library labels Nov 28, 2021
*new { arg func, clock;
^super.new(Routine(func), clock)
var new = super.new(Routine({ |inval|
Copy link
Member

Choose a reason for hiding this comment

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

could you move the Routine in a new line?

@telephon
Copy link
Member

Thanks! I've tested your branch, all works well.
I've tried and remove all Pprotect covering in PatternProxy, which is possible now.
Once this is merged, I'll add these changes.

@dyfer
Copy link
Member

dyfer commented Dec 2, 2021

Thanks! Is this good to be merged, then?

@jamshark70
Copy link
Contributor Author

Is this good to be merged, then?

There's one pending formatting change, which I can do within an hour or so.

@jamshark70
Copy link
Contributor Author

OK, formatting change is done.

@telephon
Copy link
Member

telephon commented Jan 8, 2022

sorry @jamshark70, lost track of it – kooks good now! (feel free to ping me any time, I sometimes don't look at github for a while)

@telephon telephon merged commit 7214d6f into supercollider:develop Jan 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issues that relate to unexpected/unwanted behavior. Don't use for PRs. comp: class library SC class library
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Pdef errors inside stream need to .stop.clear to restart
3 participants