Add Repeat button to the Speaker test

This commit is contained in:
Mathias Malmqvist
2025-10-12 01:09:37 +02:00
committed by dualshock-tools
parent 5efa1b5be4
commit 889ecf6b29
23 changed files with 34 additions and 1 deletions

View File

@@ -307,6 +307,7 @@ export class QuickTestModal {
case 'speaker':
const speakerTestDesc = l('This test will play a tone through the controller\'s built-in speaker.');
const speakerInstructions = l('Listen for a tone from the controller speaker.');
const repeat = l('Repeat');
return `
<p>${speakerTestDesc}</p>
<p><strong>${instructions}:</strong> ${speakerInstructions}</p>
@@ -317,6 +318,9 @@ export class QuickTestModal {
<button type="button" class="btn btn-danger" id="speaker-fail-btn" onclick="markTestResult('speaker', false)">
<i class="fas fa-times me-1"></i><span>${fail}</span>
</button>
<button type="button" class="btn btn-outline-primary" id="speaker-replay-btn" onclick="replaySpeakerTest()">
<i class="fas fa-redo me-1"></i><span>${repeat}</span>
</button>
</div>
`;
case 'microphone':
@@ -1614,10 +1618,17 @@ function testHeadphoneAudio() {
}
}
function replaySpeakerTest() {
if (currentQuickTestInstance) {
currentQuickTestInstance._startSpeakerTest();
}
}
// Legacy compatibility - expose functions to window for HTML onclick handlers
window.markTestResult = markTestResult;
window.resetAllTests = resetAllTests;
window.resetButtonsTest = resetButtonsTest;
window.skipTest = skipTest;
window.addTestBack = addTestBack;
window.testHeadphoneAudio = testHeadphoneAudio;
window.testHeadphoneAudio = testHeadphoneAudio;
window.replaySpeakerTest = replaySpeakerTest;