From 11823335e60202b42e07e912b73635da5b0da677 Mon Sep 17 00:00:00 2001 From: pixelzoom Date: Mon, 26 Feb 2024 17:22:43 -0700 Subject: [PATCH] rename Slider.DEFAULT_SOUND to Slider.DEFAULT_SOUND_GENERATOR, https://github.com/phetsims/scenery-phet/issues/840 --- js/Slider.ts | 10 +++++----- js/SliderTrack.ts | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/js/Slider.ts b/js/Slider.ts index 817891f4..d3422010 100644 --- a/js/Slider.ts +++ b/js/Slider.ts @@ -141,8 +141,8 @@ export default class Slider extends Sizable( AccessibleSlider( Node, 0 ) ) { private readonly ticks: ObservableArray = createObservableArray(); - // This is a marker to indicate that we should create the actual default slider sound. - public static readonly DEFAULT_SOUND = new ValueChangeSoundPlayer( new Range( 0, 1 ) ); + // The default sound used if options.soundGenerator is not set. + public static readonly DEFAULT_SOUND_GENERATOR = new ValueChangeSoundPlayer( new Range( 0, 1 ) ); // If the user is holding down the thumb outside of the enabled range, and the enabled range expands, the value should // adjust to the new extremum of the range, see https://github.com/phetsims/mean-share-and-balance/issues/29 @@ -207,7 +207,7 @@ export default class Slider extends Sizable( AccessibleSlider( Node, 0 ) ) { disabledOpacity: SceneryConstants.DISABLED_OPACITY, - soundGenerator: Slider.DEFAULT_SOUND, + soundGenerator: Slider.DEFAULT_SOUND_GENERATOR, valueChangeSoundGeneratorOptions: {}, // phet-io @@ -224,11 +224,11 @@ export default class Slider extends Sizable( AccessibleSlider( Node, 0 ) ) { const rangeProperty = range instanceof Range ? new TinyProperty( range ) : range; - assert && assert( options.soundGenerator === Slider.DEFAULT_SOUND || _.isEmpty( options.valueChangeSoundGeneratorOptions ), + assert && assert( options.soundGenerator === Slider.DEFAULT_SOUND_GENERATOR || _.isEmpty( options.valueChangeSoundGeneratorOptions ), 'options should only be supplied when using default sound generator' ); // If no sound generator was provided, create the default. - if ( options.soundGenerator === Slider.DEFAULT_SOUND ) { + if ( options.soundGenerator === Slider.DEFAULT_SOUND_GENERATOR ) { options.soundGenerator = new ValueChangeSoundPlayer( rangeProperty.value, options.valueChangeSoundGeneratorOptions || {} ); } else if ( options.soundGenerator === null ) { diff --git a/js/SliderTrack.ts b/js/SliderTrack.ts index 22a3a3cf..b19f1ac8 100644 --- a/js/SliderTrack.ts +++ b/js/SliderTrack.ts @@ -95,7 +95,7 @@ export default class SliderTrack extends WidthSizable( Node ) { endDrag: _.noop, // called when a drag sequence ends constrainValue: _.identity, // called before valueProperty is set enabledRangeProperty: this.rangeProperty, - soundGenerator: Slider.DEFAULT_SOUND, + soundGenerator: Slider.DEFAULT_SOUND_GENERATOR, valueChangeSoundGeneratorOptions: {}, voicingOnEndResponse: _.noop, @@ -108,7 +108,7 @@ export default class SliderTrack extends WidthSizable( Node ) { }, providedOptions ); // If no sound generator was provided, create the default. - if ( options.soundGenerator === Slider.DEFAULT_SOUND ) { + if ( options.soundGenerator === Slider.DEFAULT_SOUND_GENERATOR ) { // NOTE: We'll want to update ValueChangeSoundPlayer for dynamic ranges if it's used more for that options.soundGenerator = new ValueChangeSoundPlayer( this.rangeProperty.value, options.valueChangeSoundGeneratorOptions || {} ); }