Use WarningDialog for drop-outs, and change the wording

This commit is contained in:
Paul Licameli 2018-01-16 11:52:17 -05:00
parent e88615c1b6
commit 130e55cdf5
5 changed files with 26 additions and 9 deletions

View File

@ -450,6 +450,7 @@ TimeTrack and AudioIOListener and whether the playback is looped.
#include "toolbars/ControlToolBar.h"
#include "widgets/Meter.h"
#include "widgets/ErrorDialog.h"
#include "widgets/Warning.h"
#ifdef EXPERIMENTAL_MIDI_OUT
#define MIDI_SLEEP 10 /* milliseconds */
@ -1867,7 +1868,8 @@ int AudioIO::StartStream(const WaveTrackConstArray &playbackTracks,
{
mLostSamples = 0;
mLostCaptureIntervals.clear();
mDetectDropouts = gPrefs->Read(wxT("/AudioIO/DetectDropouts"), true);
mDetectDropouts =
gPrefs->Read( WarningDialogKey(wxT("DropoutDetected")), true );
auto cleanup = finally ( [this] { ClearRecordingException(); } );
if( IsBusy() )

View File

@ -4956,7 +4956,7 @@ void AudacityProject::GetRegionsByLabel( Regions &regions )
TrackListIterator iter(GetTracks());
Track *n;
//determine labelled regions
//determine labeled regions
for( n = iter.First(); n; n = iter.Next() )
if( n->GetKind() == Track::Label && n->GetSelected() )
{
@ -5388,11 +5388,13 @@ void AudacityProject::OnAudioIOStopRecording()
SelectedRegion{ interval.first, interval.second },
wxString::Format(wxT("%ld"), counter++),
-2 );
AudacityMessageBox(_(
"Recorded audio was lost at the labelled locations.\n\
This may have happened because you are saving directly to a \
slow external storage device, or because other applications are \
competing with Audacity for processor time."
ShowWarningDialog(this, wxT("DropoutDetected"), _("\
Recorded audio was lost at the labeled locations. Possible causes:\n\
\n\
\tOther applications are competing with Audacity for processor time\n\
\n\
\tYou are saving directly to a slow external storage device\n\
"
));
}

View File

@ -33,6 +33,8 @@
#include "../Experimental.h"
#include "../Internat.h"
#include "../widgets/Warning.h"
using std::min;
enum {
@ -166,8 +168,9 @@ void RecordingPrefs::PopulateOrExchange(ShuttleGui & S)
S.TieCheckBox(_("Always record on a new track"),
wxT("/GUI/PreferNewTrackRecord"),
false);
S.TieCheckBox(_("Detect dropouts"),
wxT("/AudioIO/DetectDropouts"),
WarningDialogKey(wxT("DropoutDetected")),
true);
}
S.EndStatic();

View File

@ -86,7 +86,7 @@ int ShowWarningDialog(wxWindow *parent,
const wxString &message,
bool showCancelButton)
{
wxString key(wxT("/Warnings/") + internalDialogName);
auto key = WarningDialogKey(internalDialogName);
if (!gPrefs->Read(key, (long) true)) {
return wxID_OK;
}
@ -101,3 +101,8 @@ int ShowWarningDialog(wxWindow *parent,
gPrefs->Flush();
return wxID_OK;
}
wxString WarningDialogKey(const wxString &internalDialogName)
{
return wxT("/Warnings/") + internalDialogName;
}

View File

@ -25,4 +25,9 @@ int ShowWarningDialog(wxWindow *parent,
const wxString &message,
bool showCancelButton = false);
/// Return the config file key associated with a warning dialog identified
/// by internalDialogName. When the box is checked, the value at the key
/// becomes false.
wxString WarningDialogKey(const wxString &internalDialogName);
#endif // __AUDACITY_WARNING__