Skip to content

Commit

Permalink
changed SoundPlayer to ISoundPlayer, see phetsims/tambo#160
Browse files Browse the repository at this point in the history
  • Loading branch information
jbphet committed Apr 15, 2022
1 parent 805e0f3 commit c284cea
Show file tree
Hide file tree
Showing 8 changed files with 28 additions and 42 deletions.
10 changes: 4 additions & 6 deletions js/common/view/AllFilledDialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,10 @@ import Vector2 from '../../../../dot/js/Vector2.js';
import merge from '../../../../phet-core/js/merge.js';
import FaceNode from '../../../../scenery-phet/js/FaceNode.js';
import PhetFont from '../../../../scenery-phet/js/PhetFont.js';
import { Text } from '../../../../scenery/js/imports.js';
import { VBox } from '../../../../scenery/js/imports.js';
import { Color } from '../../../../scenery/js/imports.js';
import Dialog from '../../../../sun/js/Dialog.js';
import { Color, Text, VBox } from '../../../../scenery/js/imports.js';
import TextPushButton from '../../../../sun/js/buttons/TextPushButton.js';
import SoundPlayer from '../../../../tambo/js/SoundPlayer.js';
import Dialog from '../../../../sun/js/Dialog.js';
import nullSoundPlayer from '../../../../tambo/js/shared-sound-players/nullSoundPlayer.js';
import buildAMolecule from '../../buildAMolecule.js';
import buildAMoleculeStrings from '../../buildAMoleculeStrings.js';
import BAMConstants from '../BAMConstants.js';
Expand Down Expand Up @@ -67,7 +65,7 @@ class AllFilledDialog extends Dialog {
touchAreaXDilation: 20,
touchAreaYDilation: 20,
baseColor: Color.ORANGE,
soundPlayer: SoundPlayer.NO_SOUND,
soundPlayer: nullSoundPlayer,
listener: () => {
buttonClickedProperty.value = true;
regenerateCallback();
Expand Down
8 changes: 3 additions & 5 deletions js/common/view/CollectionAreaNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,8 @@
*/

import RefreshButton from '../../../../scenery-phet/js/buttons/RefreshButton.js';
import { Node } from '../../../../scenery/js/imports.js';
import { VBox } from '../../../../scenery/js/imports.js';
import { Color } from '../../../../scenery/js/imports.js';
import SoundPlayer from '../../../../tambo/js/SoundPlayer.js';
import { Color, Node, VBox } from '../../../../scenery/js/imports.js';
import nullSoundPlayer from '../../../../tambo/js/shared-sound-players/nullSoundPlayer.js';
import buildAMolecule from '../../buildAMolecule.js';
import MultipleCollectionBoxNode from './MultipleCollectionBoxNode.js';
import SingleCollectionBoxNode from './SingleCollectionBoxNode.js';
Expand Down Expand Up @@ -52,7 +50,7 @@ class CollectionAreaNode extends Node {
xMargin: 15,
yMargin: 5,
baseColor: Color.ORANGE,
soundPlayer: SoundPlayer.NO_SOUND
soundPlayer: nullSoundPlayer
} );
resetCollectionButton.touchArea = resetCollectionButton.bounds.dilated( 7 );

Expand Down
7 changes: 3 additions & 4 deletions js/common/view/KitPanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,10 @@
*/

import Property from '../../../../axon/js/Property.js';
import { Node } from '../../../../scenery/js/imports.js';
import { Color } from '../../../../scenery/js/imports.js';
import { Color, Node } from '../../../../scenery/js/imports.js';
import Carousel from '../../../../sun/js/Carousel.js';
import PageControl from '../../../../sun/js/PageControl.js';
import SoundPlayer from '../../../../tambo/js/SoundPlayer.js';
import nullSoundPlayer from '../../../../tambo/js/shared-sound-players/nullSoundPlayer.js';
import buildAMolecule from '../../buildAMolecule.js';
import BAMConstants from '../BAMConstants.js';
import KitNode from './KitNode.js';
Expand Down Expand Up @@ -56,7 +55,7 @@ class KitPanel extends Node {
stroke: BAMConstants.KIT_BORDER,
itemsPerPage: 1,
animationEnabled: false,
buttonSoundPlayer: SoundPlayer.NO_SOUND
buttonSoundPlayer: nullSoundPlayer
} );

// When the page number changes update the current collection.
Expand Down
4 changes: 2 additions & 2 deletions js/common/view/MoleculeCollectingScreenView.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { Shape } from '../../../../kite/js/imports.js';
import PhetFont from '../../../../scenery-phet/js/PhetFont.js';
import { Color } from '../../../../scenery/js/imports.js';
import TextPushButton from '../../../../sun/js/buttons/TextPushButton.js';
import SoundPlayer from '../../../../tambo/js/SoundPlayer.js';
import nullSoundPlayer from '../../../../tambo/js/shared-sound-players/nullSoundPlayer.js';
import buildAMolecule from '../../buildAMolecule.js';
import buildAMoleculeStrings from '../../buildAMoleculeStrings.js';
import BAMConstants from '../BAMConstants.js';
Expand Down Expand Up @@ -45,7 +45,7 @@ class MoleculeCollectingScreenView extends BAMScreenView {
} ),
maxWidth: BAMConstants.TEXT_MAX_WIDTH,
baseColor: Color.ORANGE,
soundPlayer: SoundPlayer.NO_SOUND
soundPlayer: nullSoundPlayer
} );
this.nextCollectionButton.touchArea = Shape.bounds( this.nextCollectionButton.localBounds.dilated( 20 ) );
this.nextCollectionButton.addListener( () => {
Expand Down
11 changes: 4 additions & 7 deletions js/common/view/MoleculeControlsHBox.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,12 @@
* @author Jonathan Olson <[email protected]>
*/

import StringUtils from '../../../../phetcommon/js/util/StringUtils.js';
import { Shape } from '../../../../kite/js/imports.js';
import StringUtils from '../../../../phetcommon/js/util/StringUtils.js';
import PhetFont from '../../../../scenery-phet/js/PhetFont.js';
import { ButtonListener } from '../../../../scenery/js/imports.js';
import { HBox } from '../../../../scenery/js/imports.js';
import { Image } from '../../../../scenery/js/imports.js';
import { Text } from '../../../../scenery/js/imports.js';
import { ButtonListener, HBox, Image, Text } from '../../../../scenery/js/imports.js';
import RectangularPushButton from '../../../../sun/js/buttons/RectangularPushButton.js';
import SoundPlayer from '../../../../tambo/js/SoundPlayer.js';
import nullSoundPlayer from '../../../../tambo/js/shared-sound-players/nullSoundPlayer.js';
import splitBlue_png from '../../../images/splitBlue_png.js';
import buildAMolecule from '../../buildAMolecule.js';
import buildAMoleculeStrings from '../../buildAMoleculeStrings.js';
Expand Down Expand Up @@ -72,7 +69,7 @@ class MoleculeControlsHBox extends HBox {
cursor: 'pointer',
xMargin: 0, // Setting margins to zero so the 'X' image takes up the whole button view
yMargin: 0,
soundPlayer: SoundPlayer.NO_SOUND
soundPlayer: nullSoundPlayer
} );
buttonBreak.touchArea = buttonBreak.childBounds.dilated( DILATION_FACTOR );
buttonBreak.addInputListener( new ButtonListener( {
Expand Down
7 changes: 3 additions & 4 deletions js/common/view/RefillButton.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,10 @@ import merge from '../../../../phet-core/js/merge.js';
import SphereBucket from '../../../../phetcommon/js/model/SphereBucket.js';
import BucketFront from '../../../../scenery-phet/js/bucket/BucketFront.js';
import BucketHole from '../../../../scenery-phet/js/bucket/BucketHole.js';
import { Node } from '../../../../scenery/js/imports.js';
import { Path } from '../../../../scenery/js/imports.js';
import { Node, Path } from '../../../../scenery/js/imports.js';
import replySolidShape from '../../../../sherpa/js/fontawesome-5/replySolidShape.js';
import RectangularPushButton from '../../../../sun/js/buttons/RectangularPushButton.js';
import SoundPlayer from '../../../../tambo/js/SoundPlayer.js';
import nullSoundPlayer from '../../../../tambo/js/shared-sound-players/nullSoundPlayer.js';
import buildAMolecule from '../../buildAMolecule.js';
import BAMConstants from '../BAMConstants.js';

Expand Down Expand Up @@ -59,7 +58,7 @@ class RefillButton extends RectangularPushButton {
content: contentNode,
listener: buttonListener,
baseColor: 'rgb(234,225,88)',
soundPlayer: SoundPlayer.NO_SOUND
soundPlayer: nullSoundPlayer
}, options );
super( options );
}
Expand Down
19 changes: 7 additions & 12 deletions js/common/view/view3d/Molecule3DDialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,25 +7,20 @@
* @author Denzell Barnett (PhET Interactive Simulations)
*/

import StringUtils from '../../../../../phetcommon/js/util/StringUtils.js';
import BooleanProperty from '../../../../../axon/js/BooleanProperty.js';
import EnumerationDeprecatedProperty from '../../../../../axon/js/EnumerationDeprecatedProperty.js';
import Property from '../../../../../axon/js/Property.js';
import Matrix3 from '../../../../../dot/js/Matrix3.js';
import Vector3 from '../../../../../dot/js/Vector3.js';
import ThreeNode from '../../../../../mobius/js/ThreeNode.js';
import EnumerationDeprecated from '../../../../../phet-core/js/EnumerationDeprecated.js';
import PhetFont from '../../../../../scenery-phet/js/PhetFont.js';
import StringUtils from '../../../../../phetcommon/js/util/StringUtils.js';
import PlayPauseButton from '../../../../../scenery-phet/js/buttons/PlayPauseButton.js';
import { PressListener } from '../../../../../scenery/js/imports.js';
import { Rectangle } from '../../../../../scenery/js/imports.js';
import { RichText } from '../../../../../scenery/js/imports.js';
import { Text } from '../../../../../scenery/js/imports.js';
import { VBox } from '../../../../../scenery/js/imports.js';
import { Color } from '../../../../../scenery/js/imports.js';
import Dialog from '../../../../../sun/js/Dialog.js';
import PhetFont from '../../../../../scenery-phet/js/PhetFont.js';
import { Color, PressListener, Rectangle, RichText, Text, VBox } from '../../../../../scenery/js/imports.js';
import RectangularRadioButtonGroup from '../../../../../sun/js/buttons/RectangularRadioButtonGroup.js';
import SoundPlayer from '../../../../../tambo/js/SoundPlayer.js';
import Dialog from '../../../../../sun/js/Dialog.js';
import nullSoundPlayer from '../../../../../tambo/js/shared-sound-players/nullSoundPlayer.js';
import buildAMolecule from '../../../buildAMolecule.js';
import buildAMoleculeStrings from '../../../buildAMoleculeStrings.js';
import BAMConstants from '../../BAMConstants.js';
Expand Down Expand Up @@ -69,8 +64,8 @@ class Molecule3DDialog extends Dialog {
this.viewStyleProperty = new EnumerationDeprecatedProperty( ViewStyle, ViewStyle.SPACE_FILL );
const playPauseButton = new PlayPauseButton( this.isPlayingProperty, {
radius: 15,
valueOffSoundPlayer: SoundPlayer.NO_SOUND,
valueOnSoundPlayer: SoundPlayer.NO_SOUND,
valueOffSoundPlayer: nullSoundPlayer,
valueOnSoundPlayer: nullSoundPlayer,
baseColor: Color.ORANGE
} );

Expand Down
4 changes: 2 additions & 2 deletions js/common/view/view3d/ShowMolecule3DButtonNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import merge from '../../../../../phet-core/js/merge.js';
import PhetFont from '../../../../../scenery-phet/js/PhetFont.js';
import { Text } from '../../../../../scenery/js/imports.js';
import RectangularPushButton from '../../../../../sun/js/buttons/RectangularPushButton.js';
import SoundPlayer from '../../../../../tambo/js/SoundPlayer.js';
import nullSoundPlayer from '../../../../../tambo/js/shared-sound-players/nullSoundPlayer.js';
import buildAMolecule from '../../../buildAMolecule.js';
import buildAMoleculeStrings from '../../../buildAMoleculeStrings.js';
import BAMConstants from '../../BAMConstants.js';
Expand Down Expand Up @@ -39,7 +39,7 @@ class ShowMolecule3DButtonNode extends RectangularPushButton {
xMargin: 3,
yMargin: 3,
cursor: 'pointer',
soundPlayer: SoundPlayer.NO_SOUND
soundPlayer: nullSoundPlayer
}, options ) );
}
}
Expand Down

0 comments on commit c284cea

Please sign in to comment.