| 1873 | } |
| 1874 | |
| 1875 | void AudacityApp::OnKeyDown(wxKeyEvent &event) |
| 1876 | { |
| 1877 | if(event.GetKeyCode() == WXK_ESCAPE) { |
| 1878 | // Stop play, including scrub, but not record |
| 1879 | if ( auto project = ::GetActiveProject().lock() ) { |
| 1880 | auto token = ProjectAudioIO::Get( *project ).GetAudioIOToken(); |
| 1881 | auto &scrubber = Scrubber::Get( *project ); |
| 1882 | auto scrubbing = scrubber.HasMark(); |
| 1883 | if (scrubbing) |
| 1884 | scrubber.Cancel(); |
| 1885 | auto gAudioIO = AudioIO::Get(); |
| 1886 | if((token > 0 && |
| 1887 | gAudioIO->IsAudioTokenActive(token) && |
| 1888 | gAudioIO->GetNumCaptureChannels() == 0) || |
| 1889 | scrubbing) |
| 1890 | // ESC out of other play (but not record) |
| 1891 | ProjectAudioManager::Get( *project ).Stop(); |
| 1892 | else |
| 1893 | event.Skip(); |
| 1894 | } |
| 1895 | } |
| 1896 | |
| 1897 | event.Skip(); |
| 1898 | } |
| 1899 | |
| 1900 | // Ensures directory is created and puts the name into result. |
| 1901 | // result is unchanged if unsuccessful. |
nothing calls this directly
no test coverage detected