-
Notifications
You must be signed in to change notification settings - Fork 6
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
Handle default sounds for DragListener and KeyboardDragListener in scenery #849
Comments
@amanda-phet @jbphet Do you have anything to add here design-wise? |
I have two comments/suggestions:
Also, I'd be happy to collaborate on this if it would be helpful. |
Design-wise, I'm in favor of using a default sound design for DragListener, and vote for the current grab and release sounds that are being copied into multiple sims. |
Now that this has been assigned back to me, I'm not sure how to proceed. I guess the process is to leave it unassigned (which seems wrong) and add this to the Developer Meeting agenda (done). |
Seems like a "hot potato" or "not it" sort of issue at the moment. Maybe put it on the list of potential tasks for an upcoming iteration. I'm happy to work on it if the decision makers want to make it a priority for me. |
@jonathanolson, can you comment on how you feel about adding a dependency on tambo in scenery? |
This was discussed extensively at 1/4/24 dev meeting. Here are the notes from https://docs.google.com/document/d/11Gt3Ulalj0fCD2fFeCjPT5ni_9mM2WjkGc4ysisQmo8/edit?pli=1: CM: How to proceed with #849? I.e. DragListeners have to get the drag and drop soundClips manually added every time. |
We met on jan-08. Meeting notes:
JO: After looking at TSoundPlayer, I'm leaning on adding an equivalent type into scenery and not depend on Tambo. (It's just an object that has a play() and stop() methods). However, we'd still need Tambo for the default values. JO: Do we want this also for PressListeners? Answer: No. |
Was there conversation about converting most/all old and new usages to this new, phet-specific drag listener? If the motivation of this issue was, "I always forget to add UI sound to my draggable because I need to do it manually", isn't this the same problem shifted because you have to remember to use the new drag listener? Unless guarded by strong precedent or a lint rule I will most likely continue to accidentally use DragListener until this bites me one too many times. |
It seems like the motivation in the issue is based more on, "PhET's specific dragging implementation", so I wouldn't be surprised if we pack more sim-specific customization in this new class in the future. I would recommend a more general name than something with "Sound" in the class name. |
@zepumph it was mentioned that we're not interested in replacing all usages of DragListener, only the ones which use the above pattern. |
Signed-off-by: Michael Kauzmann <michael.kauzmann@colorado.edu>
Cherry picking has been completed for graphing-lines 1.4 and graphing-slope-intercept 1.2. Back to @jbphet to complete the review requested in #849 (comment). |
@jbphet ping. Let's get this reviewed and closed. |
Note that However, my rename lost git history so I am going to redo the scenery-phet commits. |
…and phetsims/scenery#1614" This reverts commit 0e8b2af.
…t history this time, see #849
I'm sorry it's taken me so long to start reviewing this, but, well, higher priorities. I've taken an initial look, and have some big questions before moving on to the next steps.
|
Over in phetsims/graphing-lines#137 (comment), @amanda-phet and I discovered that DragListener and KeyboardDragListener apparently have an (unofficial?) default design. tambo has sounds to be used for "grab" and "release" interactions.
While it's a default sound design, it's not supported in common code. Sims must implement it, using some variation of this code:
There are also variations of the above code that use
press: () => grabClip.play()
andrelease: () => releaseClip.play()
.This duplication is very undesirable. It's unnecessary work. It results in inconsistent implementation and inconsistent behavior (e.g output levels are all over the place). It's also easy to omit, if the developer and designer are not aware of this pattern (as I wasn't until a couple of hours ago.)
Let's investigate moving the default sound design (and the above code) into scenery, with options to specify an alternative sound design.
The text was updated successfully, but these errors were encountered: