Skip to content

Commit

Permalink
replace enableControlProperties with enabledProperty, mute sounds dur…
Browse files Browse the repository at this point in the history
…ing reset by default, & other sound lib API improvements, see phetsims/tambo#189
  • Loading branch information
jbphet committed Jul 13, 2024
1 parent 1422ba2 commit ed3a059
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion js/common/view/NumberOfParticlesControl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import { HBox, KeyboardListener, Node, Text, VBox, VBoxOptions } from '../../../
import gasProperties from '../../gasProperties.js';
import GasPropertiesColors from '../GasPropertiesColors.js';
import GasPropertiesConstants from '../GasPropertiesConstants.js';
import pushButtonSoundPlayer from '../../../../tambo/js/shared-sound-players/pushButtonSoundPlayer.js';
import sharedSoundPlayers from '../../../../tambo/js/sharedSoundPlayers.js';

// const
const X_SPACING = 8;
Expand Down Expand Up @@ -83,6 +83,7 @@ class GasPropertiesFineCoarseSpinner extends FineCoarseSpinner {
super( numberProperty, providedOptions );

// Add sound for the Home and End keys.
const pushButtonSoundPlayer = sharedSoundPlayers.get( 'pushButton' );
this.addInputListener( new KeyboardListener( {
keys: [ 'home', 'end' ] as const,
fire: () => pushButtonSoundPlayer.play()
Expand Down
3 changes: 2 additions & 1 deletion js/diffusion/view/DiffusionQuantityControls.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import gasProperties from '../../gasProperties.js';
import Tandem from '../../../../tandem/js/Tandem.js';
import Property from '../../../../axon/js/Property.js';
import Range from '../../../../dot/js/Range.js';
import pushButtonSoundPlayer from '../../../../tambo/js/shared-sound-players/pushButtonSoundPlayer.js';
import sharedSoundPlayers from '../../../../tambo/js/sharedSoundPlayers.js';

const ICON_SPACING = 10; // space between particle icon and spinner

Expand Down Expand Up @@ -132,6 +132,7 @@ class GasPropertiesNumberSpinner extends NumberSpinner {
super( numberProperty, rangeProperty, providedOptions );

// Add sound for the Home and End keys.
const pushButtonSoundPlayer = sharedSoundPlayers.get( 'pushButton' );
this.addInputListener( new KeyboardListener( {
keys: [ 'home', 'end' ] as const,
fire: () => pushButtonSoundPlayer.play()
Expand Down

0 comments on commit ed3a059

Please sign in to comment.