Skip to content

Commit

Permalink
rename simSoundEnabledProperty in this sim to something more sim spec…
Browse files Browse the repository at this point in the history
…ific, see phetsims/joist#864
  • Loading branch information
jessegreenberg committed Sep 21, 2022
1 parent 5cf0952 commit b8f6abd
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 15 deletions.
4 changes: 2 additions & 2 deletions js/quadrilateral/view/ShapeSoundCheckbox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ const shapeSoundControlDisabledContextResponse = QuadrilateralStrings.a11y.voici
const shapeSoundControlNameResponse = QuadrilateralStrings.a11y.voicing.shapeSoundControl.nameResponse;

class ShapeSoundCheckbox extends Checkbox {
public constructor( simSoundEnabledProperty: Property<boolean>, tandem: Tandem ) {
super( simSoundEnabledProperty, QuadrilateralIconFactory.createSoundIcon(), {
public constructor( shapeSoundEnabledProperty: Property<boolean>, tandem: Tandem ) {
super( shapeSoundEnabledProperty, QuadrilateralIconFactory.createSoundIcon(), {
voicingNameResponse: shapeSoundControlNameResponse,
checkedContextResponse: shapeSoundControlEnabledContextResponse,
uncheckedContextResponse: shapeSoundControlDisabledContextResponse,
Expand Down
4 changes: 2 additions & 2 deletions js/quadrilateral/view/sound/TracksArpeggioSoundView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,8 @@ const NAMED_QUADRILATERAL_TO_BACKGROUND_TRACKS_MAP = new Map( [
class TracksArpeggioSoundView extends TracksSoundView {
private readonly disposeTracksArpeggioSoundView: () => void;

public constructor( shapeModel: QuadrilateralShapeModel, simSoundEnabledProperty: TReadOnlyProperty<boolean>, resetNotInProgressProperty: TReadOnlyProperty<boolean>, soundOptionsModel: QuadrilateralSoundOptionsModel ) {
super( shapeModel, simSoundEnabledProperty, resetNotInProgressProperty, soundOptionsModel, ARPEGGIO_TRACKS );
public constructor( shapeModel: QuadrilateralShapeModel, shapeSoundEnabledProperty: TReadOnlyProperty<boolean>, resetNotInProgressProperty: TReadOnlyProperty<boolean>, soundOptionsModel: QuadrilateralSoundOptionsModel ) {
super( shapeModel, shapeSoundEnabledProperty, resetNotInProgressProperty, soundOptionsModel, ARPEGGIO_TRACKS );

const shapeNameListener = ( shapeName: NamedQuadrilateral ) => {

Expand Down
4 changes: 2 additions & 2 deletions js/quadrilateral/view/sound/TracksBuildUpSoundView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,14 +84,14 @@ type TracksBuildUpSoundViewOptions = {
class TracksBuildUpSoundView extends TracksSoundView {
private readonly disposeTracksBuildUpSoundView: () => void;

public constructor( shapeModel: QuadrilateralShapeModel, simSoundEnabledProperty: TReadOnlyProperty<boolean>, resetNotInProgressProperty: TReadOnlyProperty<boolean>, soundOptionsModel: QuadrilateralSoundOptionsModel, providedOptions?: TracksBuildUpSoundViewOptions ) {
public constructor( shapeModel: QuadrilateralShapeModel, shapeSoundEnabledProperty: TReadOnlyProperty<boolean>, resetNotInProgressProperty: TReadOnlyProperty<boolean>, soundOptionsModel: QuadrilateralSoundOptionsModel, providedOptions?: TracksBuildUpSoundViewOptions ) {

const options = optionize<TracksBuildUpSoundViewOptions>()( {
simple: false
}, providedOptions );

const tracks = options.simple ? BUILD_UP_TRACKS_SIMPLE : BUILD_UP_TRACKS;
super( shapeModel, simSoundEnabledProperty, resetNotInProgressProperty, soundOptionsModel, tracks );
super( shapeModel, shapeSoundEnabledProperty, resetNotInProgressProperty, soundOptionsModel, tracks );

const shapeNameListener = ( shapeName: NamedQuadrilateral ) => {

Expand Down
5 changes: 2 additions & 3 deletions js/quadrilateral/view/sound/TracksMelodyMappingSoundView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,8 @@ const NAMED_QUADRILATERAL_TO_TRACKS_MAP = new Map( [
class TracksMelodyMappingSoundView extends TracksSoundView {
private readonly disposeTracksMelodyMappingSoundView: () => void;

public constructor( shapeModel: QuadrilateralShapeModel, simSoundEnabledProperty: TReadOnlyProperty<boolean>, resetNotInProgressProperty: TReadOnlyProperty<boolean>, soundOptionsModel: QuadrilateralSoundOptionsModel ) {

super( shapeModel, simSoundEnabledProperty, resetNotInProgressProperty, soundOptionsModel, MELODY_MAPPING_TRACKS );
public constructor( shapeModel: QuadrilateralShapeModel, shapeSoundEnabledProperty: TReadOnlyProperty<boolean>, resetNotInProgressProperty: TReadOnlyProperty<boolean>, soundOptionsModel: QuadrilateralSoundOptionsModel ) {
super( shapeModel, shapeSoundEnabledProperty, resetNotInProgressProperty, soundOptionsModel, MELODY_MAPPING_TRACKS );

const shapeNameListener = ( shapeName: NamedQuadrilateral ) => {

Expand Down
4 changes: 2 additions & 2 deletions js/quadrilateral/view/sound/TracksMelodySoundView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,14 +76,14 @@ type TracksMelodySoundViewOptions = {
class TracksMelodySoundView extends TracksSoundView {
private readonly disposeTracksMelodySoundView: () => void;

public constructor( shapeModel: QuadrilateralShapeModel, simSoundEnabledProperty: TReadOnlyProperty<boolean>, resetNotInProgressProperty: TReadOnlyProperty<boolean>, soundOptionsModel: QuadrilateralSoundOptionsModel, providedOptions?: TracksMelodySoundViewOptions ) {
public constructor( shapeModel: QuadrilateralShapeModel, shapeSoundEnabledProperty: TReadOnlyProperty<boolean>, resetNotInProgressProperty: TReadOnlyProperty<boolean>, soundOptionsModel: QuadrilateralSoundOptionsModel, providedOptions?: TracksMelodySoundViewOptions ) {

const options = optionize<TracksMelodySoundViewOptions>()( {
simple: false
}, providedOptions );

const tracks = options.simple ? SIMPLE_MELODY_TRACKS : MELODY_TRACKS;
super( shapeModel, simSoundEnabledProperty, resetNotInProgressProperty, soundOptionsModel, tracks );
super( shapeModel, shapeSoundEnabledProperty, resetNotInProgressProperty, soundOptionsModel, tracks );

const shapeNameListener = ( shapeName: NamedQuadrilateral ) => {

Expand Down
4 changes: 2 additions & 2 deletions js/quadrilateral/view/sound/TracksSoundView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,11 @@ class TracksSoundView extends SoundGenerator {
// is stopped or currently fading out.
private shapeDirty = false;

public constructor( shapeModel: QuadrilateralShapeModel, simSoundEnabledProperty: TReadOnlyProperty<boolean>, resetNotInProgressProperty: TReadOnlyProperty<boolean>, soundOptionsModel: QuadrilateralSoundOptionsModel, tracks: WrappedAudioBuffer[] ) {
public constructor( shapeModel: QuadrilateralShapeModel, shapeSoundEnabledProperty: TReadOnlyProperty<boolean>, resetNotInProgressProperty: TReadOnlyProperty<boolean>, soundOptionsModel: QuadrilateralSoundOptionsModel, tracks: WrappedAudioBuffer[] ) {
super( {

// don't play sounds while model reset is in progress or when the user has opted out of playing music tracks
enableControlProperties: [ resetNotInProgressProperty, simSoundEnabledProperty ],
enableControlProperties: [ resetNotInProgressProperty, shapeSoundEnabledProperty ],

// No sound from this track set initially
initialOutputLevel: 0
Expand Down
4 changes: 2 additions & 2 deletions js/quadrilateral/view/sound/TracksVolumeEmphasisSoundView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ const NAMED_QUADRILATERAL_TO_HIGH_VOLUME_TRACKS_MAP = new Map( [
] );

class TracksVolumeEmphasisSoundView extends TracksSoundView {
public constructor( shapeModel: QuadrilateralShapeModel, simSoundEnabledProperty: TReadOnlyProperty<boolean>, resetNotInProgressProperty: TReadOnlyProperty<boolean>, soundOptionsModel: QuadrilateralSoundOptionsModel ) {
super( shapeModel, simSoundEnabledProperty, resetNotInProgressProperty, soundOptionsModel, VOLUME_EMPHASIS_TRACKS );
public constructor( shapeModel: QuadrilateralShapeModel, shapeSoundEnabledProperty: TReadOnlyProperty<boolean>, resetNotInProgressProperty: TReadOnlyProperty<boolean>, soundOptionsModel: QuadrilateralSoundOptionsModel ) {
super( shapeModel, shapeSoundEnabledProperty, resetNotInProgressProperty, soundOptionsModel, VOLUME_EMPHASIS_TRACKS );

const shapeNameListener = ( shapeName: NamedQuadrilateral ) => {

Expand Down

0 comments on commit b8f6abd

Please sign in to comment.