sillsdev / SpeechAnalyzer

SIL Speech Analyzer is a Windows program for acoustic analysis of speech sounds.
https://software.sil.org/speech-analyzer/
7 stars 3 forks source link

fix: Esc key to cancel progress status bar #28

Closed darcywong00 closed 3 years ago

darcywong00 commented 3 years ago

Addresses the first point in #13

Formant tracks can take a long time to process.

The option to “Press Esc to Cancel” does not stop the Formant tracking process.

This fixes the ProgressStatusBar() class so VK_ESCAPE will call the process owner -> CancelProcess()


Testing

  1. Open a long wav file
  2. On the left panel, display "Waveform, Spectrograph"
  3. Verify the progress bar shows progress
  4. Hit Esc to cancel the process
  5. Verify the spectrograph is canceled and there's a prompt "Process canceled. Press Enter to restart"
  6. Hit Enter to restart the process and let the spectrograph finish
  7. When the spectrograph is displayed, right-click on the spectrograph -> Parameters -> tick the box for "Formant tracks" -> OK
  8. Verify the progress bar starts while the formant tracks are computed
  9. Hit Esc to cancel the progress. This make take a few tries since the formant tracks use a lot of resources
  10. Verify the process is canceled

I note the issue asked that "Formant Tracks" default to off. On my development environment, formant tracks are already default to off.

darcywong00 commented 3 years ago

~Gonna go ahead and merge this trivial change~

nvm, the repo setting requites an approval. Happy to wait :)