1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-05-05 14:18:53 +02:00

Bug 1253 - Assert when changing track spectrogram settings while audio I/O active

I first of all added a warning message if trying to configure while playing.
Then decided that it is more in keeping with current style to grey out the Spectrogram Settings menu item.

So the new warning message should actually never be reached.
This commit is contained in:
James Crook 2016-08-28 16:32:41 +01:00
parent d2768c6ab9
commit 0f2585a8ee

View File

@ -7569,7 +7569,11 @@ void TrackPanel::OnTrackMenu(Track *t)
: OnSpectrumID,
true
);
theMenu->Enable(OnSpectrogramSettingsID, display == WaveTrack::Spectrum);
// Bug 1253. Shouldn't open preferences if audio is busy.
// We can't change them on the fly yet anyway.
const bool bAudioBusy = gAudioIO->IsBusy();
theMenu->Enable(OnSpectrogramSettingsID,
(display == WaveTrack::Spectrum) && !bAudioBusy);
SetMenuCheck(*mRateMenu, IdOfRate((int) track->GetRate()));
SetMenuCheck(*mFormatMenu, IdOfFormat(track->GetSampleFormat()));
@ -8014,6 +8018,13 @@ private:
void TrackPanel::OnSpectrogramSettings(wxCommandEvent &)
{
if (gAudioIO->IsBusy()){
wxMessageBox(_("To change Spectrogram Settings, stop any\n."
"playing or recording first."),
_("Stop the Audio First"), wxOK | wxICON_EXCLAMATION | wxCENTRE);
return;
}
WaveTrack *const wt = static_cast<WaveTrack*>(mPopupMenuTarget);
// WaveformPrefsFactory waveformFactory(wt);
SpectrumPrefsFactory spectrumFactory(wt);