diff --git a/js/AccordionBox.ts b/js/AccordionBox.ts index a7c33eb0..9d5c2044 100644 --- a/js/AccordionBox.ts +++ b/js/AccordionBox.ts @@ -185,7 +185,7 @@ export default class AccordionBox extends Node { // {*|null} options for the title bar, defaults filled in below titleBarOptions: null, - // {SoundPlayer} - sound generators for expand and collapse + // {ISoundPlayer} - sound generators for expand and collapse expandedSoundPlayer: accordionBoxOpenedSoundPlayer, collapsedSoundPlayer: accordionBoxClosedSoundPlayer, diff --git a/js/ComboBoxButton.ts b/js/ComboBoxButton.ts index 261b9be2..fd262045 100644 --- a/js/ComboBoxButton.ts +++ b/js/ComboBoxButton.ts @@ -11,7 +11,6 @@ import { Shape } from '../../kite/js/imports.js'; import optionize from '../../phet-core/js/optionize.js'; import StringUtils from '../../phetcommon/js/util/StringUtils.js'; import { AriaHasPopUpMutator, HStrut, IPaint, Node, Path, PDOMBehaviorFunction, PDOMPeer } from '../../scenery/js/imports.js'; -import SoundPlayer from '../../tambo/js/SoundPlayer.js'; import Tandem from '../../tandem/js/Tandem.js'; import ButtonNode from './buttons/ButtonNode.js'; import RectangularPushButton, { RectangularPushButtonOptions } from './buttons/RectangularPushButton.js'; @@ -20,6 +19,7 @@ import SunConstants from './SunConstants.js'; import VSeparator from './VSeparator.js'; import ComboBoxItem from './ComboBoxItem.js'; import IProperty from '../../axon/js/IProperty.js'; +import nullSoundPlayer from '../../tambo/js/shared-sound-players/nullSoundPlayer.js'; // constants const ALIGN_VALUES = [ 'left', 'center', 'right' ] as const; @@ -77,7 +77,7 @@ export default class ComboBoxButton extends RectangularPushButton { yMargin: 8, stroke: 'black', lineWidth: 1, - soundPlayer: SoundPlayer.NO_SOUND, // disable default sound generation + soundPlayer: nullSoundPlayer, // disable default sound generation // PushButtonModel options enabledPropertyOptions: { diff --git a/js/ComboBoxItem.ts b/js/ComboBoxItem.ts index ae83a428..026029e3 100644 --- a/js/ComboBoxItem.ts +++ b/js/ComboBoxItem.ts @@ -13,8 +13,8 @@ import sun from './sun.js'; export type ComboBoxItemOptions = { - // Sound that will be played when this item is selected. If set to `null` a default sound will - // be used that is based on this item's position in the combo box list. SoundPlayer.NO_SOUND can be used to disable. + // Sound that will be played when this item is selected. If set to `null` a default sound will be used that is based + // on this item's position in the combo box list. A value of `nullSoundPlayer` can be used to disable. soundPlayer?: ISoundPlayer | null; // phet-io - the tandem name for this item's associated Node in the combo box @@ -39,8 +39,9 @@ export default class ComboBoxItem { const options = optionize( { - // {SoundPlayer|null} - Sound that will be played when this item is selected. If set to `null` a default sound will - // be used that is based on this item's position in the combo box list. SoundPlayer.NO_SOUND can be used to disable. + // {ISoundPlayer|null} - Sound that will be played when this item is selected. If set to `null` a default sound + // will be used that is based on this item's position in the combo box list. The value `nullSoundPlayer` can be + // used to turn off sound production entirely. soundPlayer: null, // phet-io diff --git a/js/Dialog.js b/js/Dialog.js index 83f36e1d..a3d1b5f8 100644 --- a/js/Dialog.js +++ b/js/Dialog.js @@ -14,18 +14,10 @@ import ScreenView from '../../joist/js/ScreenView.js'; import getGlobal from '../../phet-core/js/getGlobal.js'; import merge from '../../phet-core/js/merge.js'; import CloseButton from '../../scenery-phet/js/buttons/CloseButton.js'; -import { FocusManager } from '../../scenery/js/imports.js'; -import { KeyboardUtils } from '../../scenery/js/imports.js'; -import { PDOMPeer } from '../../scenery/js/imports.js'; -import { PDOMUtils } from '../../scenery/js/imports.js'; -import { AlignBox } from '../../scenery/js/imports.js'; -import { HBox } from '../../scenery/js/imports.js'; -import { Node } from '../../scenery/js/imports.js'; -import { VBox } from '../../scenery/js/imports.js'; -import { FullScreen } from '../../scenery/js/imports.js'; +import { AlignBox, FocusManager, FullScreen, HBox, KeyboardUtils, Node, PDOMPeer, PDOMUtils, VBox } from '../../scenery/js/imports.js'; import generalCloseSoundPlayer from '../../tambo/js/shared-sound-players/generalCloseSoundPlayer.js'; import generalOpenSoundPlayer from '../../tambo/js/shared-sound-players/generalOpenSoundPlayer.js'; -import SoundPlayer from '../../tambo/js/SoundPlayer.js'; +import nullSoundPlayer from '../../tambo/js/shared-sound-players/nullSoundPlayer.js'; import PhetioObject from '../../tandem/js/PhetioObject.js'; import Tandem from '../../tandem/js/Tandem.js'; import DynamicMarkerIO from '../../tandem/js/types/DynamicMarkerIO.js'; @@ -136,7 +128,7 @@ class Dialog extends Popupable( Panel ) { phetioReadOnly: PhetioObject.DEFAULT_OPTIONS.phetioReadOnly, // default to false so it can pass it through to the close button phetioState: PhetioObject.DEFAULT_OPTIONS.phetioState, - // {SoundPlayer} - sound generation + // {ISoundPlayer} - sound generation openedSoundPlayer: generalOpenSoundPlayer, closedSoundPlayer: generalCloseSoundPlayer, @@ -213,7 +205,7 @@ class Dialog extends Popupable( Panel ) { enabledPropertyOptions: { phetioFeatured: false }, // turn off default sound generation, Dialog will create its own sounds - soundPlayer: SoundPlayer.NO_SOUND, + soundPlayer: nullSoundPlayer, // pdom tagName: 'button', diff --git a/js/buttons/RectangularRadioButton.ts b/js/buttons/RectangularRadioButton.ts index e3403863..55c73fd2 100644 --- a/js/buttons/RectangularRadioButton.ts +++ b/js/buttons/RectangularRadioButton.ts @@ -47,7 +47,7 @@ type SelfOptions = { deselectedContentOpacity?: number; // Sound generation - If set to null a default will be used that is based on this button's - // position within the radio button group. Can be set to SoundPlayer.NO_SOUND to disable. + // position within the radio button group. Can be set to nullSoundPlayer to disable. soundPlayer?: ISoundPlayer | null; }; diff --git a/js/buttons/RectangularToggleButton.ts b/js/buttons/RectangularToggleButton.ts index ee84b0c2..ebb82bb0 100644 --- a/js/buttons/RectangularToggleButton.ts +++ b/js/buttons/RectangularToggleButton.ts @@ -42,7 +42,7 @@ export default class RectangularToggleButton extends RectangularButton { const options = optionize( { - // {SoundPlayer} - sounds to be played on toggle transitions + // {ISoundPlayer} - sounds to be played on toggle transitions valueOffSoundPlayer: toggleOffSoundPlayer, valueOnSoundPlayer: toggleOnSoundPlayer,