diff --git a/src/TimerRecordDialog.cpp b/src/TimerRecordDialog.cpp index ad5897eeb..e99b001e6 100644 --- a/src/TimerRecordDialog.cpp +++ b/src/TimerRecordDialog.cpp @@ -79,6 +79,11 @@ enum { POST_TIMER_RECORD_SHUTDOWN }; +// The slow timer interval is used to update the start and end times, which only show +// time to the nearest second. So we only need an update once a second. +const int kSlowTimerInterval = 1000; // ms + +// This timer interval is used in some busy-wait loops and is much shorter. const int kTimerInterval = 50; // ms static double wxDateTime_to_AudacityTime(wxDateTime& dateTime) @@ -177,7 +182,7 @@ TimerRecordDialog::TimerRecordDialog(wxWindow* parent, bool bAlreadySaved) m_pTimeTextCtrl_Duration->SetFieldFocus(3); m_timer.SetOwner(this, TIMER_ID); - m_timer.Start(kTimerInterval); + m_timer.Start(kSlowTimerInterval); // Do we need to tidy up when the timer recording has been completed? m_bProjectCleanupRequired = !(this->HaveFilesToRecover()); @@ -1019,7 +1024,15 @@ void TimerRecordDialog::UpdateEnd() { //v Use remaining disk -> record time calcs from AudacityProject::OnTimer to set range? m_DateTime_End = m_DateTime_Start + m_TimeSpan_Duration; + //wxLogDebug( "Time start %s end %s", + // m_DateTime_Start.FormatISOCombined(' '), + // m_DateTime_End.FormatISOCombined(' ') ); + + // Disable the range limitation (to fix Bug 1749 and 1978) + // Otherwise SetVallue asserts when going back in time. + m_pDatePickerCtrl_End->SetRange(wxInvalidDateTime, wxInvalidDateTime); m_pDatePickerCtrl_End->SetValue(m_DateTime_End); + // Re-enable range limitation to constrain user input. m_pDatePickerCtrl_End->SetRange(m_DateTime_Start, wxInvalidDateTime); // No backdating. m_pDatePickerCtrl_End->Refresh(); m_pTimeTextCtrl_End->SetValue(wxDateTime_to_AudacityTime(m_DateTime_End));