Skip to content

Commit

Permalink
use voicing utteranceQueue in Display
Browse files Browse the repository at this point in the history
  • Loading branch information
jessegreenberg committed Mar 17, 2021
1 parent c30e379 commit cc94b26
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion js/tracking/SaveTestEventsButton.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class SaveTestEventsButton extends RectangularPushButton {
this.addInputListener( new SelfVoicingInputListener( {
onFocusIn: () => {
const response = levelSpeakerModel.collectResponses( BUTTON_OBJECT_RESPONSE );
phet.joist.sim.selfVoicingUtteranceQueue.addToBack( response );
phet.joist.sim.voicingUtteranceQueue.addToBack( response );
},
highlightTarget: this
} ) );
Expand Down
18 changes: 9 additions & 9 deletions js/view/CustomGestureIntroDialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ class CustomGestureIntroDialog extends Dialog {
alert: dialogDescriptionString,
cancelOther: false
} );
phet.joist.sim.selfVoicingUtteranceQueue.addToBack( utterance );
phet.joist.sim.voicingUtteranceQueue.addToBack( utterance );
};

// a wrapper that surrounds the descriptionParagraph with a Node that is focusable
Expand All @@ -89,7 +89,7 @@ class CustomGestureIntroDialog extends Dialog {
const exampleButton = new TextPushButton( testButtonContent, {
font: contentFont,
listener: () => {
phet.joist.sim.selfVoicingUtteranceQueue.addToBack( pressedString );
phet.joist.sim.voicingUtteranceQueue.addToBack( pressedString );
}
} );

Expand Down Expand Up @@ -122,19 +122,19 @@ class CustomGestureIntroDialog extends Dialog {
// listeners that provide actual self-voicing content on the example components
exampleButton.addInputListener( new SelfVoicingInputListener( {
onFocusIn: () => {
phet.joist.sim.selfVoicingUtteranceQueue.addToBack( testButtonContent );
phet.joist.sim.voicingUtteranceQueue.addToBack( testButtonContent );
}
} ) );

exampleSlider.addInputListener( new SelfVoicingInputListener( {
onFocusIn: () => {
phet.joist.sim.selfVoicingUtteranceQueue.addToBack( sliderLabelString );
phet.joist.sim.voicingUtteranceQueue.addToBack( sliderLabelString );
}
} ) );

continueButton.addInputListener( new SelfVoicingInputListener( {
onFocusIn: () => {
phet.joist.sim.selfVoicingUtteranceQueue.addToBack( continueButtonContent );
phet.joist.sim.voicingUtteranceQueue.addToBack( continueButtonContent );
}
} ) );

Expand All @@ -144,27 +144,27 @@ class CustomGestureIntroDialog extends Dialog {
manipulation: sliderInteractionHintString
} );

phet.joist.sim.selfVoicingUtteranceQueue.addToBack( hintString );
phet.joist.sim.voicingUtteranceQueue.addToBack( hintString );
}
} );

const valueChangeUtterance = new SelfVoicingUtterance();
exampleSliderProperty.lazyLink( value => {
valueChangeUtterance.alert = `${value}`;
phet.joist.sim.selfVoicingUtteranceQueue.addToBack( valueChangeUtterance );
phet.joist.sim.voicingUtteranceQueue.addToBack( valueChangeUtterance );
} );

let positionOnValueChange = null;
exampleSlider.swipeStart = event => {
phet.joist.sim.selfVoicingUtteranceQueue.addToBack( grabbedAlertString );
phet.joist.sim.voicingUtteranceQueue.addToBack( grabbedAlertString );
positionOnValueChange = event.pointer.point;
};
exampleSlider.swipeEnd = () => {
const releasedAlert = new SelfVoicingUtterance( {
cancelOther: false,
alert: releasedString
} );
phet.joist.sim.selfVoicingUtteranceQueue.addToBack( releasedAlert );
phet.joist.sim.voicingUtteranceQueue.addToBack( releasedAlert );
};
exampleSlider.swipeMove = event => {
const nextSwipePosition = event.pointer.point;
Expand Down
6 changes: 3 additions & 3 deletions js/view/GestureControlledSlider.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class GestureControlledSlider extends Slider {

// called on the beginning of a swipe gesture, by SwipeListeners
onSwipeStart: () => {
phet.joist.sim.selfVoicingUtteranceQueue.addToBack( grabbedAlertString );
phet.joist.sim.voicingUtteranceQueue.addToBack( grabbedAlertString );
},

// called at the end of a swipe gesture, by SwipeListener
Expand All @@ -57,7 +57,7 @@ class GestureControlledSlider extends Slider {
alert: releasedString,
cancelOther: false
} );
phet.joist.sim.selfVoicingUtteranceQueue.addToBack( releasedUtterance );
phet.joist.sim.voicingUtteranceQueue.addToBack( releasedUtterance );
}
}, options );

Expand All @@ -70,7 +70,7 @@ class GestureControlledSlider extends Slider {
const objectContent = options.selfVoicingLabel;

const response = levelSpeakerModel.collectResponses( objectContent );
phet.joist.sim.selfVoicingUtteranceQueue.addToBack( response );
phet.joist.sim.voicingUtteranceQueue.addToBack( response );
}
} ) );
}
Expand Down
2 changes: 1 addition & 1 deletion js/view/SelfVoicingLandingDialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ class SelfVoicingLandingDialog extends Dialog {
// to add code to Dialog, and I didn't want to work in a branch so this is here for now
Display.focusProperty.lazyLink( focus => {
if ( focus && focus.trail.lastNode().innerContent === 'Close' ) {
phet.joist.sim.selfVoicingUtteranceQueue.addToBack( 'Close' );
phet.joist.sim.voicingUtteranceQueue.addToBack( 'Close' );
}
} );
}
Expand Down
2 changes: 1 addition & 1 deletion js/view/ValueGestureControl.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ const ValueGestureControl = {
manipulation: changeValueString
} );
const response = levelSpeakerModel.collectResponses( interactionHint );
phet.joist.sim.selfVoicingUtteranceQueue.addToBack( response );
phet.joist.sim.voicingUtteranceQueue.addToBack( response );
}
} );
}
Expand Down

0 comments on commit cc94b26

Please sign in to comment.