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

The method isRunning is added #6

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

prko
Copy link

@prko prko commented Mar 8, 2024

There is no way to know if the spectrogram is active or not. Thus, I added the method isRunning.
It works!

s.boot;
w = Window.new("testing spectrogram", Rect(10,10, 600, 300)).front;
a = Spectrogram.new(w, Rect(10, 10, 580, 280));
a.start;
a.isRunning // true
a.stop
a.isRunning // false

prko added 2 commits March 8, 2024 19:49
isRunning is added
documentation update for added method isRunning
Copy link

@JordanHendersonMusic JordanHendersonMusic left a comment

Choose a reason for hiding this comment

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

Why not just add the read accessor '<' to the variable running in line 11? This could probably be renamed to isRunning for clarity.

(Just a comment, not a proper review)

Spectrogram.sc Outdated Show resolved Hide resolved
prko added 2 commits March 8, 2024 22:36
isRunning and stop are added to the first example
corrected the method implementation for simplicity
@prko
Copy link
Author

prko commented Mar 8, 2024

Why not just add the read accessor '<' to the variable running in line 11? This could probably be renamed to isRunning for clarity.

(Just a comment, not a proper review)

running is used several times throughout the code. I thought isRunning was a common way to do it, so I did it. However, your suggestion is the simplest implementation!

`this.stopruntask;`
->
`if(this.isRunning) { this.stopruntask };`

to avoid an error when closing the spectrogram window after stopping it
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