@@ -62,9 +62,9 @@ async function getTags(storageEngine: StorageEngine | undefined, type: 'particip
6262}
6363
6464export function ThinkAloudFooter ( {
65- visibleParticipants, rawTranscript, currentShownTranscription, width, onTimeUpdate, isReplay, editedTranscript, currentTrial, saveProvenance, jumpedToLine = 0 , studyId, setHasAudio, storageEngine,
65+ visibleParticipants, rawTranscript, currentShownTranscription, width, onTimeUpdate, isReplay, editedTranscript, currentTrial, saveProvenance, jumpedToLine = 0 , studyId, setHasAudio, storageEngine, forceMute , onAnalysisIsPlayingChange , onProvenanceTimelineChange ,
6666} : {
67- visibleParticipants : string [ ] , rawTranscript : TranscribedAudio | null , currentShownTranscription : number | null , width : number , onTimeUpdate : ( n : number ) => void , isReplay : boolean , editedTranscript ?: EditedText [ ] , currentTrial : string , saveProvenance : ( prov : unknown ) => void , jumpedToLine ?: number , studyId : string , setHasAudio : ( b : boolean ) => void , storageEngine : StorageEngine | undefined ,
67+ visibleParticipants : string [ ] , rawTranscript : TranscribedAudio | null , currentShownTranscription : number | null , width : number , onTimeUpdate : ( n : number ) => void , isReplay : boolean , editedTranscript ?: EditedText [ ] , currentTrial : string , saveProvenance : ( prov : unknown ) => void , jumpedToLine ?: number , studyId : string , setHasAudio : ( b : boolean ) => void , storageEngine : StorageEngine | undefined , forceMute ?: boolean , onAnalysisIsPlayingChange ?: ( b : boolean ) => void , onProvenanceTimelineChange ?: ( n : number ) => void ,
6868} ) {
6969 const auth = useAuth ( ) ;
7070
@@ -80,7 +80,9 @@ export function ThinkAloudFooter({
8080
8181 const { value : allParticipantTags , execute : pullAllParticipantTags } = useAsync ( getTags , [ storageEngine , 'participant' ] ) ;
8282 const [ analysisIsPlaying , _setAnalysisIsPlaying ] = useState ( false ) ;
83- const [ isMuted , setIsMuted ] = useState ( true ) ;
83+
84+ const [ _isMuted , setIsMuted ] = useState ( true ) ;
85+ const isMuted = forceMute ? true : _isMuted ;
8486
8587 const [ audioUrl , setAudioUrl ] = useState < string | null > ( null ) ;
8688 const [ screenRecordingUrl , setScreenRecordingUrl ] = useState < string | null > ( null ) ;
@@ -142,7 +144,9 @@ export function ThinkAloudFooter({
142144 setIsMuted ( true ) ;
143145 }
144146 _setAnalysisIsPlaying ( playing ) ;
145- } , [ ] ) ;
147+
148+ onAnalysisIsPlayingChange && onAnalysisIsPlayingChange ( playing ) ;
149+ } , [ onAnalysisIsPlayingChange ] ) ;
146150
147151 const [ transcriptLines , setTranscriptLines ] = useState < TranscriptLinesWithTimes [ ] | null > ( null ) ;
148152
@@ -278,15 +282,15 @@ export function ThinkAloudFooter({
278282 < AppShell . Footer zIndex = { 101 } withBorder = { false } >
279283 < Stack style = { { backgroundColor : 'var(--mantine-color-blue-1)' , height : '100%' } } gap = { 5 } justify = "center" >
280284
281- < AudioProvenanceVis isMuted = { isMuted } setHasAudio = { setHasAudio } jumpedToAudioTime = { jumpedToTime } speed = { speed } setSpeed = { setSpeed } saveProvenance = { saveProvenance } analysisIsPlaying = { analysisIsPlaying } setAnalysisIsPlaying = { setAnalysisIsPlaying } setTime = { onTimeUpdate } setTimeString = { ( _t ) => setTimeString ( _t ) } answers = { participant ? participant . answers : { } } taskName = { currentTrial } context = { isReplay ? 'provenanceVis' : 'audioAnalysis' } />
285+ < AudioProvenanceVis isMuted = { isMuted } setHasAudio = { setHasAudio } jumpedToAudioTime = { jumpedToTime } speed = { speed } setSpeed = { setSpeed } saveProvenance = { saveProvenance } analysisIsPlaying = { analysisIsPlaying } setAnalysisIsPlaying = { setAnalysisIsPlaying } setTime = { onTimeUpdate } setTimeString = { ( _t ) => setTimeString ( _t ) } answers = { participant ? participant . answers : { } } taskName = { currentTrial } context = { isReplay ? 'provenanceVis' : 'audioAnalysis' } onProvenanceTimelineChange = { onProvenanceTimelineChange } />
282286 { xScale && transcriptLines ? < TranscriptSegmentsVis startTime = { xScale . domain ( ) [ 0 ] } xScale = { xScale } transcriptLines = { transcriptLines } currentShownTranscription = { currentShownTranscription || 0 } /> : null }
283287
284288 < Group gap = "xs" style = { { width : '100%' } } justify = "center" wrap = "nowrap" >
285289 < Group wrap = "nowrap" >
286290 < Text ff = "monospace" style = { { textAlign : 'right' } } mt = "lg" c = "dimmed" > { timeString } </ Text >
287291
288292 < Tooltip label = "Play" >
289- < ActionIcon mt = { 25 } size = "xl" variant = "light" onClick = { ( ) => { setAnalysisIsPlaying ( ! analysisIsPlaying ) ; setIsMuted ( ! isMuted ) ; } } >
293+ < ActionIcon mt = { 25 } size = "xl" variant = "light" onClick = { ( ) => { setAnalysisIsPlaying ( ! analysisIsPlaying ) ; setIsMuted ( ! _isMuted ) ; } } >
290294 { analysisIsPlaying ? < IconPlayerPauseFilled /> : < IconPlayerPlayFilled /> }
291295 </ ActionIcon >
292296 </ Tooltip >
0 commit comments